Skip to content

Commit

Permalink
Fixed a case where the contents of the where clause were not rendered…
Browse files Browse the repository at this point in the history
… before being used in the clause
  • Loading branch information
kenkendk committed Aug 19, 2021
1 parent cd107c4 commit c5c5f48
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Ceen.Database/DatabaseDialectSQLite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,14 +486,18 @@ private string RenderWhereClause(Type type, object element, List<object> args)
// args.Add(items);
// return $"{RenderWhereClause(type, compare.LeftHandSide, args)} {compare.Operator} (?)";

// Render before, in case LHS needs to be in the args list
var lhsstr = RenderWhereClause(type, compare.LeftHandSide, args);

// Workaround is to expand to comma separated list
var qs = new List<string>();
foreach (var n in items)
{
args.Add(n);
qs.Add("?");
}
return $"{RenderWhereClause(type, compare.LeftHandSide, args)} {compare.Operator} ({string.Join(",", qs)})";

return $"{lhsstr} {compare.Operator} ({string.Join(",", qs)})";
}

// Extract the arguments, if they are arguments
Expand Down

0 comments on commit c5c5f48

Please sign in to comment.