Skip to content

Support PostgreSQL DO wrappers with preserved routine body literals - #2589

Merged
manticore-projects merged 2 commits into
JSQLParser:masterfrom
minleejae:feat/postgres-do-statement
Sep 11, 2026
Merged

Support PostgreSQL DO wrappers with preserved routine body literals#2589
manticore-projects merged 2 commits into
JSQLParser:masterfrom
minleejae:feat/postgres-do-statement

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

With Dialect.POSTGRESQL, DO now parses into a dedicated DoStatement that 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 PostgreSQL doStatement capability.

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.

@minleejae
minleejae force-pushed the feat/postgres-do-statement branch from 708e2ac to b3bb90d Compare September 11, 2026 15:49
@minleejae
minleejae force-pushed the feat/postgres-do-statement branch from b3bb90d to f5069d6 Compare September 11, 2026 15:54
@manticore-projects
manticore-projects merged commit 1bc9424 into JSQLParser:master Sep 11, 2026
3 of 4 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

This is big! Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants