sqlgg icon indicating copy to clipboard operation
sqlgg copied to clipboard

Context-aware substitution

Open mfp opened this issue 4 years ago • 0 comments

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).

mfp avatar Feb 01 '21 14:02 mfp