-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various improvements: aggregate functions, insert set syntax, & update join syntax #68
Conversation
77e901a
to
0efb1c0
Compare
Wow @DerekStride, kudos to you! This quick and comprehensive response by far exceeds all my expectations! I will test your branch as well, to confirm the fixes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couple things to think about but it looks good in general!
@@ -1000,6 +990,11 @@ module.exports = grammar({ | |||
')', | |||
), | |||
|
|||
_aggregate_function: $ => choice( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!
* Also updates the values branch of the grammar to allow for specifying multiple lists of items.
Previous to this commit `count` was a special case node. It worked a lot like the `invocation` node but had some custom grammar rules. This commit introduced another special case node, group_concat. According to the MySQL reference there might not be many more like this but to provide a pattern for the future I moved both count & group_concat into a special anonymous node called `_aggregate_functions`. https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html
Previously there was separate anonymous nodes for single table & multi table update statements. This commit merges them into a single node and reworks them to support the JOIN syntax.
* Postgres supports a from-clause after the assignment list in the `set` clause.
0efb1c0
to
61c6e23
Compare
What
There are 3 updates that fix the issues described in #67.
cc// @LeoniePhiline
Update insert to support SET syntax
3f08080
2fdc428
Also updates the values branch of the grammar to allow for specifying multiple lists of items. The other commit includes support for the postgres style update statement.
Rework special cases for aggregate functions
8c0ca86
61c6e23
Previous to this commit
count
was a special case node. It worked a lot like theinvocation
node but had some custom grammar rules.This commit introduced another special case node, group_concat. According to the MySQL reference there might not be many more like this but to provide a pattern for the future I moved both count & group_concat into a special anonymous node called
_aggregate_functions
.The other commit adds the
_aggregate_expression
node from the suggestions.Consolidate UPDATE rules into 1 node
3b82416
Previously there was separate anonymous nodes for single table & multi table update statements. This commit merges them into a single node and reworks them to support the JOIN syntax.