Skip to content

Commit 8ed22c5

Browse files
kyleconroyclaude
andcommitted
Add graph database and temporal table parsing support
- Add MATCH predicate support in WHERE clauses - Support chained graph patterns (A-(B)->C-(D)->E) - Add NOT MATCH support for negated graph patterns - Add GENERATED ALWAYS AS ROW START/END for temporal columns - Add PERIOD FOR SYSTEM_TIME parsing in CREATE TABLE - Add SYSTEM_VERSIONING = ON/OFF table option - Add SystemTimePeriodDefinition AST type - Support graph pseudo-columns ($node_id, $edge_id, $from_id, $to_id) - Make BooleanBinaryExpression implement graphMatchExpression for chained patterns - Make GraphMatchCompositeExpression implement booleanExpression Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e725593 commit 8ed22c5

6 files changed

Lines changed: 320 additions & 36 deletions

File tree

ast/boolean_binary_expression.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ type BooleanBinaryExpression struct {
77
SecondExpression BooleanExpression `json:"SecondExpression,omitempty"`
88
}
99

10-
func (*BooleanBinaryExpression) node() {}
11-
func (*BooleanBinaryExpression) booleanExpression() {}
10+
func (*BooleanBinaryExpression) node() {}
11+
func (*BooleanBinaryExpression) booleanExpression() {}
12+
func (*BooleanBinaryExpression) graphMatchExpression() {}

ast/create_table_statement.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,19 @@ type TableDefinition struct {
4141
ColumnDefinitions []*ColumnDefinition
4242
TableConstraints []TableConstraint
4343
Indexes []*IndexDefinition
44+
SystemTimePeriod *SystemTimePeriodDefinition
4445
}
4546

4647
func (t *TableDefinition) node() {}
4748

49+
// SystemTimePeriodDefinition represents PERIOD FOR SYSTEM_TIME clause
50+
type SystemTimePeriodDefinition struct {
51+
StartTimeColumn *Identifier
52+
EndTimeColumn *Identifier
53+
}
54+
55+
func (s *SystemTimePeriodDefinition) node() {}
56+
4857
// ColumnDefinition represents a column definition in CREATE TABLE
4958
type ColumnDefinition struct {
5059
ColumnIdentifier *Identifier
@@ -55,6 +64,7 @@ type ColumnDefinition struct {
5564
IdentityOptions *IdentityOptions
5665
Constraints []ConstraintDefinition
5766
Index *IndexDefinition
67+
GeneratedAlways string // RowStart, RowEnd, etc.
5868
IsPersisted bool
5969
IsRowGuidCol bool
6070
IsHidden bool

ast/merge_statement.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ type GraphMatchCompositeExpression struct {
9595

9696
func (g *GraphMatchCompositeExpression) node() {}
9797
func (g *GraphMatchCompositeExpression) graphMatchExpression() {}
98+
func (g *GraphMatchCompositeExpression) booleanExpression() {}
9899

99100
// GraphMatchNodeExpression represents a node in a graph match pattern
100101
type GraphMatchNodeExpression struct {

0 commit comments

Comments
 (0)