Skip to content

Commit 38880b3

Browse files
kyleconroyclaude
andauthored
Capture filegroup and filestream names before calling parseIdentifier (#60)
* Fix inline index ON/FILESTREAM_ON clause parsing Capture filegroup and filestream names before calling parseIdentifier to ensure correct evaluation order in struct initialization. Enables Baselines120_CreateTableTests120 test. * Add CREATE EXTERNAL RESOURCE POOL statement support - Add CreateExternalResourcePoolStatement AST type - Add parsing for CREATE EXTERNAL RESOURCE POOL with parameters - Support MAX_CPU_PERCENT, MAX_MEMORY_PERCENT, MAX_PROCESSES, AFFINITY - Support AFFINITY CPU/NUMANODE with AUTO or range lists - Add JSON marshaling for the new statement type Enables CreateExternalResourcePoolStatementTests130 tests. * Add TRIM function LEADING/TRAILING/BOTH option support - Add TrimOptions field to FunctionCall AST type - Parse LEADING, TRAILING, BOTH keywords before TRIM characters - Add JSON marshaling for TrimOptions Enables TrimFunctionTests160 tests. * Add comprehensive RESTORE statement support - Add TAPE device type support in FROM clause - Add FILELISTONLY, VERIFYONLY, LABELONLY, REWINDONLY, HEADERONLY kinds - Add MOVE restore option parsing (MOVE 'file' TO 'path') - Add FILE, MEDIANAME, MEDIAPASSWORD, PASSWORD, STOPAT options - Add ENABLE_BROKER, ERROR_BROKER_CONVERSATIONS, NEW_BROKER options - Add KEEP_REPLICATION, RESTRICTED_USER options - Fix STATS option to handle optional value (STATS or STATS = n) - Update MoveRestoreOption to use ScalarExpression types Enables RestoreStatementTests tests. * Add standalone HASH support for inline index definitions Handle HASH keyword without preceding NONCLUSTERED in table-level inline index definitions. When HASH appears directly after UNIQUE, it is now correctly interpreted as NonClusteredHash index type. * Add OpenRowset Cosmos and TableReference support Add parsing for OPENROWSET with named parameters (PROVIDER, CONNECTION, OBJECT, CREDENTIAL) for Cosmos DB integration, and traditional OPENROWSET syntax with positional arguments ('provider', 'connstr', tablename). New AST types: OpenRowsetCosmos, OpenRowsetTableReference, LiteralOpenRowsetCosmosOption, OpenRowsetColumnDefinition * Add AS keyword support for function parameter declarations Handle optional AS keyword in function parameter syntax like @param AS datatype. This applies to CREATE FUNCTION, ALTER FUNCTION, and CREATE OR ALTER FUNCTION statements. * Add WITH clause column schema support for BULK OPENROWSET Add WithColumns field to BulkOpenRowset for schema specification in OPENROWSET BULK statements. Supports COLLATE clause and column ordinal or JSON path specifications. * Fix table hint and alias parsing order in FROM clause Support both T-SQL table hint syntaxes: 1. Old-style: table_name (nolock) AS alias - hints before alias 2. New-style: table_name AS alias WITH (hints) - alias before hints The parser now correctly handles both patterns by checking for old-style hints first (parentheses without WITH), then parsing alias, then checking for new-style hints (WITH keyword followed by parentheses). * Add CREATE/ALTER/DROP LOGIN statement support Add parsing for: - CREATE LOGIN with PASSWORD, WINDOWS, CERTIFICATE, ASYMMETRIC KEY sources - ALTER LOGIN ENABLE/DISABLE statements - ALTER LOGIN WITH options (PASSWORD, NO CREDENTIAL, etc.) - DROP LOGIN statement Add new AST types: - PasswordCreateLoginSource, WindowsCreateLoginSource - CertificateCreateLoginSource, AsymmetricKeyCreateLoginSource - AlterLoginEnableDisableStatement, AlterLoginOptionsStatement - DropLoginStatement, OnOffPrincipalOption, PrincipalOptionSimple Update PasswordAlterPrincipalOption to support both String and Binary passwords. * Fix LoginStatementTests - handle national strings and IsIfExists - Add IsIfExists field to DropLoginStatement - Fix national string handling: strip N prefix and quotes from value - Enable LoginStatementTests and Baselines90_LoginStatementTests * Add support for service broker and other DROP statements - Added DROP PARTITION FUNCTION/SCHEME, DROP APPLICATION ROLE, DROP CERTIFICATE, DROP MASTER KEY, DROP XML SCHEMA COLLECTION, DROP CONTRACT, DROP ENDPOINT, DROP MESSAGE TYPE, DROP QUEUE, DROP REMOTE SERVICE BINDING, DROP ROUTE, DROP SERVICE, DROP EVENT NOTIFICATION statements - Added WITH NO DEPENDENTS option for DROP ASSEMBLY - Added MAXDOP option for DROP INDEX - Added DropBehavior (Cascade/Restrict) for DROP SCHEMA - Added marshaling for DropFullTextCatalogStatement and DropFulltextIndexStatement - Enabled Baselines90_DropStatementsTests2 and DropStatementsTests2 tests * Add CHANGETABLE, VALUES, and GlobalFunction table references - Add CHANGETABLE(CHANGES) and CHANGETABLE(VERSION) parsing - Add InlineDerivedTable for VALUES clause in FROM - Add GlobalFunctionTableReference for STRING_SPLIT and GENERATE_SERIES - Add Alias and Columns support for table function references Enables: Baselines150_FromClauseTests150, FromClauseTests150, Baselines160_BuiltInFunctionTests160, BuiltInFunctionTests160 * Add DATABASE AUDIT SPECIFICATION action and group support - Add AuditActionSpecification and DatabaseAuditAction types - Add DropDatabaseAuditSpecificationStatement - Update parseAuditSpecificationPart to handle action specs - Add batch group mappings (BatchCompletedGroup, BatchStartedGroup) Enables: DatabaseAuditSpecificationStatementTests (all 4 variants) * Add DATA_COMPRESSION option for columnstore indexes - Add DATA_COMPRESSION parsing to columnstore index WITH clause - Add DataCompressionOption case to columnStoreIndexOptionToJSON Enables: CreateIndexStatementTests120 (both variants) * Add XML_COMPRESSION table option support (partial progress) - Add XmlCompressionOption and TableXmlCompressionOption types - Add XML_COMPRESSION parsing in CREATE TABLE WITH clause - Add partition ranges support for XML compression Part of work towards CreateTableTests160 * Add TABLE DISTRIBUTION, CLUSTERED INDEX, and HEAP options for CREATE TABLE - Add TableDistributionOption and TableHashDistributionPolicy AST types - Add TableIndexOption, TableClusteredIndexType, and TableNonClusteredIndexType AST types - Parse DISTRIBUTION = HASH(col1, col2, ...) in CREATE TABLE WITH clause - Parse CLUSTERED INDEX(col), CLUSTERED COLUMNSTORE INDEX, and HEAP options - Add JSON marshaling for all new table option types - Enables Baselines160_CreateTableTests160 and CreateTableTests160 tests * Add WINDOW clause and improve OVER clause support - Add WindowClause and WindowDefinition AST types for SELECT WINDOW clause - Add WindowFrameClause and WindowDelimiter AST types for ROWS/RANGE frames - Add WindowName field to OverClause for window name references (OVER Win1) - Create parseOverClause helper function and refactor all OVER parsing - Add parseWindowClause for WINDOW Win1 AS (...) syntax - Add parseWindowFrameClause for ROWS/RANGE BETWEEN ... AND ... - Add JSON marshaling for all new window-related types - Add WINDOW to reserved keyword lists for alias detection - Enables Baselines160_WindowClauseTests160, WindowClauseTests160, Baselines110_OverClauseTests110, and OverClauseTests110 tests * Add BACKUP statement FILE/FILEGROUP list parsing and option kinds - Support parenthesized list for FILE = ('f1', 'f2') and FILEGROUP = ('fg1', 'fg2') - Add all BACKUP option kind mappings (BlockSize, BufferCount, Description, etc.) - Enables BaselinesCommon_BackupStatementTests and BackupStatementTests tests * Add ONLINE WAIT_AT_LOW_PRIORITY and XML_COMPRESSION support for CREATE INDEX - Add OnlineIndexLowPriorityLockWaitOption AST type with LowPriorityLockWaitOption field - Parse ONLINE = ON (WAIT_AT_LOW_PRIORITY (MAX_DURATION = N MINUTES, ABORT_AFTER_WAIT = SELF)) - Add XmlCompressionOption indexOption() method for index options - Parse XML_COMPRESSION = ON/OFF [ON PARTITIONS(range)] in CREATE INDEX - Add JSON marshaling for OnlineIndexOption with LowPriorityLockWaitOption - Add JSON marshaling for XmlCompressionOption in index context Enables Baselines160_CreateIndexStatementTests160 and CreateIndexStatementTests160. * Add DataModificationTableReference and PIVOT/UNPIVOT support - Add DataModificationTableReference AST for DML statements as table sources - Add DataModificationSpecification interface implemented by Insert/Update/Delete/MergeSpecification - Add parsing for INSERT/UPDATE/DELETE/MERGE in FROM clause subqueries - Add parseInsertSpecification, parseUpdateSpecification, parseDeleteSpecification, parseMergeSpecification - Add PivotedTableReference and UnpivotedTableReference AST types - Add PIVOT and UNPIVOT parsing in parseTableReference - Fix PIVOT/UNPIVOT being consumed as table aliases - Add JSON marshaling for new table reference types This is partial work toward Baselines100_FromClauseTests100 which still requires FORCESEEK hints with index/columns and TABLE HINT optimizer hints. * Add ForceSeekTableHint and FORCESCAN support for table hints - Add ForceSeekTableHint AST type for FORCESEEK with optional index and column parameters - Add FORCESEEK parsing with index name/number and column list support - Add FORCESCAN to table hint kind mapping - Add JSON marshaling for ForceSeekTableHint - Enable Baselines100_FromClauseTests100 test --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6872611 commit 38880b3

File tree

70 files changed

+4814
-394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+4814
-394
lines changed

ast/alter_table_alter_index_statement.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ type IndexExpressionOption struct {
3232
Expression ScalarExpression
3333
}
3434

35-
func (i *IndexExpressionOption) indexOption() {}
36-
func (i *IndexExpressionOption) node() {}
35+
func (i *IndexExpressionOption) indexOption() {}
36+
func (i *IndexExpressionOption) dropIndexOption() {}
37+
func (i *IndexExpressionOption) node() {}
3738

3839
// CompressionDelayIndexOption represents a COMPRESSION_DELAY option
3940
type CompressionDelayIndexOption struct {

ast/bulk_insert_statement.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ func (o *OrderBulkInsertOption) bulkInsertOption() {}
6666

6767
// BulkOpenRowset represents an OPENROWSET (BULK ...) table reference.
6868
type BulkOpenRowset struct {
69-
DataFiles []ScalarExpression `json:"DataFiles,omitempty"`
70-
Options []BulkInsertOption `json:"Options,omitempty"`
71-
Columns []*Identifier `json:"Columns,omitempty"`
72-
Alias *Identifier `json:"Alias,omitempty"`
73-
ForPath bool `json:"ForPath"`
69+
DataFiles []ScalarExpression `json:"DataFiles,omitempty"`
70+
Options []BulkInsertOption `json:"Options,omitempty"`
71+
WithColumns []*OpenRowsetColumnDefinition `json:"WithColumns,omitempty"`
72+
Columns []*Identifier `json:"Columns,omitempty"`
73+
Alias *Identifier `json:"Alias,omitempty"`
74+
ForPath bool `json:"ForPath"`
7475
}
7576

7677
func (b *BulkOpenRowset) node() {}

ast/changetable_reference.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package ast
2+
3+
// ChangeTableChangesTableReference represents CHANGETABLE(CHANGES ...) table reference
4+
type ChangeTableChangesTableReference struct {
5+
Target *SchemaObjectName `json:"Target,omitempty"`
6+
SinceVersion ScalarExpression `json:"SinceVersion,omitempty"`
7+
ForceSeek bool `json:"ForceSeek"`
8+
Columns []*Identifier `json:"Columns,omitempty"`
9+
Alias *Identifier `json:"Alias,omitempty"`
10+
ForPath bool `json:"ForPath"`
11+
}
12+
13+
func (c *ChangeTableChangesTableReference) node() {}
14+
func (c *ChangeTableChangesTableReference) tableReference() {}
15+
16+
// ChangeTableVersionTableReference represents CHANGETABLE(VERSION ...) table reference
17+
type ChangeTableVersionTableReference struct {
18+
Target *SchemaObjectName `json:"Target,omitempty"`
19+
PrimaryKeyColumns []*Identifier `json:"PrimaryKeyColumns,omitempty"`
20+
PrimaryKeyValues []ScalarExpression `json:"PrimaryKeyValues,omitempty"`
21+
ForceSeek bool `json:"ForceSeek"`
22+
Columns []*Identifier `json:"Columns,omitempty"`
23+
Alias *Identifier `json:"Alias,omitempty"`
24+
ForPath bool `json:"ForPath"`
25+
}
26+
27+
func (c *ChangeTableVersionTableReference) node() {}
28+
func (c *ChangeTableVersionTableReference) tableReference() {}

ast/create_simple_statements.go

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,33 @@ type CreateLoginStatement struct {
3434
func (s *CreateLoginStatement) node() {}
3535
func (s *CreateLoginStatement) statement() {}
3636

37+
// AlterLoginEnableDisableStatement represents ALTER LOGIN name ENABLE/DISABLE
38+
type AlterLoginEnableDisableStatement struct {
39+
Name *Identifier `json:"Name,omitempty"`
40+
IsEnable bool `json:"IsEnable"`
41+
}
42+
43+
func (s *AlterLoginEnableDisableStatement) node() {}
44+
func (s *AlterLoginEnableDisableStatement) statement() {}
45+
46+
// AlterLoginOptionsStatement represents ALTER LOGIN name WITH options
47+
type AlterLoginOptionsStatement struct {
48+
Name *Identifier `json:"Name,omitempty"`
49+
Options []PrincipalOption `json:"Options,omitempty"`
50+
}
51+
52+
func (s *AlterLoginOptionsStatement) node() {}
53+
func (s *AlterLoginOptionsStatement) statement() {}
54+
55+
// DropLoginStatement represents DROP LOGIN name
56+
type DropLoginStatement struct {
57+
Name *Identifier `json:"Name,omitempty"`
58+
IsIfExists bool `json:"IsIfExists"`
59+
}
60+
61+
func (s *DropLoginStatement) node() {}
62+
func (s *DropLoginStatement) statement() {}
63+
3764
// CreateLoginSource is an interface for login sources
3865
type CreateLoginSource interface {
3966
createLoginSource()
@@ -46,6 +73,39 @@ type ExternalCreateLoginSource struct {
4673

4774
func (s *ExternalCreateLoginSource) createLoginSource() {}
4875

76+
// PasswordCreateLoginSource represents WITH PASSWORD = '...' source
77+
type PasswordCreateLoginSource struct {
78+
Password ScalarExpression `json:"Password,omitempty"`
79+
Hashed bool `json:"Hashed"`
80+
MustChange bool `json:"MustChange"`
81+
Options []PrincipalOption `json:"Options,omitempty"`
82+
}
83+
84+
func (s *PasswordCreateLoginSource) createLoginSource() {}
85+
86+
// WindowsCreateLoginSource represents FROM WINDOWS source
87+
type WindowsCreateLoginSource struct {
88+
Options []PrincipalOption `json:"Options,omitempty"`
89+
}
90+
91+
func (s *WindowsCreateLoginSource) createLoginSource() {}
92+
93+
// CertificateCreateLoginSource represents FROM CERTIFICATE source
94+
type CertificateCreateLoginSource struct {
95+
Certificate *Identifier `json:"Certificate,omitempty"`
96+
Credential *Identifier `json:"Credential,omitempty"`
97+
}
98+
99+
func (s *CertificateCreateLoginSource) createLoginSource() {}
100+
101+
// AsymmetricKeyCreateLoginSource represents FROM ASYMMETRIC KEY source
102+
type AsymmetricKeyCreateLoginSource struct {
103+
Key *Identifier `json:"Key,omitempty"`
104+
Credential *Identifier `json:"Credential,omitempty"`
105+
}
106+
107+
func (s *AsymmetricKeyCreateLoginSource) createLoginSource() {}
108+
49109
// PrincipalOption is an interface for principal options (SID, TYPE, etc.)
50110
type PrincipalOption interface {
51111
principalOptionNode()

ast/create_user_statement.go

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,23 @@ type IdentifierPrincipalOption struct {
3939
func (o *IdentifierPrincipalOption) userOptionNode() {}
4040
func (o *IdentifierPrincipalOption) principalOptionNode() {}
4141

42+
// OnOffPrincipalOption represents an ON/OFF principal option
43+
type OnOffPrincipalOption struct {
44+
OptionKind string
45+
OptionState string // "On" or "Off"
46+
}
47+
48+
func (o *OnOffPrincipalOption) userOptionNode() {}
49+
func (o *OnOffPrincipalOption) principalOptionNode() {}
50+
51+
// PrincipalOptionSimple represents a simple principal option with just an option kind
52+
type PrincipalOptionSimple struct {
53+
OptionKind string
54+
}
55+
56+
func (o *PrincipalOptionSimple) userOptionNode() {}
57+
func (o *PrincipalOptionSimple) principalOptionNode() {}
58+
4259
// DefaultSchemaPrincipalOption represents a default schema option
4360
type DefaultSchemaPrincipalOption struct {
4461
OptionKind string
@@ -47,14 +64,15 @@ type DefaultSchemaPrincipalOption struct {
4764

4865
func (o *DefaultSchemaPrincipalOption) userOptionNode() {}
4966

50-
// PasswordAlterPrincipalOption represents a password option for ALTER USER
67+
// PasswordAlterPrincipalOption represents a password option for ALTER USER/LOGIN
5168
type PasswordAlterPrincipalOption struct {
52-
Password *StringLiteral
69+
Password ScalarExpression
5370
OldPassword *StringLiteral
5471
MustChange bool
5572
Unlock bool
5673
Hashed bool
5774
OptionKind string
5875
}
5976

60-
func (o *PasswordAlterPrincipalOption) userOptionNode() {}
77+
func (o *PasswordAlterPrincipalOption) userOptionNode() {}
78+
func (o *PasswordAlterPrincipalOption) principalOptionNode() {}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package ast
2+
3+
// DataModificationTableReference represents a DML statement used as a table source in FROM clause
4+
// This allows using INSERT/UPDATE/DELETE/MERGE with OUTPUT clause as table sources
5+
type DataModificationTableReference struct {
6+
DataModificationSpecification DataModificationSpecification
7+
Alias *Identifier
8+
Columns []*Identifier
9+
ForPath bool
10+
}
11+
12+
func (d *DataModificationTableReference) node() {}
13+
func (d *DataModificationTableReference) tableReference() {}
14+
15+
// DataModificationSpecification is the interface for DML specifications
16+
type DataModificationSpecification interface {
17+
Node
18+
dataModificationSpecification()
19+
}

ast/delete_statement.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ type DeleteSpecification struct {
1919
OutputClause *OutputClause `json:"OutputClause,omitempty"`
2020
OutputIntoClause *OutputIntoClause `json:"OutputIntoClause,omitempty"`
2121
}
22+
23+
func (d *DeleteSpecification) node() {}
24+
func (d *DeleteSpecification) dataModificationSpecification() {}
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
package ast
2+
3+
// DropPartitionFunctionStatement represents a DROP PARTITION FUNCTION statement
4+
type DropPartitionFunctionStatement struct {
5+
Name *Identifier `json:"Name,omitempty"`
6+
IsIfExists bool `json:"IsIfExists"`
7+
}
8+
9+
func (*DropPartitionFunctionStatement) statement() {}
10+
func (*DropPartitionFunctionStatement) node() {}
11+
12+
// DropPartitionSchemeStatement represents a DROP PARTITION SCHEME statement
13+
type DropPartitionSchemeStatement struct {
14+
Name *Identifier `json:"Name,omitempty"`
15+
IsIfExists bool `json:"IsIfExists"`
16+
}
17+
18+
func (*DropPartitionSchemeStatement) statement() {}
19+
func (*DropPartitionSchemeStatement) node() {}
20+
21+
// DropApplicationRoleStatement represents a DROP APPLICATION ROLE statement
22+
type DropApplicationRoleStatement struct {
23+
Name *Identifier `json:"Name,omitempty"`
24+
IsIfExists bool `json:"IsIfExists"`
25+
}
26+
27+
func (*DropApplicationRoleStatement) statement() {}
28+
func (*DropApplicationRoleStatement) node() {}
29+
30+
// DropCertificateStatement represents a DROP CERTIFICATE statement
31+
type DropCertificateStatement struct {
32+
Name *Identifier `json:"Name,omitempty"`
33+
IsIfExists bool `json:"IsIfExists"`
34+
}
35+
36+
func (*DropCertificateStatement) statement() {}
37+
func (*DropCertificateStatement) node() {}
38+
39+
// DropMasterKeyStatement represents a DROP MASTER KEY statement
40+
type DropMasterKeyStatement struct{}
41+
42+
func (*DropMasterKeyStatement) statement() {}
43+
func (*DropMasterKeyStatement) node() {}
44+
45+
// DropXmlSchemaCollectionStatement represents a DROP XML SCHEMA COLLECTION statement
46+
type DropXmlSchemaCollectionStatement struct {
47+
Name *SchemaObjectName `json:"Name,omitempty"`
48+
}
49+
50+
func (*DropXmlSchemaCollectionStatement) statement() {}
51+
func (*DropXmlSchemaCollectionStatement) node() {}
52+
53+
// DropContractStatement represents a DROP CONTRACT statement
54+
type DropContractStatement struct {
55+
Name *Identifier `json:"Name,omitempty"`
56+
IsIfExists bool `json:"IsIfExists"`
57+
}
58+
59+
func (*DropContractStatement) statement() {}
60+
func (*DropContractStatement) node() {}
61+
62+
// DropEndpointStatement represents a DROP ENDPOINT statement
63+
type DropEndpointStatement struct {
64+
Name *Identifier `json:"Name,omitempty"`
65+
IsIfExists bool `json:"IsIfExists"`
66+
}
67+
68+
func (*DropEndpointStatement) statement() {}
69+
func (*DropEndpointStatement) node() {}
70+
71+
// DropMessageTypeStatement represents a DROP MESSAGE TYPE statement
72+
type DropMessageTypeStatement struct {
73+
Name *Identifier `json:"Name,omitempty"`
74+
IsIfExists bool `json:"IsIfExists"`
75+
}
76+
77+
func (*DropMessageTypeStatement) statement() {}
78+
func (*DropMessageTypeStatement) node() {}
79+
80+
// DropQueueStatement represents a DROP QUEUE statement
81+
type DropQueueStatement struct {
82+
Name *SchemaObjectName `json:"Name,omitempty"`
83+
}
84+
85+
func (*DropQueueStatement) statement() {}
86+
func (*DropQueueStatement) node() {}
87+
88+
// DropRemoteServiceBindingStatement represents a DROP REMOTE SERVICE BINDING statement
89+
type DropRemoteServiceBindingStatement struct {
90+
Name *Identifier `json:"Name,omitempty"`
91+
IsIfExists bool `json:"IsIfExists"`
92+
}
93+
94+
func (*DropRemoteServiceBindingStatement) statement() {}
95+
func (*DropRemoteServiceBindingStatement) node() {}
96+
97+
// DropRouteStatement represents a DROP ROUTE statement
98+
type DropRouteStatement struct {
99+
Name *Identifier `json:"Name,omitempty"`
100+
IsIfExists bool `json:"IsIfExists"`
101+
}
102+
103+
func (*DropRouteStatement) statement() {}
104+
func (*DropRouteStatement) node() {}
105+
106+
// DropServiceStatement represents a DROP SERVICE statement
107+
type DropServiceStatement struct {
108+
Name *Identifier `json:"Name,omitempty"`
109+
IsIfExists bool `json:"IsIfExists"`
110+
}
111+
112+
func (*DropServiceStatement) statement() {}
113+
func (*DropServiceStatement) node() {}
114+
115+
// DropEventNotificationStatement represents a DROP EVENT NOTIFICATION statement
116+
type DropEventNotificationStatement struct {
117+
Notifications []*Identifier `json:"Notifications,omitempty"`
118+
Scope *EventNotificationObjectScope `json:"Scope,omitempty"`
119+
}
120+
121+
func (*DropEventNotificationStatement) statement() {}
122+
func (*DropEventNotificationStatement) node() {}

ast/drop_statements.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,22 @@ type DropIndexOption interface {
8181

8282
// OnlineIndexOption represents the ONLINE option
8383
type OnlineIndexOption struct {
84-
OptionState string // On, Off
85-
OptionKind string // Online
84+
LowPriorityLockWaitOption *OnlineIndexLowPriorityLockWaitOption // For ONLINE = ON (WAIT_AT_LOW_PRIORITY (...))
85+
OptionState string // On, Off
86+
OptionKind string // Online
8687
}
8788

8889
func (o *OnlineIndexOption) node() {}
8990
func (o *OnlineIndexOption) dropIndexOption() {}
9091
func (o *OnlineIndexOption) indexOption() {}
9192

93+
// OnlineIndexLowPriorityLockWaitOption represents WAIT_AT_LOW_PRIORITY options for ONLINE = ON
94+
type OnlineIndexLowPriorityLockWaitOption struct {
95+
Options []LowPriorityLockWaitOption
96+
}
97+
98+
func (o *OnlineIndexLowPriorityLockWaitOption) node() {}
99+
92100
// MoveToDropIndexOption represents the MOVE TO option
93101
type MoveToDropIndexOption struct {
94102
MoveTo *FileGroupOrPartitionScheme

ast/fulltext_stoplist_statement.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ func (s *DropFullTextStopListStatement) statement() {}
4242

4343
// DropFullTextCatalogStatement represents DROP FULLTEXT CATALOG statement
4444
type DropFullTextCatalogStatement struct {
45-
Name *Identifier `json:"Name,omitempty"`
45+
Name *Identifier `json:"Name,omitempty"`
46+
IsIfExists bool `json:"IsIfExists"`
4647
}
4748

4849
func (s *DropFullTextCatalogStatement) node() {}

0 commit comments

Comments
 (0)