Support PostgreSQL DO wrappers with preserved routine body literals - #2589
Merged
manticore-projects merged 2 commits intoSep 11, 2026
Merged
Conversation
minleejae
force-pushed
the
feat/postgres-do-statement
branch
from
September 11, 2026 15:49
708e2ac to
b3bb90d
Compare
minleejae
force-pushed
the
feat/postgres-do-statement
branch
from
September 11, 2026 15:54
b3bb90d to
f5069d6
Compare
Contributor
|
This is big! Thank you so much! |
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.
With
Dialect.POSTGRESQL,DOnow parses into a dedicatedDoStatementthat preserves its body literal, dollar-quote tag, optional language and language-clause position. The wrapper uses shared rendering for the model and deparser; visitors can inspect or replace the body literal, and validation exposes a PostgreSQLdoStatementcapability.This is the wrapper/body-preservation stage of #1946. It does not parse the procedural language inside the string into an INSERT/IF/loop AST. Feature analysis reports the statement as opaque, and table discovery explicitly reports unsupported analysis rather than claiming an empty set of tables.
Tests cover both LANGUAGE positions, tagged/untagged dollar and single-quoted bodies, a representative issue block followed by another statement, AST edits, visitor/deparser customization, dialect isolation, capability validation and malformed wrappers. Full Gradle check and Maven verify passed (local formatter ratchet: upstream base
eddb1fb5).Refs #1946.
Syntax: PostgreSQL DO.