sqlgg
sqlgg copied to clipboard
Context-aware substitution
Currently sqlgg performs purely textual substitution in cases like this:
SELECT * FROM foo
WHERE a AND
@bar { Some { bar OR baz } | None { TRUE } }
which easily leads to bugs (WHERE a AND bar OR baz instead of the intended WHERE a AND (bar OR baz)).
It'd be nice to constrain usage of variants to make these substitutions context-aware and prevent such errors (e.g. in this case, adding surrounding parentheses automatically).