@@ -2,7 +2,9 @@ package ast
22
33// CreateDatabaseStatement represents a CREATE DATABASE statement.
44type CreateDatabaseStatement struct {
5- DatabaseName * Identifier `json:"DatabaseName,omitempty"`
5+ DatabaseName * Identifier `json:"DatabaseName,omitempty"`
6+ Options []CreateDatabaseOption `json:"Options,omitempty"`
7+ AttachMode string `json:"AttachMode,omitempty"` // "None", "Attach", "AttachRebuildLog"
68}
79
810func (s * CreateDatabaseStatement ) node () {}
@@ -24,9 +26,33 @@ type CreateServiceStatement struct {
2426func (s * CreateServiceStatement ) node () {}
2527func (s * CreateServiceStatement ) statement () {}
2628
29+ // QueueOption is an interface for queue options.
30+ type QueueOption interface {
31+ node ()
32+ queueOption ()
33+ }
34+
35+ // QueueStateOption represents a queue state option (STATUS, RETENTION, POISON_MESSAGE_HANDLING).
36+ type QueueStateOption struct {
37+ OptionState string `json:"OptionState,omitempty"` // "On" or "Off"
38+ OptionKind string `json:"OptionKind,omitempty"` // "Status", "Retention", "PoisonMessageHandlingStatus"
39+ }
40+
41+ func (o * QueueStateOption ) node () {}
42+ func (o * QueueStateOption ) queueOption () {}
43+
44+ // QueueOptionSimple represents a simple queue option like ActivationDrop.
45+ type QueueOptionSimple struct {
46+ OptionKind string `json:"OptionKind,omitempty"` // e.g. "ActivationDrop"
47+ }
48+
49+ func (o * QueueOptionSimple ) node () {}
50+ func (o * QueueOptionSimple ) queueOption () {}
51+
2752// CreateQueueStatement represents a CREATE QUEUE statement.
2853type CreateQueueStatement struct {
29- Name * SchemaObjectName `json:"Name,omitempty"`
54+ Name * SchemaObjectName `json:"Name,omitempty"`
55+ QueueOptions []QueueOption `json:"QueueOptions,omitempty"`
3056}
3157
3258func (s * CreateQueueStatement ) node () {}
@@ -82,7 +108,10 @@ func (s *CreateSymmetricKeyStatement) statement() {}
82108
83109// CreateMessageTypeStatement represents a CREATE MESSAGE TYPE statement.
84110type CreateMessageTypeStatement struct {
85- Name * Identifier `json:"Name,omitempty"`
111+ Name * Identifier `json:"Name,omitempty"`
112+ Owner * Identifier `json:"Owner,omitempty"`
113+ ValidationMethod string `json:"ValidationMethod,omitempty"`
114+ XmlSchemaCollectionName * SchemaObjectName `json:"XmlSchemaCollectionName,omitempty"`
86115}
87116
88117func (s * CreateMessageTypeStatement ) node () {}
@@ -98,12 +127,21 @@ func (s *CreateRemoteServiceBindingStatement) statement() {}
98127
99128// CreateApplicationRoleStatement represents a CREATE APPLICATION ROLE statement.
100129type CreateApplicationRoleStatement struct {
101- Name * Identifier `json:"Name,omitempty"`
130+ Name * Identifier `json:"Name,omitempty"`
131+ ApplicationRoleOptions []* ApplicationRoleOption `json:"ApplicationRoleOptions,omitempty"`
102132}
103133
104134func (s * CreateApplicationRoleStatement ) node () {}
105135func (s * CreateApplicationRoleStatement ) statement () {}
106136
137+ // ApplicationRoleOption represents an option in CREATE/ALTER APPLICATION ROLE
138+ type ApplicationRoleOption struct {
139+ OptionKind string `json:"OptionKind,omitempty"`
140+ Value * IdentifierOrValueExpression `json:"Value,omitempty"`
141+ }
142+
143+ func (o * ApplicationRoleOption ) node () {}
144+
107145// CreateFulltextCatalogStatement represents a CREATE FULLTEXT CATALOG statement.
108146type CreateFulltextCatalogStatement struct {
109147 Name * Identifier `json:"Name,omitempty"`
@@ -150,8 +188,11 @@ func (s *CreateIndexStatement) statement() {}
150188
151189// CreateStatisticsStatement represents a CREATE STATISTICS statement.
152190type CreateStatisticsStatement struct {
153- Name * Identifier `json:"Name,omitempty"`
154- OnName * SchemaObjectName `json:"OnName,omitempty"`
191+ Name * Identifier `json:"Name,omitempty"`
192+ OnName * SchemaObjectName `json:"OnName,omitempty"`
193+ Columns []* ColumnReferenceExpression `json:"Columns,omitempty"`
194+ StatisticsOptions []StatisticsOption `json:"StatisticsOptions,omitempty"`
195+ FilterPredicate BooleanExpression `json:"FilterPredicate,omitempty"`
155196}
156197
157198func (s * CreateStatisticsStatement ) node () {}
0 commit comments