Skip to content

Comments

feat: support anonymous table constraint style PRIMARY KEY#338

Open
apstndb wants to merge 1 commit intocloudspannerecosystem:mainfrom
apstndb:feat/anonymous-primary-key
Open

feat: support anonymous table constraint style PRIMARY KEY#338
apstndb wants to merge 1 commit intocloudspannerecosystem:mainfrom
apstndb:feat/anonymous-primary-key

Conversation

@apstndb
Copy link
Contributor

@apstndb apstndb commented Feb 9, 2026

Support anonymous PRIMARY KEY style as a table constraint inside the parentheses of CREATE TABLE.

This is the third way to define a primary key in Spanner, in addition to the inline column definition (PK INT64 PRIMARY KEY) and the trailing clause (PRIMARY KEY (PK)) outside the table elements. This style is supported by the Spanner emulator and actual database behavior.

Design decision

Introduced ast.TablePrimaryKey as a TableConstraint and updated Parser.parseCreateTable to support anonymous PRIMARY KEY inside the table elements while intentionally excluding named constraints.

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.

1 participant