Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
103fe77
Enable PhaseOne_AlterDatabaseModifyFileStatementTest
claude Jan 3, 2026
7928727
Enable PhaseOne_AlterDatabaseRemoveFileStatementTest
claude Jan 3, 2026
71bb197
Enable PhaseOne_AlterDatabaseModifyNameStatementTest
claude Jan 3, 2026
1f480e9
Enable PhaseOne_AlterDatabaseModifyFilegroup3StatementTest
claude Jan 3, 2026
1447017
Enable PhaseOne_AlterDatabaseModifyFilegroup2StatementTest
claude Jan 3, 2026
7bcac67
Add FullTextPredicate and ExistsPredicate support
claude Jan 3, 2026
27f9df9
Add IIfCall, ParseCall, and TryParseCall support
claude Jan 3, 2026
eae3c45
Enable PhaseOne_CreateFulltextCatalog test
claude Jan 3, 2026
35b039c
Enable Baselines110_ExpressionTests110 and ExpressionTests110
claude Jan 3, 2026
8b2b228
Add NULL/NOT NULL support for function parameters and fix option naming
claude Jan 3, 2026
0f16ae0
Add support for CREATE FUNCTION parsing features
claude Jan 3, 2026
5f6b781
Add support for select element alias styles
claude Jan 3, 2026
e323e6a
Add columnstore index, WHERE clause, and COMPRESSION_DELAY support
claude Jan 3, 2026
fcaa3f8
Add UNIQUE inline index and DURABILITY table option support
claude Jan 3, 2026
ecc8d81
Add ALTER TABLE REBUILD, CHANGE_TRACKING, and enhanced ALTER COLUMN s…
claude Jan 3, 2026
c979d61
Fix XML data type parsing in ALTER TABLE ALTER COLUMN
claude Jan 3, 2026
8762aff
Add CREATE INDEX WHERE clause and DATA_COMPRESSION support (#59)
claude Jan 3, 2026
08ae9be
Add function parameter default values and EXECUTE AS parsing (#60)
claude Jan 3, 2026
99b521e
Add inline index HASH, ON filegroup, and FILESTREAM_ON support
claude Jan 3, 2026
3bd78e4
Add CREATE/ALTER SERVER/DATABASE AUDIT SPECIFICATION parsing
claude Jan 3, 2026
50fe988
Add support for CREATE EXTERNAL TABLE ... AS SELECT (CTAS)
claude Jan 3, 2026
4ffb33f
Add support for DROP RESOURCE POOL statement
claude Jan 3, 2026
8cd5148
Add Column and WithValues fields to DefaultConstraintDefinition
claude Jan 3, 2026
5678af1
Add ALTER VIEW support and fix double-quoted identifiers
claude Jan 3, 2026
46f68dc
Add partial support for ALTER TABLE ADD multiple elements
claude Jan 3, 2026
f32c5e9
Add support for ALTER TABLE ADD CONSTRAINT with DEFAULT and CHECK
claude Jan 3, 2026
87e2f88
Add partial support for GRANT/REVOKE/DENY column list parsing
claude Jan 3, 2026
5dee3d2
Add full GRANT/REVOKE/DENY security statement support
claude Jan 3, 2026
8ac6d90
Add support for WITH index options without parentheses
claude Jan 3, 2026
66b4164
Add ALTER DATABASE SET termination clause and cursor options support
claude Jan 3, 2026
ee7721f
Add ALTER EXTERNAL RESOURCE POOL statement support
claude Jan 3, 2026
6c1b76e
Add IF EXISTS support for DROP SEQUENCE and ALTER TABLE DROP
claude Jan 3, 2026
6bf8518
Add CREATE AVAILABILITY GROUP statement support
claude Jan 3, 2026
dbc8185
Add BACKUP ENCRYPTION option support
claude Jan 3, 2026
f5e6081
Add IS [NOT] DISTINCT FROM SOME/ANY/ALL (subquery) support
claude Jan 3, 2026
e1a195c
Add ALTER TABLE ALTER COLUMN HIDDEN and encryption support
claude Jan 3, 2026
584fc18
Add Azure CREATE/ALTER DATABASE options support
claude Jan 3, 2026
c0f133b
Add REMOTE_DATA_ARCHIVE table option parsing for CREATE/ALTER TABLE
claude Jan 3, 2026
b159310
Add RETENTION_DAYS and EXTERNAL_MONITOR support for server audit
claude Jan 3, 2026
34564e1
Add full ALTER PROCEDURE and BEGIN ATOMIC block support
claude Jan 3, 2026
7591ced
Add comprehensive ALTER DATABASE SET option support
claude Jan 3, 2026
d843dd8
Add FOREIGN KEY constraint ON DELETE/UPDATE and NOT FOR REPLICATION s…
claude Jan 3, 2026
b75ab03
Add AUTHORIZATION support for CREATE ASYMMETRIC KEY statements
claude Jan 3, 2026
f8ec0ee
Add ALTER DATABASE REBUILD LOG, AS SNAPSHOT OF, and additional databa…
claude Jan 3, 2026
d0a4a01
Add inline index options parsing for DATA_COMPRESSION, PAD_INDEX, FIL…
claude Jan 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions ast/alter_database_set_statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@ type AlterDatabaseSetStatement struct {
UseCurrent bool
WithManualCutover bool
Options []DatabaseOption
Termination *AlterDatabaseTermination
}

// AlterDatabaseTermination represents the termination clause (WITH NO_WAIT, WITH ROLLBACK AFTER N, WITH ROLLBACK IMMEDIATE)
type AlterDatabaseTermination struct {
NoWait bool
ImmediateRollback bool
RollbackAfter ScalarExpression
}

func (a *AlterDatabaseTermination) node() {}

func (a *AlterDatabaseSetStatement) node() {}
func (a *AlterDatabaseSetStatement) statement() {}

Expand Down Expand Up @@ -82,6 +92,7 @@ type SimpleDatabaseOption struct {

func (d *SimpleDatabaseOption) node() {}
func (d *SimpleDatabaseOption) createDatabaseOption() {}
func (d *SimpleDatabaseOption) databaseOption() {}

// MaxSizeDatabaseOption represents a MAXSIZE option.
type MaxSizeDatabaseOption struct {
Expand All @@ -104,6 +115,16 @@ func (l *LiteralDatabaseOption) node() {}
func (l *LiteralDatabaseOption) databaseOption() {}
func (l *LiteralDatabaseOption) createDatabaseOption() {}

// ElasticPoolSpecification represents SERVICE_OBJECTIVE = ELASTIC_POOL(name = poolname)
type ElasticPoolSpecification struct {
ElasticPoolName *Identifier
OptionKind string // "ServiceObjective"
}

func (e *ElasticPoolSpecification) node() {}
func (e *ElasticPoolSpecification) databaseOption() {}
func (e *ElasticPoolSpecification) createDatabaseOption() {}

// AlterDatabaseAddFileStatement represents ALTER DATABASE ... ADD FILE statement
type AlterDatabaseAddFileStatement struct {
DatabaseName *Identifier
Expand Down Expand Up @@ -145,11 +166,23 @@ type AlterDatabaseModifyFileGroupStatement struct {
MakeDefault bool
UpdatabilityOption string // "ReadOnly", "ReadWrite", "ReadOnlyOld", "ReadWriteOld", or ""
NewFileGroupName *Identifier
Termination *AlterDatabaseTermination
UseCurrent bool
}

func (a *AlterDatabaseModifyFileGroupStatement) node() {}
func (a *AlterDatabaseModifyFileGroupStatement) statement() {}

// AlterDatabaseRebuildLogStatement represents ALTER DATABASE ... REBUILD LOG statement
type AlterDatabaseRebuildLogStatement struct {
DatabaseName *Identifier
FileDeclaration *FileDeclaration
UseCurrent bool
}

func (a *AlterDatabaseRebuildLogStatement) node() {}
func (a *AlterDatabaseRebuildLogStatement) statement() {}

// AlterDatabaseModifyNameStatement represents ALTER DATABASE ... MODIFY NAME statement
type AlterDatabaseModifyNameStatement struct {
DatabaseName *Identifier
Expand Down Expand Up @@ -279,3 +312,68 @@ type ChangeRetentionChangeTrackingOptionDetail struct {

func (c *ChangeRetentionChangeTrackingOptionDetail) node() {}
func (c *ChangeRetentionChangeTrackingOptionDetail) changeTrackingOptionDetail() {}

// RecoveryDatabaseOption represents RECOVERY database option
type RecoveryDatabaseOption struct {
OptionKind string // "Recovery"
Value string // "Full", "BulkLogged", "Simple"
}

func (r *RecoveryDatabaseOption) node() {}
func (r *RecoveryDatabaseOption) databaseOption() {}

// CursorDefaultDatabaseOption represents CURSOR_DEFAULT database option
type CursorDefaultDatabaseOption struct {
OptionKind string // "CursorDefault"
IsLocal bool // true for LOCAL, false for GLOBAL
}

func (c *CursorDefaultDatabaseOption) node() {}
func (c *CursorDefaultDatabaseOption) databaseOption() {}

// PageVerifyDatabaseOption represents PAGE_VERIFY database option
type PageVerifyDatabaseOption struct {
OptionKind string // "PageVerify"
Value string // "Checksum", "None", "TornPageDetection"
}

func (p *PageVerifyDatabaseOption) node() {}
func (p *PageVerifyDatabaseOption) databaseOption() {}

// PartnerDatabaseOption represents PARTNER database mirroring option
type PartnerDatabaseOption struct {
OptionKind string // "Partner"
PartnerServer ScalarExpression // For PARTNER = 'server'
PartnerOption string // "PartnerServer", "Failover", "ForceServiceAllowDataLoss", "Resume", "SafetyFull", "SafetyOff", "Suspend", "Timeout"
Timeout ScalarExpression // For PARTNER TIMEOUT value
}

func (p *PartnerDatabaseOption) node() {}
func (p *PartnerDatabaseOption) databaseOption() {}

// WitnessDatabaseOption represents WITNESS database mirroring option
type WitnessDatabaseOption struct {
OptionKind string // "Witness"
WitnessServer ScalarExpression // For WITNESS = 'server'
IsOff bool // For WITNESS OFF
}

func (w *WitnessDatabaseOption) node() {}
func (w *WitnessDatabaseOption) databaseOption() {}

// ParameterizationDatabaseOption represents PARAMETERIZATION database option
type ParameterizationDatabaseOption struct {
OptionKind string // "Parameterization"
IsSimple bool // true for SIMPLE, false for FORCED
}

func (p *ParameterizationDatabaseOption) node() {}
func (p *ParameterizationDatabaseOption) databaseOption() {}

// GenericDatabaseOption represents a simple database option with just OptionKind
type GenericDatabaseOption struct {
OptionKind string // e.g., "Emergency", "ErrorBrokerConversations", "EnableBroker", etc.
}

func (g *GenericDatabaseOption) node() {}
func (g *GenericDatabaseOption) databaseOption() {}
1 change: 1 addition & 0 deletions ast/alter_procedure_statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package ast
type AlterProcedureStatement struct {
ProcedureReference *ProcedureReference
Parameters []*ProcedureParameter
Options []ProcedureOptionBase
StatementList *StatementList
IsForReplication bool
}
Expand Down
5 changes: 4 additions & 1 deletion ast/alter_table_alter_column_statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ type AlterTableAlterColumnStatement struct {
SchemaObjectName *SchemaObjectName
ColumnIdentifier *Identifier
DataType DataTypeReference
AlterTableAlterColumnOption string // "NoOptionDefined", "AddRowGuidCol", "DropRowGuidCol", "Null", "NotNull", etc.
AlterTableAlterColumnOption string // "NoOptionDefined", "AddRowGuidCol", "DropRowGuidCol", "Null", "NotNull", "AddSparse", "DropSparse", etc.
StorageOptions *ColumnStorageOptions
IsHidden bool
Collation *Identifier
IsMasked bool
Encryption *ColumnEncryptionDefinition
MaskingFunction ScalarExpression
}

func (a *AlterTableAlterColumnStatement) node() {}
Expand Down
11 changes: 11 additions & 0 deletions ast/alter_table_change_tracking_statement.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package ast

// AlterTableChangeTrackingModificationStatement represents ALTER TABLE ... ENABLE/DISABLE CHANGE_TRACKING
type AlterTableChangeTrackingModificationStatement struct {
SchemaObjectName *SchemaObjectName
IsEnable bool // true for ENABLE, false for DISABLE
TrackColumnsUpdated string // "NotSet", "On", "Off"
}

func (s *AlterTableChangeTrackingModificationStatement) node() {}
func (s *AlterTableChangeTrackingModificationStatement) statement() {}
11 changes: 11 additions & 0 deletions ast/alter_table_rebuild_statement.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package ast

// AlterTableRebuildStatement represents ALTER TABLE ... REBUILD statement
type AlterTableRebuildStatement struct {
SchemaObjectName *SchemaObjectName
Partition *PartitionSpecifier
IndexOptions []IndexOption
}

func (s *AlterTableRebuildStatement) node() {}
func (s *AlterTableRebuildStatement) statement() {}
27 changes: 27 additions & 0 deletions ast/alter_table_set_statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,30 @@ type MemoryOptimizedTableOption struct {

func (o *MemoryOptimizedTableOption) tableOption() {}
func (o *MemoryOptimizedTableOption) node() {}

// DurabilityTableOption represents a DURABILITY table option
type DurabilityTableOption struct {
OptionKind string // "Durability"
DurabilityTableOptionKind string // "SchemaOnly", "SchemaAndData"
}

func (o *DurabilityTableOption) tableOption() {}
func (o *DurabilityTableOption) node() {}

// LockEscalationTableOption represents LOCK_ESCALATION option
type LockEscalationTableOption struct {
OptionKind string // "LockEscalation"
Value string // "Auto", "Table", "Disable"
}

func (o *LockEscalationTableOption) tableOption() {}
func (o *LockEscalationTableOption) node() {}

// FileStreamOnTableOption represents FILESTREAM_ON option
type FileStreamOnTableOption struct {
OptionKind string // "FileStreamOn"
Value *IdentifierOrValueExpression
}

func (o *FileStreamOnTableOption) tableOption() {}
func (o *FileStreamOnTableOption) node() {}
22 changes: 20 additions & 2 deletions ast/backup_statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type BackupDatabaseStatement struct {
DatabaseName *IdentifierOrValueExpression
MirrorToClauses []*MirrorToClause
Devices []*DeviceInfo
Options []*BackupOption
Options []BackupOptionBase
}

// MirrorToClause represents a MIRROR TO clause in a BACKUP statement
Expand All @@ -22,19 +22,37 @@ func (s *BackupDatabaseStatement) node() {}
type BackupTransactionLogStatement struct {
DatabaseName *IdentifierOrValueExpression
Devices []*DeviceInfo
Options []*BackupOption
Options []BackupOptionBase
}

func (s *BackupTransactionLogStatement) statementNode() {}
func (s *BackupTransactionLogStatement) statement() {}
func (s *BackupTransactionLogStatement) node() {}

// BackupOptionBase is an interface for backup options
type BackupOptionBase interface {
backupOption()
}

// BackupOption represents a backup option
type BackupOption struct {
OptionKind string // Compression, NoCompression, StopOnError, ContinueAfterError, etc.
Value ScalarExpression
}

func (o *BackupOption) backupOption() {}

// BackupEncryptionOption represents an ENCRYPTION(...) backup option
type BackupEncryptionOption struct {
Algorithm string // Aes128, Aes192, Aes256, TripleDes3Key
Encryptor *CryptoMechanism
OptionKind string // typically "None"
}

func (o *BackupEncryptionOption) backupOption() {}

// CryptoMechanism is defined in create_simple_statements.go

// BackupCertificateStatement represents a BACKUP CERTIFICATE statement
type BackupCertificateStatement struct {
Name *Identifier
Expand Down
8 changes: 8 additions & 0 deletions ast/begin_end_block_statement.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ type LiteralAtomicBlockOption struct {

func (o *LiteralAtomicBlockOption) atomicBlockOption() {}

// OnOffAtomicBlockOption represents an atomic block option with an ON/OFF value.
type OnOffAtomicBlockOption struct {
OptionKind string
OptionState string // "On" or "Off"
}

func (o *OnOffAtomicBlockOption) atomicBlockOption() {}

// StatementList is a list of statements.
type StatementList struct {
Statements []Statement `json:"Statements,omitempty"`
Expand Down
37 changes: 37 additions & 0 deletions ast/column_encryption.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package ast

// ColumnEncryptionDefinition represents the ENCRYPTED WITH specification
type ColumnEncryptionDefinition struct {
Parameters []ColumnEncryptionParameter
}

func (c *ColumnEncryptionDefinition) node() {}

// ColumnEncryptionParameter is an interface for encryption parameters
type ColumnEncryptionParameter interface {
columnEncryptionParameter()
}

// ColumnEncryptionKeyNameParameter represents COLUMN_ENCRYPTION_KEY = key_name
type ColumnEncryptionKeyNameParameter struct {
Name *Identifier
ParameterKind string // "ColumnEncryptionKey"
}

func (c *ColumnEncryptionKeyNameParameter) columnEncryptionParameter() {}

// ColumnEncryptionTypeParameter represents ENCRYPTION_TYPE = DETERMINISTIC|RANDOMIZED
type ColumnEncryptionTypeParameter struct {
EncryptionType string // "Deterministic", "Randomized"
ParameterKind string // "EncryptionType"
}

func (c *ColumnEncryptionTypeParameter) columnEncryptionParameter() {}

// ColumnEncryptionAlgorithmParameter represents ALGORITHM = 'algorithm_name'
type ColumnEncryptionAlgorithmParameter struct {
EncryptionAlgorithm ScalarExpression // StringLiteral
ParameterKind string // "Algorithm"
}

func (c *ColumnEncryptionAlgorithmParameter) columnEncryptionParameter() {}
Loading
Loading