Introduce shortcut syntax for optional bool in WHERE expr#142
Introduce shortcut syntax for optional bool in WHERE expr#142jongleb merged 9 commits intoygrek:ahrefsfrom
WHERE expr#142Conversation
WHERE expr
|
didn't look at the code
|
Just shortcut
Yes, something like with
Ok I'll remove it |
|
ok, so keep this PR only about introducing automatic elimination for A? OR B? |
0b27da2 to
e55b86e
Compare
e55b86e to
47c8e68
Compare
|
@ygrek I removed the unnecessary stuff, made a couple of edits and allowed myself to merge, since this PR is already a month old, if there will any new comments, I will fix them in a separate PR |
This PR adds new syntax:
WHERE A? AND B? OR C? which is a shortcut to WHERE @choice { None { TRUE } | Some (params) { A } } AND etcAnd considers
join_condas not null by the defaultExample:
DDL:
SQL:
will be generated the following code:
Also, it differs from the regular
Choicein that, in this case, not a polymorphic variant is generated because for this case, it would lead to the useless matching from the regularoptiontype to the poly version of the option in the user code.