Potential solve for #200 #396
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I've changed around the grammar a bit in order to support CASE WHENs being used as Conditions on their own (see #200). This means that the THENs and ELSEs have to be able to contain full expressions. One of the problems that made this not work was that Condition() would be okay with turning into a Column or a 0 or 1. I've removed this and added Conditions becoming SimpleExpressions. This does however mean that it will accept any SimpleExpression in place of a condition, for instance:
or
Which is also why I removed one of the tests what ensure this is not parse-able. I would argue that while it may indeed not be valid SQL (depending on the DB's implementation), it is no harm if it is actually parse-able. What do you think of this?