-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_simple_statements.go
More file actions
224 lines (173 loc) · 8.07 KB
/
create_simple_statements.go
File metadata and controls
224 lines (173 loc) · 8.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
package ast
// CreateDatabaseStatement represents a CREATE DATABASE statement.
type CreateDatabaseStatement struct {
DatabaseName *Identifier `json:"DatabaseName,omitempty"`
Options []CreateDatabaseOption `json:"Options,omitempty"`
AttachMode string `json:"AttachMode,omitempty"` // "None", "Attach", "AttachRebuildLog"
}
func (s *CreateDatabaseStatement) node() {}
func (s *CreateDatabaseStatement) statement() {}
// CreateLoginStatement represents a CREATE LOGIN statement.
type CreateLoginStatement struct {
Name *Identifier `json:"Name,omitempty"`
}
func (s *CreateLoginStatement) node() {}
func (s *CreateLoginStatement) statement() {}
// CreateServiceStatement represents a CREATE SERVICE statement.
type CreateServiceStatement struct {
Name *Identifier `json:"Name,omitempty"`
}
func (s *CreateServiceStatement) node() {}
func (s *CreateServiceStatement) statement() {}
// QueueOption is an interface for queue options.
type QueueOption interface {
node()
queueOption()
}
// QueueStateOption represents a queue state option (STATUS, RETENTION, POISON_MESSAGE_HANDLING).
type QueueStateOption struct {
OptionState string `json:"OptionState,omitempty"` // "On" or "Off"
OptionKind string `json:"OptionKind,omitempty"` // "Status", "Retention", "PoisonMessageHandlingStatus"
}
func (o *QueueStateOption) node() {}
func (o *QueueStateOption) queueOption() {}
// QueueOptionSimple represents a simple queue option like ActivationDrop.
type QueueOptionSimple struct {
OptionKind string `json:"OptionKind,omitempty"` // e.g. "ActivationDrop"
}
func (o *QueueOptionSimple) node() {}
func (o *QueueOptionSimple) queueOption() {}
// CreateQueueStatement represents a CREATE QUEUE statement.
type CreateQueueStatement struct {
Name *SchemaObjectName `json:"Name,omitempty"`
QueueOptions []QueueOption `json:"QueueOptions,omitempty"`
}
func (s *CreateQueueStatement) node() {}
func (s *CreateQueueStatement) statement() {}
// CreateRouteStatement represents a CREATE ROUTE statement.
type CreateRouteStatement struct {
Name *Identifier `json:"Name,omitempty"`
}
func (s *CreateRouteStatement) node() {}
func (s *CreateRouteStatement) statement() {}
// CreateEndpointStatement represents a CREATE ENDPOINT statement.
type CreateEndpointStatement struct {
Name *Identifier `json:"Name,omitempty"`
}
func (s *CreateEndpointStatement) node() {}
func (s *CreateEndpointStatement) statement() {}
// CreateAssemblyStatement represents a CREATE ASSEMBLY statement.
type CreateAssemblyStatement struct {
Name *Identifier `json:"Name,omitempty"`
}
func (s *CreateAssemblyStatement) node() {}
func (s *CreateAssemblyStatement) statement() {}
// CreateCertificateStatement represents a CREATE CERTIFICATE statement.
type CreateCertificateStatement struct {
Name *Identifier `json:"Name,omitempty"`
}
func (s *CreateCertificateStatement) node() {}
func (s *CreateCertificateStatement) statement() {}
// CreateAsymmetricKeyStatement represents a CREATE ASYMMETRIC KEY statement.
type CreateAsymmetricKeyStatement struct {
Name *Identifier `json:"Name,omitempty"`
}
func (s *CreateAsymmetricKeyStatement) node() {}
func (s *CreateAsymmetricKeyStatement) statement() {}
// CreateSymmetricKeyStatement represents a CREATE SYMMETRIC KEY statement.
type CreateSymmetricKeyStatement struct {
Name *Identifier `json:"Name,omitempty"`
}
func (s *CreateSymmetricKeyStatement) node() {}
func (s *CreateSymmetricKeyStatement) statement() {}
// CreateMessageTypeStatement represents a CREATE MESSAGE TYPE statement.
type CreateMessageTypeStatement struct {
Name *Identifier `json:"Name,omitempty"`
Owner *Identifier `json:"Owner,omitempty"`
ValidationMethod string `json:"ValidationMethod,omitempty"`
XmlSchemaCollectionName *SchemaObjectName `json:"XmlSchemaCollectionName,omitempty"`
}
func (s *CreateMessageTypeStatement) node() {}
func (s *CreateMessageTypeStatement) statement() {}
// CreateRemoteServiceBindingStatement represents a CREATE REMOTE SERVICE BINDING statement.
type CreateRemoteServiceBindingStatement struct {
Name *Identifier `json:"Name,omitempty"`
}
func (s *CreateRemoteServiceBindingStatement) node() {}
func (s *CreateRemoteServiceBindingStatement) statement() {}
// CreateApplicationRoleStatement represents a CREATE APPLICATION ROLE statement.
type CreateApplicationRoleStatement struct {
Name *Identifier `json:"Name,omitempty"`
ApplicationRoleOptions []*ApplicationRoleOption `json:"ApplicationRoleOptions,omitempty"`
}
func (s *CreateApplicationRoleStatement) node() {}
func (s *CreateApplicationRoleStatement) statement() {}
// ApplicationRoleOption represents an option in CREATE/ALTER APPLICATION ROLE
type ApplicationRoleOption struct {
OptionKind string `json:"OptionKind,omitempty"`
Value *IdentifierOrValueExpression `json:"Value,omitempty"`
}
func (o *ApplicationRoleOption) node() {}
// CreateFulltextCatalogStatement represents a CREATE FULLTEXT CATALOG statement.
type CreateFulltextCatalogStatement struct {
Name *Identifier `json:"Name,omitempty"`
}
func (s *CreateFulltextCatalogStatement) node() {}
func (s *CreateFulltextCatalogStatement) statement() {}
// CreateFulltextIndexStatement represents a CREATE FULLTEXT INDEX statement.
type CreateFulltextIndexStatement struct {
OnName *SchemaObjectName `json:"OnName,omitempty"`
}
func (s *CreateFulltextIndexStatement) node() {}
func (s *CreateFulltextIndexStatement) statement() {}
// PartitionParameterType represents the parameter type in a partition function.
type PartitionParameterType struct {
DataType *SqlDataTypeReference `json:"DataType,omitempty"`
Collation *Identifier `json:"Collation,omitempty"`
}
func (p *PartitionParameterType) node() {}
// CreatePartitionFunctionStatement represents a CREATE PARTITION FUNCTION statement.
type CreatePartitionFunctionStatement struct {
Name *Identifier `json:"Name,omitempty"`
ParameterType *PartitionParameterType `json:"ParameterType,omitempty"`
Range string `json:"Range,omitempty"` // "Left" or "Right"
BoundaryValues []ScalarExpression `json:"BoundaryValues,omitempty"`
}
func (s *CreatePartitionFunctionStatement) node() {}
func (s *CreatePartitionFunctionStatement) statement() {}
// CreateIndexStatement represents a CREATE INDEX statement.
type CreateIndexStatement struct {
Name *Identifier `json:"Name,omitempty"`
OnName *SchemaObjectName `json:"OnName,omitempty"`
}
func (s *CreateIndexStatement) node() {}
func (s *CreateIndexStatement) statement() {}
// CreateStatisticsStatement represents a CREATE STATISTICS statement.
type CreateStatisticsStatement struct {
Name *Identifier `json:"Name,omitempty"`
OnName *SchemaObjectName `json:"OnName,omitempty"`
Columns []*ColumnReferenceExpression `json:"Columns,omitempty"`
StatisticsOptions []StatisticsOption `json:"StatisticsOptions,omitempty"`
FilterPredicate BooleanExpression `json:"FilterPredicate,omitempty"`
}
func (s *CreateStatisticsStatement) node() {}
func (s *CreateStatisticsStatement) statement() {}
// CreateTypeStatement represents a CREATE TYPE statement.
type CreateTypeStatement struct {
Name *SchemaObjectName `json:"Name,omitempty"`
}
func (s *CreateTypeStatement) node() {}
func (s *CreateTypeStatement) statement() {}
// CreateXmlIndexStatement represents a CREATE XML INDEX statement.
type CreateXmlIndexStatement struct {
Name *Identifier `json:"Name,omitempty"`
OnName *SchemaObjectName `json:"OnName,omitempty"`
}
func (s *CreateXmlIndexStatement) node() {}
func (s *CreateXmlIndexStatement) statement() {}
// CreateEventNotificationStatement represents a CREATE EVENT NOTIFICATION statement.
type CreateEventNotificationStatement struct {
Name *Identifier `json:"Name,omitempty"`
}
func (s *CreateEventNotificationStatement) node() {}
func (s *CreateEventNotificationStatement) statement() {}