Here're little things that would make my life better when I'm generating SQL queries:
1. Support trailing commas.
2. Add operator `is` which works like `==` but for nulls it returns `true`. Could also remove automatic type casting, I'd be happy about that, never liked it.
3. Support trailing `or`-s and `and`-s.
So query could look like
select a, b,
from t
where (a.x is :x and a.y is :y and) or
(b.x is :x and) or
As an aside, avoid OR as much as possible in your WHERE clauses. Adjust your relations if necessary. ORs can really blow the planner up and slow things down. ANDs are reductive wrt indexes. ORs make multiple passes on the indexes necessary.
It's not always possible to avoid, and it makes perfect sense sometimes, but it'd be better if folks didn't lean into OR so much.
So that you can generate SQL more easily, and (for hand-written statements) so that you can re-order lines more easily. Many programming languages support trailing commas.
1. Support trailing commas.
2. Add operator `is` which works like `==` but for nulls it returns `true`. Could also remove automatic type casting, I'd be happy about that, never liked it.
3. Support trailing `or`-s and `and`-s.
So query could look like