Support empty sets in (x IN @foo) exprs (#109)
* sql: revamp IN @x support, require surrounding params + allow empty set
* sql: recover (x NOT IN @x) syntax
* xml: fix SQL for IN @x
* xml: fix collecting of set invars
* test: update tests for new (... IN @x) syntax
* gen: fix discovery of var names inside (x IN @xs) expressions
* test: + check discovery of params in LHS of (x IN @xs) expr
* sql, gen: support IN expressions in variants
SELECT * FROM foo WHERE
@ids { None { TRUE } | Some { (foo = @x AND (id IN @ids1) OR (id IN @ids2)) } };
* gen: fix left-to-right order for IN expr LHS and RHS in variants
emit correct code for
@ids2 { None { TRUE } | Some { (foo = @x AND (CONCAT(foo, @y, 'xxx') IN @set1) } }
the pattern must be
`Some (x,y,set1)
was
`Some (x,set1,y)
* sql: drop requirement to use parentheses around x IN @xs
* lib: refactor Sql.var type
* sql: fix parsing of expressions like `x` in @xs
* gen: simplify pattern in generated code when possible
* lib: drop parenthesis position tracking in parser
* gen: fix codegen for IN exprs without parentheses