-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalter_database_set_statement.go
More file actions
175 lines (140 loc) · 6.23 KB
/
alter_database_set_statement.go
File metadata and controls
175 lines (140 loc) · 6.23 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
package ast
// AlterDatabaseSetStatement represents ALTER DATABASE ... SET statement
type AlterDatabaseSetStatement struct {
DatabaseName *Identifier
UseCurrent bool
WithManualCutover bool
Options []DatabaseOption
}
func (a *AlterDatabaseSetStatement) node() {}
func (a *AlterDatabaseSetStatement) statement() {}
// DatabaseOption is an interface for database options
type DatabaseOption interface {
Node
databaseOption()
}
// AcceleratedDatabaseRecoveryDatabaseOption represents ACCELERATED_DATABASE_RECOVERY option
type AcceleratedDatabaseRecoveryDatabaseOption struct {
OptionKind string // "AcceleratedDatabaseRecovery"
OptionState string // "On" or "Off"
}
func (a *AcceleratedDatabaseRecoveryDatabaseOption) node() {}
func (a *AcceleratedDatabaseRecoveryDatabaseOption) databaseOption() {}
// OnOffDatabaseOption represents a simple ON/OFF database option
type OnOffDatabaseOption struct {
OptionKind string // "TemporalHistoryRetention", etc.
OptionState string // "On" or "Off"
}
func (o *OnOffDatabaseOption) node() {}
func (o *OnOffDatabaseOption) databaseOption() {}
// DelayedDurabilityDatabaseOption represents DELAYED_DURABILITY option
type DelayedDurabilityDatabaseOption struct {
OptionKind string // "DelayedDurability"
Value string // "Disabled", "Allowed", "Forced"
}
func (d *DelayedDurabilityDatabaseOption) node() {}
func (d *DelayedDurabilityDatabaseOption) databaseOption() {}
// IdentifierDatabaseOption represents a database option with an identifier value
type IdentifierDatabaseOption struct {
OptionKind string `json:"OptionKind,omitempty"` // "CatalogCollation"
Value *Identifier `json:"Value,omitempty"`
}
func (i *IdentifierDatabaseOption) node() {}
func (i *IdentifierDatabaseOption) databaseOption() {}
// CreateDatabaseOption is an interface for CREATE DATABASE options (can be DatabaseOption)
type CreateDatabaseOption interface {
node()
createDatabaseOption()
}
// Make existing database options implement CreateDatabaseOption
func (o *OnOffDatabaseOption) createDatabaseOption() {}
func (i *IdentifierDatabaseOption) createDatabaseOption() {}
func (d *DelayedDurabilityDatabaseOption) createDatabaseOption() {}
// MaxSizeDatabaseOption represents a MAXSIZE option.
type MaxSizeDatabaseOption struct {
OptionKind string `json:"OptionKind,omitempty"`
MaxSize ScalarExpression `json:"MaxSize,omitempty"`
Units string `json:"Units,omitempty"` // "GB", "TB", etc.
}
func (m *MaxSizeDatabaseOption) node() {}
func (m *MaxSizeDatabaseOption) databaseOption() {}
func (m *MaxSizeDatabaseOption) createDatabaseOption() {}
// LiteralDatabaseOption represents a database option with a literal value (e.g., EDITION).
type LiteralDatabaseOption struct {
OptionKind string `json:"OptionKind,omitempty"`
Value ScalarExpression `json:"Value,omitempty"`
}
func (l *LiteralDatabaseOption) node() {}
func (l *LiteralDatabaseOption) databaseOption() {}
func (l *LiteralDatabaseOption) createDatabaseOption() {}
// AlterDatabaseAddFileStatement represents ALTER DATABASE ... ADD FILE statement
type AlterDatabaseAddFileStatement struct {
DatabaseName *Identifier
FileDeclarations []*FileDeclaration
FileGroup *Identifier
IsLog bool
UseCurrent bool
}
func (a *AlterDatabaseAddFileStatement) node() {}
func (a *AlterDatabaseAddFileStatement) statement() {}
// AlterDatabaseAddFileGroupStatement represents ALTER DATABASE ... ADD FILEGROUP statement
type AlterDatabaseAddFileGroupStatement struct {
DatabaseName *Identifier
FileGroupName *Identifier
ContainsFileStream bool
ContainsMemoryOptimizedData bool
UseCurrent bool
}
func (a *AlterDatabaseAddFileGroupStatement) node() {}
func (a *AlterDatabaseAddFileGroupStatement) statement() {}
// AlterDatabaseModifyFileStatement represents ALTER DATABASE ... MODIFY FILE statement
type AlterDatabaseModifyFileStatement struct {
DatabaseName *Identifier
}
func (a *AlterDatabaseModifyFileStatement) node() {}
func (a *AlterDatabaseModifyFileStatement) statement() {}
// AlterDatabaseModifyFileGroupStatement represents ALTER DATABASE ... MODIFY FILEGROUP statement
type AlterDatabaseModifyFileGroupStatement struct {
DatabaseName *Identifier
FileGroupName *Identifier
MakeDefault bool
UpdatabilityOption string // "ReadOnly", "ReadWrite", "ReadOnlyOld", "ReadWriteOld", or ""
NewFileGroupName *Identifier
}
func (a *AlterDatabaseModifyFileGroupStatement) node() {}
func (a *AlterDatabaseModifyFileGroupStatement) statement() {}
// AlterDatabaseModifyNameStatement represents ALTER DATABASE ... MODIFY NAME statement
type AlterDatabaseModifyNameStatement struct {
DatabaseName *Identifier
NewName *Identifier
}
func (a *AlterDatabaseModifyNameStatement) node() {}
func (a *AlterDatabaseModifyNameStatement) statement() {}
// AlterDatabaseRemoveFileStatement represents ALTER DATABASE ... REMOVE FILE statement
type AlterDatabaseRemoveFileStatement struct {
DatabaseName *Identifier
FileName *Identifier
}
func (a *AlterDatabaseRemoveFileStatement) node() {}
func (a *AlterDatabaseRemoveFileStatement) statement() {}
// AlterDatabaseRemoveFileGroupStatement represents ALTER DATABASE ... REMOVE FILEGROUP statement
type AlterDatabaseRemoveFileGroupStatement struct {
DatabaseName *Identifier
FileGroupName *Identifier
UseCurrent bool
}
func (a *AlterDatabaseRemoveFileGroupStatement) node() {}
func (a *AlterDatabaseRemoveFileGroupStatement) statement() {}
// AlterDatabaseScopedConfigurationClearStatement represents ALTER DATABASE SCOPED CONFIGURATION CLEAR statement
type AlterDatabaseScopedConfigurationClearStatement struct {
Option *DatabaseConfigurationClearOption
Secondary bool
}
func (a *AlterDatabaseScopedConfigurationClearStatement) node() {}
func (a *AlterDatabaseScopedConfigurationClearStatement) statement() {}
// DatabaseConfigurationClearOption represents a CLEAR option
type DatabaseConfigurationClearOption struct {
OptionKind string // "ProcedureCache"
PlanHandle ScalarExpression // Optional binary plan handle
}
func (d *DatabaseConfigurationClearOption) node() {}