feat: upgrade parser stack to PG18 (pgsql-parser 18.1.1, libpg-query 18.1.2)#1409
Merged
Conversation
…18.1.2) - bump pgsql-parser/deparser, plpgsql-*, @pgsql/* deps to the 18.1.x line - regenerate pg-ast from the PG18 pg_query.proto (returningClause, ReturningOption, ATAlterConstraint, etc.) - query-builder: emit InsertStmt/UpdateStmt/DeleteStmt returningClause instead of removed returningList - sql-expression-validator: narrow PG18 Node union before member access
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Summary
Moves the monorepo onto the PG18 parser stack (
pgsql-parser/pgsql-deparser/@pgsql/*18.1.x,libpg-query18.1.2) and fixes the PG18 AST breaking changes:asts.ts/wrapped.tsfrom PG18'spg_query.proto(newReturningClause/ReturningOption/ATAlterConstraintnodes;SinglePartitionSpec/inhcount/rctyperemoved).returningList→returningClauseon Insert/Update/DeleteStmt._buildReturningList(): unknown[]→_buildReturningClause(): { exprs }. Without this, the PG18 deparser silently dropsRETURNING— this is the root cause of constructive-db'ssync-gateway-route-dispatchCI failure (InvocationTracker.insertRunninggot 0 rows back fromINSERT ... RETURNING id).Nodea strict union; narrow with'SelectStmt' in stmt/'ResTarget' in targetNodebefore member access.After merge,
pg-astand@constructive-io/query-builderneed publishing so constructive-db (PR constructive-io/constructive-db#2396) can pick up thereturningClausefix.Verified: full build green; query-builder 111, pg-ast, sql-expression-validator 271 tests pass;
INSERT ... RETURNING idemits correctly again. The graphile-upload-plugin test failure (graphqlGraphQLNamedTypetyping) reproduces identically on main.Link to Devin session: https://app.devin.ai/sessions/064ad193e1c040af8c145d55e07af9b8
Requested by: @pyramation