summaryrefslogtreecommitdiff
path: root/hobgoblin/src/output/lang/sql
diff options
context:
space:
mode:
Diffstat (limited to 'hobgoblin/src/output/lang/sql')
-rw-r--r--hobgoblin/src/output/lang/sql/ast.hob15
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;
}