chore(deps): upgrade sqlparser 0.55 to 0.62 - #149
Closed
Blankll wants to merge 1 commit into
Closed
Conversation
0.62 parses statement shapes 0.55 could not: `WITH ... DELETE`, `WITH ... MERGE` and DELETE/MERGE inside CTE bodies are now valid ASTs (Query body carries SetExpr::Delete/SetExpr::Merge), so the MCP classifier no longer fails closed on them. The recursive classifier gains the Delete/Merge arms (both the statement body and nested CTE positions) and routes them to execute_delete / execute_write respectively. Migration for breaking AST changes: - sql_write.rs: the 0.55 SET-family variants (SetVariable, SetNames, SetNamesDefault, SetRole, SetSessionParam, SetTimeZone, SetTransaction) are consolidated into Statement::Set - sql_service.rs: SelectItem gained ExprWithAliases (Spark) - projected names now use its first alias, falling back to the expression name Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
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.
Stacked on #147
This PR builds on
fix/with-dml-classification(#147): its recursive classifier is what consumes the newly-parseable statement shapes. Merge #147 first.Why upgrade
sqlparser 0.55 cannot parse
WITH … DELETE,WITH … MERGE, or DELETE/MERGE inside a CTE body — all valid PostgreSQL (and SQL Server, for DELETE/MERGE-with-CTE). The MCP classifier (classify_sql) therefore fails closed with a parse error for those statements, makingsqlkit__execute_deleteunusable for them.sqlparser 0.62 parses all of them, representing the top-level DML as
Query { body: SetExpr::Delete/Merge(Statement) }(mirroring the existingSetExpr::Insert/Updateshape).Changes
Cargo.toml:sqlparser0.55 → 0.62capabilities/sql_write.rs:SetExpr::Delete/SetExpr::Mergearms →WITH … DELETEroutes to Delete,WITH … MERGEto WriteStatementvariants (SetVariable/SetNames/SetNamesDefault/SetRole/SetSessionParam/SetTimeZone/SetTransaction) consolidated intoStatement::Setdatabase/sql_service.rs:SelectItemgainedExprWithAliases(Spark) — column extraction uses its first alias, falling back to the expression nameTests
classifies_with_delete_as_delete(top-levelWITH … DELETE+ DELETE-in-CTE-returning),classifies_with_merge_as_writecargo fmt --checkclean on changed files; no new clippy warnings