Skip to content

Support Informix trailing constraint names and share constraint rendering - #2570

Open
minleejae wants to merge 1 commit into
JSQLParser:masterfrom
minleejae:fix/informix-constraint-names
Open

Support Informix trailing constraint names and share constraint rendering#2570
minleejae wants to merge 1 commit into
JSQLParser:masterfrom
minleejae:fix/informix-constraint-names

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

Informix places an optional constraint name after its definition, for example:

ALTER TABLE child ADD CONSTRAINT FOREIGN KEY (id)
REFERENCES parent(id) CONSTRAINT fk_child;

Support this form for primary, unique, foreign and check constraints, including unnamed constraints. The existing constraint models expose the name, columns, referenced table and CHECK expression; NamedConstraint.ConstraintNamePosition preserves the name's placement. Shared prefix/suffix rendering keeps model and deparser output consistent while preserving the existing leading-name API defaults.

Validation:

  • Full Gradle check and Maven verify.
  • Original primary/foreign/unique reproducers, quoted and omitted names, composite keys, mutable AST names, subsequent actions/statements, and malformed input.
  • SQL round-trips, CHECK expression visitor customization, referenced-table traversal, and existing CREATE/ALTER regression tests.
  • Syntax checked against the Informix ADD CONSTRAINT documentation.

Fixes #271.

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.

Parse errors for ALTER TABLE with Informix syntax

1 participant