Skip to content

Commit e5e310d

Browse files
authored
Add support for MiscTests90 parsing features (#58)
1 parent 6fef455 commit e5e310d

File tree

26 files changed

+743
-83
lines changed

26 files changed

+743
-83
lines changed

ast/alter_database_set_statement.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ func (a *AlterDatabaseAddFileGroupStatement) statement() {}
130130

131131
// AlterDatabaseModifyFileStatement represents ALTER DATABASE ... MODIFY FILE statement
132132
type AlterDatabaseModifyFileStatement struct {
133-
DatabaseName *Identifier
133+
DatabaseName *Identifier
134+
FileDeclaration *FileDeclaration
135+
UseCurrent bool
134136
}
135137

136138
func (a *AlterDatabaseModifyFileStatement) node() {}
@@ -176,6 +178,15 @@ type AlterDatabaseRemoveFileGroupStatement struct {
176178
func (a *AlterDatabaseRemoveFileGroupStatement) node() {}
177179
func (a *AlterDatabaseRemoveFileGroupStatement) statement() {}
178180

181+
// AlterDatabaseCollateStatement represents ALTER DATABASE ... COLLATE statement
182+
type AlterDatabaseCollateStatement struct {
183+
DatabaseName *Identifier
184+
Collation *Identifier
185+
}
186+
187+
func (a *AlterDatabaseCollateStatement) node() {}
188+
func (a *AlterDatabaseCollateStatement) statement() {}
189+
179190
// AlterDatabaseScopedConfigurationClearStatement represents ALTER DATABASE SCOPED CONFIGURATION CLEAR statement
180191
type AlterDatabaseScopedConfigurationClearStatement struct {
181192
Option *DatabaseConfigurationClearOption

ast/alter_table_drop_table_element_statement.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,17 @@ func (*DropClusteredConstraintValueOption) dropClusteredConstraintOption() {}
5454

5555
// FileGroupOrPartitionScheme represents a filegroup or partition scheme reference.
5656
type FileGroupOrPartitionScheme struct {
57-
Name *IdentifierOrValueExpression
58-
PartitionSchemeColumns []*Identifier
57+
Name *IdentifierOrValueExpression
58+
PartitionSchemeColumns []*Identifier
5959
}
6060

6161
func (*FileGroupOrPartitionScheme) node() {}
62+
63+
// DropClusteredConstraintWaitAtLowPriorityLockOption represents a WAIT_AT_LOW_PRIORITY option.
64+
type DropClusteredConstraintWaitAtLowPriorityLockOption struct {
65+
OptionKind string // Always "MaxDop" based on the expected output
66+
Options []LowPriorityLockWaitOption
67+
}
68+
69+
func (*DropClusteredConstraintWaitAtLowPriorityLockOption) node() {}
70+
func (*DropClusteredConstraintWaitAtLowPriorityLockOption) dropClusteredConstraintOption() {}

ast/backup_statement.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@ package ast
22

33
// BackupDatabaseStatement represents a BACKUP DATABASE statement
44
type BackupDatabaseStatement struct {
5-
DatabaseName *IdentifierOrValueExpression
6-
Devices []*DeviceInfo
7-
Options []*BackupOption
5+
Files []*BackupRestoreFileInfo
6+
DatabaseName *IdentifierOrValueExpression
7+
MirrorToClauses []*MirrorToClause
8+
Devices []*DeviceInfo
9+
Options []*BackupOption
10+
}
11+
12+
// MirrorToClause represents a MIRROR TO clause in a BACKUP statement
13+
type MirrorToClause struct {
14+
Devices []*DeviceInfo
815
}
916

1017
func (s *BackupDatabaseStatement) statementNode() {}

ast/distinct_predicate.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package ast
2+
3+
// DistinctPredicate represents an IS [NOT] DISTINCT FROM expression.
4+
type DistinctPredicate struct {
5+
FirstExpression ScalarExpression
6+
SecondExpression ScalarExpression
7+
IsNot bool
8+
}
9+
10+
func (d *DistinctPredicate) node() {}
11+
func (d *DistinctPredicate) booleanExpression() {}

ast/merge_statement.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ func (s *MergeStatement) statement() {}
1111
// MergeSpecification represents the specification of a MERGE statement
1212
type MergeSpecification struct {
1313
Target TableReference // The target table
14+
TableAlias *Identifier // Alias for the USING clause table reference (e.g., AS src)
1415
TableReference TableReference // The USING clause table reference
1516
SearchCondition BooleanExpression // The ON clause condition (may be GraphMatchPredicate)
1617
ActionClauses []*MergeActionClause

ast/next_value_for_expression.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package ast
2+
3+
// NextValueForExpression represents a NEXT VALUE FOR sequence expression.
4+
type NextValueForExpression struct {
5+
SequenceName *SchemaObjectName
6+
OverClause *OverClause
7+
}
8+
9+
func (n *NextValueForExpression) node() {}
10+
func (n *NextValueForExpression) scalarExpression() {}

0 commit comments

Comments
 (0)