Skip to content

Commit 4b9f707

Browse files
committed
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
1 parent 7f60105 commit 4b9f707

7 files changed

Lines changed: 702 additions & 6 deletions

File tree

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 {
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/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)