Upgrade sqlparser dependency to 0.56.0#9
Conversation
The Generic and BigQuery dialects do not support "DELETE <tables> FROM" syntax. The MsSql dialect treats TRUE and FALSE as identifiers rather than literals, so they are not normalized as they would be in other dialects.
This should help us pass the lint check.
takaebato
left a comment
There was a problem hiding this comment.
The changes and improvements look great! Thank you so much for your work!
(This is unrelated to this change, but I find it odd that GenericDialect cannot parse DELETE <tables> FROM <tables>. As far as I remember, the design policy was that GenericDialect should be able to parse anything that other dialects can. I’ll open an issue on sqlparser-rs about this.)
Thanks again!
Looks like sqlparser-rs broke that in #1120 while making the
But not these, which are a reduce/reduce conflict:
So you can't just make the I think it might be best to write two versions of |
|
Thanks for the clarification! |
This PR upgrades the sqlparser dependency to 0.56.0.
There were a few straightforward changes in the sqlparser API:
Statement::Insert,Statement::Delete, andFromTablehave an additional layer of wrappingStatement::Insertcan now insert to a table or a table functionMergeClausenow puts its action in a separateactionfieldExpr::Valuenow expects aValueWithSpanI took the opportunity to consolidate some duplicated code in constructing
TableReferencefrom various kinds of identifiers.I also had to disable six tests for various dialects:
DELETE <tables> FROM <tables>is no longer valid syntax in the Generic or BigQuery dialectsTRUEandFALSEas identifiers rather than constants, so they don't get normalizedTo support that, I added an
all_dialects_except(...)helper to the test suite.cargo fmtandcargo clippyboth pass.