Skip to content

feat: preserve ALTER COLUMN default expressions in the AST - #2611

Merged
manticore-projects merged 2 commits into
JSQLParser:masterfrom
minleejae:feat/ddl-alter-default-expression
Sep 12, 2026
Merged

manticore-projects merged 2 commits into
JSQLParser:masterfrom
minleejae:feat/ddl-alter-default-expression

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

ALTER COLUMN SET DEFAULT currently converts the parsed expression into a String, preventing expression traversal and custom deparsing. Retain the Expression, expose it for AST edits, and derive the existing getDefaultValue() text from it. The legacy String constructor remains available and opaque, including nullable calls.

Share ALTER COLUMN action rendering and route ALTER validation through the existing table-definition traversal. Regression tests cover arithmetic, casts, functions, NULL, multiple actions, visitor context, custom deparsing and AST edits.

This change covers ALTER COLUMN SET DEFAULT; CREATE TABLE column defaults retain their existing representation.

Validation: Java 17 ./gradlew check passed, including the full test suite, grammar ambiguity check and static analysis.

@manticore-projects
manticore-projects merged commit 08de141 into JSQLParser:master Sep 12, 2026
10 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Thank you!

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