@@ -2,12 +2,25 @@ package ast
22
33// CreateDatabaseStatement represents a CREATE DATABASE statement.
44type CreateDatabaseStatement struct {
5- DatabaseName * Identifier `json:"DatabaseName,omitempty"`
6- Options []CreateDatabaseOption `json:"Options,omitempty"`
7- AttachMode string `json:"AttachMode,omitempty"` // "None", "Attach", "AttachRebuildLog"
8- CopyOf * MultiPartIdentifier `json:"CopyOf,omitempty"` // For AS COPY OF syntax
5+ DatabaseName * Identifier `json:"DatabaseName,omitempty"`
6+ Options []CreateDatabaseOption `json:"Options,omitempty"`
7+ AttachMode string `json:"AttachMode,omitempty"` // "None", "Attach", "AttachRebuildLog"
8+ CopyOf * MultiPartIdentifier `json:"CopyOf,omitempty"` // For AS COPY OF syntax
9+ FileGroups []* FileGroupDefinition `json:"FileGroups,omitempty"`
10+ LogOn []* FileDeclaration `json:"LogOn,omitempty"`
11+ Collation * Identifier `json:"Collation,omitempty"`
12+ Containment * ContainmentDatabaseOption `json:"Containment,omitempty"`
913}
1014
15+ // ContainmentDatabaseOption represents CONTAINMENT = NONE/PARTIAL
16+ type ContainmentDatabaseOption struct {
17+ Value string // "None" or "Partial"
18+ OptionKind string // Always "Containment"
19+ }
20+
21+ func (c * ContainmentDatabaseOption ) node () {}
22+ func (c * ContainmentDatabaseOption ) createDatabaseOption () {}
23+
1124func (s * CreateDatabaseStatement ) node () {}
1225func (s * CreateDatabaseStatement ) statement () {}
1326
@@ -19,9 +32,20 @@ type CreateLoginStatement struct {
1932func (s * CreateLoginStatement ) node () {}
2033func (s * CreateLoginStatement ) statement () {}
2134
35+ // ServiceContract represents a contract in CREATE/ALTER SERVICE.
36+ type ServiceContract struct {
37+ Name * Identifier `json:"Name,omitempty"`
38+ Action string `json:"Action,omitempty"` // "Add", "Drop", "None"
39+ }
40+
41+ func (s * ServiceContract ) node () {}
42+
2243// CreateServiceStatement represents a CREATE SERVICE statement.
2344type CreateServiceStatement struct {
24- Name * Identifier `json:"Name,omitempty"`
45+ Owner * Identifier `json:"Owner,omitempty"`
46+ Name * Identifier `json:"Name,omitempty"`
47+ QueueName * SchemaObjectName `json:"QueueName,omitempty"`
48+ ServiceContracts []* ServiceContract `json:"ServiceContracts,omitempty"`
2549}
2650
2751func (s * CreateServiceStatement ) node () {}
@@ -61,12 +85,22 @@ func (s *CreateQueueStatement) statement() {}
6185
6286// CreateRouteStatement represents a CREATE ROUTE statement.
6387type CreateRouteStatement struct {
64- Name * Identifier `json:"Name,omitempty"`
88+ Name * Identifier `json:"Name,omitempty"`
89+ Owner * Identifier `json:"Owner,omitempty"`
90+ RouteOptions []* RouteOption `json:"RouteOptions,omitempty"`
6591}
6692
6793func (s * CreateRouteStatement ) node () {}
6894func (s * CreateRouteStatement ) statement () {}
6995
96+ // RouteOption represents an option in CREATE/ALTER ROUTE statement.
97+ type RouteOption struct {
98+ OptionKind string `json:"OptionKind,omitempty"`
99+ Literal ScalarExpression `json:"Literal,omitempty"`
100+ }
101+
102+ func (r * RouteOption ) node () {}
103+
70104// CreateEndpointStatement represents a CREATE ENDPOINT statement.
71105type CreateEndpointStatement struct {
72106 Name * Identifier `json:"Name,omitempty"`
@@ -150,14 +184,36 @@ type CreationDispositionKeyOption struct {
150184func (c * CreationDispositionKeyOption ) node () {}
151185func (c * CreationDispositionKeyOption ) keyOption () {}
152186
187+ // CryptoMechanism represents an encryption mechanism (CERTIFICATE, KEY, PASSWORD, etc.)
188+ type CryptoMechanism struct {
189+ CryptoMechanismType string `json:"CryptoMechanismType,omitempty"` // "Certificate", "SymmetricKey", "AsymmetricKey", "Password"
190+ Identifier * Identifier `json:"Identifier,omitempty"`
191+ PasswordOrSignature ScalarExpression `json:"PasswordOrSignature,omitempty"`
192+ }
193+
194+ func (c * CryptoMechanism ) node () {}
195+
153196// CreateSymmetricKeyStatement represents a CREATE SYMMETRIC KEY statement.
154197type CreateSymmetricKeyStatement struct {
155- Name * Identifier `json:"Name,omitempty"`
198+ KeyOptions []KeyOption `json:"KeyOptions,omitempty"`
199+ Provider * Identifier `json:"Provider,omitempty"`
200+ Name * Identifier `json:"Name,omitempty"`
201+ EncryptingMechanisms []* CryptoMechanism `json:"EncryptingMechanisms,omitempty"`
156202}
157203
158204func (s * CreateSymmetricKeyStatement ) node () {}
159205func (s * CreateSymmetricKeyStatement ) statement () {}
160206
207+ // DropSymmetricKeyStatement represents a DROP SYMMETRIC KEY statement.
208+ type DropSymmetricKeyStatement struct {
209+ RemoveProviderKey bool `json:"RemoveProviderKey,omitempty"`
210+ Name * Identifier `json:"Name,omitempty"`
211+ IsIfExists bool `json:"IsIfExists"`
212+ }
213+
214+ func (s * DropSymmetricKeyStatement ) node () {}
215+ func (s * DropSymmetricKeyStatement ) statement () {}
216+
161217// CreateMessageTypeStatement represents a CREATE MESSAGE TYPE statement.
162218type CreateMessageTypeStatement struct {
163219 Name * Identifier `json:"Name,omitempty"`
@@ -171,7 +227,9 @@ func (s *CreateMessageTypeStatement) statement() {}
171227
172228// CreateRemoteServiceBindingStatement represents a CREATE REMOTE SERVICE BINDING statement.
173229type CreateRemoteServiceBindingStatement struct {
174- Name * Identifier `json:"Name,omitempty"`
230+ Name * Identifier `json:"Name,omitempty"`
231+ Service ScalarExpression `json:"Service,omitempty"`
232+ Options []RemoteServiceBindingOption `json:"Options,omitempty"`
175233}
176234
177235func (s * CreateRemoteServiceBindingStatement ) node () {}
0 commit comments