Support predicates in function arguments#457
Open
cpsievert wants to merge 5 commits into
Open
Conversation
ca44052 to
7885ef5
Compare
Collaborator
|
How much more complex would it be to organise the grammar to also add the extra keywords and allow for the proposed predicates, IMO if it is not too more more complex we may as well just do it now. Let me know. If you'd prefer to defer it I'll approve and merge. |
7885ef5 to
1d45ef8
Compare
1d45ef8 to
19465cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #456.
Summary
This PR improves SQL parsing inside function arguments.
The first commit takes the minimal step needed for the original issue by allowing
AND/ORin function arguments.The second commit expands that same area to support additional predicate forms in function arguments and named function-argument values:
NOTIN (...)BETWEEN ... AND ...IS NULLLIKE/ILIKEExamples that now parse include:
Scope
The richer predicate grammar is still scoped to function arguments rather than being applied to
position_argmore generally. This keeps the change focused on the parser gap addressed by this PR instead of turning it into a broader SQL expression refactor.Verification
cargo test -p ggsql function_args -- --nocapturecd tree-sitter-ggsql && tree-sitter generate && tree-sitter test