diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-10-16 09:11:52 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-10-16 09:11:52 +0100 |
| commit | e2f02b6a09548e74304cbc6e32b6ce720d6dba84 (patch) | |
| tree | 8bb388c9fabd028da7d257919f0f081004d6a3c5 /hobgoblin/src | |
| parent | b0c668a96bc8da225d7a0c35dfd7ce4178ebb7c4 (diff) | |
Add primary key constraint to SQL AST
Diffstat (limited to 'hobgoblin/src')
| -rw-r--r-- | hobgoblin/src/output/lang/sql/ast.hob | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hobgoblin/src/output/lang/sql/ast.hob b/hobgoblin/src/output/lang/sql/ast.hob index 9a51e38..f5dad7d 100644 --- a/hobgoblin/src/output/lang/sql/ast.hob +++ b/hobgoblin/src/output/lang/sql/ast.hob @@ -1,3 +1,5 @@ +// == Statements == + sum SqlStatement { variant SqlCreateTableStatement; } @@ -5,6 +7,7 @@ sum SqlStatement { struct SqlCreateTableStatement { field name: SqlIdentifier; field columns: List[SqlColumnDefinition]; + field tableConstraints: List[SqlTableConstraint]; } struct SqlColumnDefinition { @@ -12,6 +15,18 @@ struct SqlColumnDefinition { field typeName: SqlIdentifier; } +// == Table constraints == + +sum SqlTableConstraint { + variant SqlPrimaryKeyConstraint; +} + +struct SqlPrimaryKeyConstraint { + field columns: List[SqlIdentifier]; +} + +// == Identifiers == + struct SqlIdentifier { field value: String; } |
