Skip to content

Support SQL Server clustering on primary key and unique constraints - #2582

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/sqlserver-clustered-constraints
Sep 11, 2026
Merged

Support SQL Server clustering on primary key and unique constraints#2582
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/sqlserver-clustered-constraints

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

PRIMARY KEY NONCLUSTERED (actor_id) currently stores NONCLUSTERED as an index name. With parser.withDialect(Dialect.SQLSERVER), primary key and unique table constraints now expose Index.Clustering.CLUSTERED / NONCLUSTERED, including named and unnamed constraints in CREATE TABLE and ALTER TABLE.

A shared grammar production reads the modifier, and Index/NamedConstraint share its rendering. An omitted modifier stays null; other dialects retain their existing identifier interpretation. The dialect requirement is documented.

Validation: the original Sakila example, CREATE/ALTER and named/unnamed variants, AST mutation and round-trips, quoted identifiers, other dialects, and malformed modifiers; full Gradle check and Maven verify.

Fixes #1589.

@manticore-projects
manticore-projects merged commit c1a611d into JSQLParser:master Sep 11, 2026
9 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

Good, 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.

Error in parsing create statement: Encountered unexpected token: "KEY" "KEY"

2 participants