-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathalter_database_set_statement.go
More file actions
612 lines (486 loc) · 23.1 KB
/
alter_database_set_statement.go
File metadata and controls
612 lines (486 loc) · 23.1 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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
package ast
// AlterDatabaseSetStatement represents ALTER DATABASE ... SET statement
type AlterDatabaseSetStatement struct {
DatabaseName *Identifier
UseCurrent bool
WithManualCutover bool
Options []DatabaseOption
Termination *AlterDatabaseTermination
}
// AlterDatabaseTermination represents the termination clause (WITH NO_WAIT, WITH ROLLBACK AFTER N, WITH ROLLBACK IMMEDIATE)
type AlterDatabaseTermination struct {
NoWait bool
ImmediateRollback bool
RollbackAfter ScalarExpression
}
func (a *AlterDatabaseTermination) node() {}
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() {}
// AutoCreateStatisticsDatabaseOption represents AUTO_CREATE_STATISTICS option with optional INCREMENTAL
type AutoCreateStatisticsDatabaseOption struct {
OptionKind string // "AutoCreateStatistics"
OptionState string // "On" or "Off"
HasIncremental bool // Whether INCREMENTAL is specified
IncrementalState string // "On" or "Off"
}
func (a *AutoCreateStatisticsDatabaseOption) node() {}
func (a *AutoCreateStatisticsDatabaseOption) 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() {}
// SimpleDatabaseOption represents a simple database option with just OptionKind (e.g., ENABLE_BROKER)
type SimpleDatabaseOption struct {
OptionKind string `json:"OptionKind,omitempty"`
}
func (d *SimpleDatabaseOption) node() {}
func (d *SimpleDatabaseOption) createDatabaseOption() {}
func (d *SimpleDatabaseOption) databaseOption() {}
// 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() {}
// AutomaticTuningDatabaseOption represents AUTOMATIC_TUNING option
type AutomaticTuningDatabaseOption struct {
OptionKind string // "AutomaticTuning"
AutomaticTuningState string // "Inherit", "Custom", "Auto", "NotSet"
Options []AutomaticTuningOption // Sub-options like CREATE_INDEX, DROP_INDEX, etc.
}
func (a *AutomaticTuningDatabaseOption) node() {}
func (a *AutomaticTuningDatabaseOption) databaseOption() {}
// AutomaticTuningOption is an interface for automatic tuning sub-options
type AutomaticTuningOption interface {
Node
automaticTuningOption()
}
// AutomaticTuningCreateIndexOption represents CREATE_INDEX option
type AutomaticTuningCreateIndexOption struct {
OptionKind string // "Create_Index"
Value string // "On", "Off", "Default"
}
func (a *AutomaticTuningCreateIndexOption) node() {}
func (a *AutomaticTuningCreateIndexOption) automaticTuningOption() {}
// AutomaticTuningDropIndexOption represents DROP_INDEX option
type AutomaticTuningDropIndexOption struct {
OptionKind string // "Drop_Index"
Value string // "On", "Off", "Default"
}
func (a *AutomaticTuningDropIndexOption) node() {}
func (a *AutomaticTuningDropIndexOption) automaticTuningOption() {}
// AutomaticTuningForceLastGoodPlanOption represents FORCE_LAST_GOOD_PLAN option
type AutomaticTuningForceLastGoodPlanOption struct {
OptionKind string // "Force_Last_Good_Plan"
Value string // "On", "Off", "Default"
}
func (a *AutomaticTuningForceLastGoodPlanOption) node() {}
func (a *AutomaticTuningForceLastGoodPlanOption) automaticTuningOption() {}
// AutomaticTuningMaintainIndexOption represents MAINTAIN_INDEX option
type AutomaticTuningMaintainIndexOption struct {
OptionKind string // "Maintain_Index"
Value string // "On", "Off", "Default"
}
func (a *AutomaticTuningMaintainIndexOption) node() {}
func (a *AutomaticTuningMaintainIndexOption) automaticTuningOption() {}
// ElasticPoolSpecification represents SERVICE_OBJECTIVE = ELASTIC_POOL(name = poolname)
type ElasticPoolSpecification struct {
ElasticPoolName *Identifier
OptionKind string // "ServiceObjective"
}
func (e *ElasticPoolSpecification) node() {}
func (e *ElasticPoolSpecification) databaseOption() {}
func (e *ElasticPoolSpecification) 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
FileDeclaration *FileDeclaration
UseCurrent bool
}
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
Termination *AlterDatabaseTermination
UseCurrent bool
}
func (a *AlterDatabaseModifyFileGroupStatement) node() {}
func (a *AlterDatabaseModifyFileGroupStatement) statement() {}
// AlterDatabaseRebuildLogStatement represents ALTER DATABASE ... REBUILD LOG statement
type AlterDatabaseRebuildLogStatement struct {
DatabaseName *Identifier
FileDeclaration *FileDeclaration
UseCurrent bool
}
func (a *AlterDatabaseRebuildLogStatement) node() {}
func (a *AlterDatabaseRebuildLogStatement) 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() {}
// AlterDatabaseCollateStatement represents ALTER DATABASE ... COLLATE statement
type AlterDatabaseCollateStatement struct {
DatabaseName *Identifier
Collation *Identifier
}
func (a *AlterDatabaseCollateStatement) node() {}
func (a *AlterDatabaseCollateStatement) 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() {}
// RemoteDataArchiveDatabaseOption represents REMOTE_DATA_ARCHIVE database option
type RemoteDataArchiveDatabaseOption struct {
OptionKind string // "RemoteDataArchive"
OptionState string // "On", "Off", "NotSet"
Settings []RemoteDataArchiveDbSetting // Settings like SERVER, CREDENTIAL, FEDERATED_SERVICE_ACCOUNT
}
func (r *RemoteDataArchiveDatabaseOption) node() {}
func (r *RemoteDataArchiveDatabaseOption) databaseOption() {}
// RemoteDataArchiveDbSetting is an interface for Remote Data Archive settings
type RemoteDataArchiveDbSetting interface {
Node
remoteDataArchiveDbSetting()
}
// RemoteDataArchiveDbServerSetting represents the SERVER setting
type RemoteDataArchiveDbServerSetting struct {
SettingKind string // "Server"
Server ScalarExpression // The server string literal
}
func (r *RemoteDataArchiveDbServerSetting) node() {}
func (r *RemoteDataArchiveDbServerSetting) remoteDataArchiveDbSetting() {}
// RemoteDataArchiveDbCredentialSetting represents the CREDENTIAL setting
type RemoteDataArchiveDbCredentialSetting struct {
SettingKind string // "Credential"
Credential *Identifier // The credential name
}
func (r *RemoteDataArchiveDbCredentialSetting) node() {}
func (r *RemoteDataArchiveDbCredentialSetting) remoteDataArchiveDbSetting() {}
// RemoteDataArchiveDbFederatedServiceAccountSetting represents the FEDERATED_SERVICE_ACCOUNT setting
type RemoteDataArchiveDbFederatedServiceAccountSetting struct {
SettingKind string // "FederatedServiceAccount"
IsOn bool // true for ON, false for OFF
}
func (r *RemoteDataArchiveDbFederatedServiceAccountSetting) node() {}
func (r *RemoteDataArchiveDbFederatedServiceAccountSetting) remoteDataArchiveDbSetting() {}
// ChangeTrackingDatabaseOption represents the CHANGE_TRACKING database option
type ChangeTrackingDatabaseOption struct {
OptionKind string // "ChangeTracking"
OptionState string // "On", "Off", "NotSet"
Details []ChangeTrackingOptionDetail // AUTO_CLEANUP, CHANGE_RETENTION
}
func (c *ChangeTrackingDatabaseOption) node() {}
func (c *ChangeTrackingDatabaseOption) databaseOption() {}
// ChangeTrackingOptionDetail is an interface for change tracking option details
type ChangeTrackingOptionDetail interface {
Node
changeTrackingOptionDetail()
}
// AutoCleanupChangeTrackingOptionDetail represents AUTO_CLEANUP option
type AutoCleanupChangeTrackingOptionDetail struct {
IsOn bool
}
func (a *AutoCleanupChangeTrackingOptionDetail) node() {}
func (a *AutoCleanupChangeTrackingOptionDetail) changeTrackingOptionDetail() {}
// ChangeRetentionChangeTrackingOptionDetail represents CHANGE_RETENTION option
type ChangeRetentionChangeTrackingOptionDetail struct {
RetentionPeriod ScalarExpression
Unit string // "Days", "Hours", "Minutes"
}
func (c *ChangeRetentionChangeTrackingOptionDetail) node() {}
func (c *ChangeRetentionChangeTrackingOptionDetail) changeTrackingOptionDetail() {}
// RecoveryDatabaseOption represents RECOVERY database option
type RecoveryDatabaseOption struct {
OptionKind string // "Recovery"
Value string // "Full", "BulkLogged", "Simple"
}
func (r *RecoveryDatabaseOption) node() {}
func (r *RecoveryDatabaseOption) databaseOption() {}
// CursorDefaultDatabaseOption represents CURSOR_DEFAULT database option
type CursorDefaultDatabaseOption struct {
OptionKind string // "CursorDefault"
IsLocal bool // true for LOCAL, false for GLOBAL
}
func (c *CursorDefaultDatabaseOption) node() {}
func (c *CursorDefaultDatabaseOption) databaseOption() {}
// PageVerifyDatabaseOption represents PAGE_VERIFY database option
type PageVerifyDatabaseOption struct {
OptionKind string // "PageVerify"
Value string // "Checksum", "None", "TornPageDetection"
}
func (p *PageVerifyDatabaseOption) node() {}
func (p *PageVerifyDatabaseOption) databaseOption() {}
// PartnerDatabaseOption represents PARTNER database mirroring option
type PartnerDatabaseOption struct {
OptionKind string // "Partner"
PartnerServer ScalarExpression // For PARTNER = 'server'
PartnerOption string // "PartnerServer", "Failover", "ForceServiceAllowDataLoss", "Resume", "SafetyFull", "SafetyOff", "Suspend", "Timeout"
Timeout ScalarExpression // For PARTNER TIMEOUT value
}
func (p *PartnerDatabaseOption) node() {}
func (p *PartnerDatabaseOption) databaseOption() {}
// WitnessDatabaseOption represents WITNESS database mirroring option
type WitnessDatabaseOption struct {
OptionKind string // "Witness"
WitnessServer ScalarExpression // For WITNESS = 'server'
IsOff bool // For WITNESS OFF
}
func (w *WitnessDatabaseOption) node() {}
func (w *WitnessDatabaseOption) databaseOption() {}
// ParameterizationDatabaseOption represents PARAMETERIZATION database option
type ParameterizationDatabaseOption struct {
OptionKind string // "Parameterization"
IsSimple bool // true for SIMPLE, false for FORCED
}
func (p *ParameterizationDatabaseOption) node() {}
func (p *ParameterizationDatabaseOption) databaseOption() {}
// GenericDatabaseOption represents a simple database option with just OptionKind
type GenericDatabaseOption struct {
OptionKind string // e.g., "Emergency", "ErrorBrokerConversations", "EnableBroker", etc.
}
func (g *GenericDatabaseOption) node() {}
func (g *GenericDatabaseOption) databaseOption() {}
// HadrDatabaseOption represents ALTER DATABASE SET HADR {SUSPEND|RESUME|OFF}
type HadrDatabaseOption struct {
HadrOption string // "Suspend", "Resume", "Off"
OptionKind string // "Hadr"
}
func (h *HadrDatabaseOption) node() {}
func (h *HadrDatabaseOption) databaseOption() {}
// HadrAvailabilityGroupDatabaseOption represents ALTER DATABASE SET HADR AVAILABILITY GROUP = name
type HadrAvailabilityGroupDatabaseOption struct {
GroupName *Identifier
HadrOption string // "AvailabilityGroup"
OptionKind string // "Hadr"
}
func (h *HadrAvailabilityGroupDatabaseOption) node() {}
func (h *HadrAvailabilityGroupDatabaseOption) databaseOption() {}
// TargetRecoveryTimeDatabaseOption represents TARGET_RECOVERY_TIME database option
type TargetRecoveryTimeDatabaseOption struct {
OptionKind string // "TargetRecoveryTime"
RecoveryTime ScalarExpression // Integer literal
Unit string // "Seconds" or "Minutes"
}
func (t *TargetRecoveryTimeDatabaseOption) node() {}
func (t *TargetRecoveryTimeDatabaseOption) databaseOption() {}
// QueryStoreDatabaseOption represents QUERY_STORE database option
type QueryStoreDatabaseOption struct {
OptionKind string // "QueryStore"
OptionState string // "On", "Off", "NotSet"
Clear bool // QUERY_STORE CLEAR [ALL]
ClearAll bool // QUERY_STORE CLEAR ALL
Options []QueryStoreOption // Sub-options
}
func (q *QueryStoreDatabaseOption) node() {}
func (q *QueryStoreDatabaseOption) databaseOption() {}
// QueryStoreOption is an interface for query store sub-options
type QueryStoreOption interface {
Node
queryStoreOption()
}
// QueryStoreDesiredStateOption represents DESIRED_STATE option
type QueryStoreDesiredStateOption struct {
OptionKind string // "Desired_State"
Value string // "ReadOnly", "ReadWrite", "Off"
OperationModeSpecified bool // Whether OPERATION_MODE was explicitly specified
}
func (q *QueryStoreDesiredStateOption) node() {}
func (q *QueryStoreDesiredStateOption) queryStoreOption() {}
// QueryStoreCapturePolicyOption represents QUERY_CAPTURE_MODE option
type QueryStoreCapturePolicyOption struct {
OptionKind string // "Query_Capture_Mode"
Value string // "ALL", "AUTO", "NONE", "CUSTOM"
}
func (q *QueryStoreCapturePolicyOption) node() {}
func (q *QueryStoreCapturePolicyOption) queryStoreOption() {}
// QueryStoreSizeCleanupPolicyOption represents SIZE_BASED_CLEANUP_MODE option
type QueryStoreSizeCleanupPolicyOption struct {
OptionKind string // "Size_Based_Cleanup_Mode"
Value string // "OFF", "AUTO"
}
func (q *QueryStoreSizeCleanupPolicyOption) node() {}
func (q *QueryStoreSizeCleanupPolicyOption) queryStoreOption() {}
// QueryStoreIntervalLengthOption represents INTERVAL_LENGTH_MINUTES option
type QueryStoreIntervalLengthOption struct {
OptionKind string // "Interval_Length_Minutes"
StatsIntervalLength ScalarExpression // Integer literal
}
func (q *QueryStoreIntervalLengthOption) node() {}
func (q *QueryStoreIntervalLengthOption) queryStoreOption() {}
// QueryStoreMaxStorageSizeOption represents MAX_STORAGE_SIZE_MB option
type QueryStoreMaxStorageSizeOption struct {
OptionKind string // "Current_Storage_Size_MB" (note: uses Current_Storage_Size_MB as OptionKind)
MaxQdsSize ScalarExpression // Integer literal
}
func (q *QueryStoreMaxStorageSizeOption) node() {}
func (q *QueryStoreMaxStorageSizeOption) queryStoreOption() {}
// QueryStoreMaxPlansPerQueryOption represents MAX_PLANS_PER_QUERY option
type QueryStoreMaxPlansPerQueryOption struct {
OptionKind string // "Max_Plans_Per_Query"
MaxPlansPerQuery ScalarExpression // Integer literal
}
func (q *QueryStoreMaxPlansPerQueryOption) node() {}
func (q *QueryStoreMaxPlansPerQueryOption) queryStoreOption() {}
// QueryStoreTimeCleanupPolicyOption represents STALE_QUERY_THRESHOLD_DAYS option (in CLEANUP_POLICY)
type QueryStoreTimeCleanupPolicyOption struct {
OptionKind string // "Stale_Query_Threshold_Days"
StaleQueryThreshold ScalarExpression // Integer literal
}
func (q *QueryStoreTimeCleanupPolicyOption) node() {}
func (q *QueryStoreTimeCleanupPolicyOption) queryStoreOption() {}
// QueryStoreWaitStatsCaptureOption represents WAIT_STATS_CAPTURE_MODE option
type QueryStoreWaitStatsCaptureOption struct {
OptionKind string // "Wait_Stats_Capture_Mode"
OptionState string // "On", "Off"
}
func (q *QueryStoreWaitStatsCaptureOption) node() {}
func (q *QueryStoreWaitStatsCaptureOption) queryStoreOption() {}
// QueryStoreDataFlushIntervalOption represents FLUSH_INTERVAL_SECONDS/DATA_FLUSH_INTERVAL_SECONDS option
type QueryStoreDataFlushIntervalOption struct {
OptionKind string // "Flush_Interval_Seconds"
FlushInterval ScalarExpression // Integer literal
}
func (q *QueryStoreDataFlushIntervalOption) node() {}
func (q *QueryStoreDataFlushIntervalOption) queryStoreOption() {}
// AlterDatabaseScopedConfigurationSetStatement represents ALTER DATABASE SCOPED CONFIGURATION SET statement
type AlterDatabaseScopedConfigurationSetStatement struct {
Secondary bool
Option DatabaseConfigurationSetOption
}
func (a *AlterDatabaseScopedConfigurationSetStatement) node() {}
func (a *AlterDatabaseScopedConfigurationSetStatement) statement() {}
// DatabaseConfigurationSetOption is an interface for scoped configuration options
type DatabaseConfigurationSetOption interface {
Node
databaseConfigurationSetOption()
}
// MaxDopConfigurationOption represents MAXDOP configuration option
type MaxDopConfigurationOption struct {
OptionKind string // "MaxDop"
Value ScalarExpression // Integer value
Primary bool // true if set to PRIMARY
}
func (m *MaxDopConfigurationOption) node() {}
func (m *MaxDopConfigurationOption) databaseConfigurationSetOption() {}
// OnOffPrimaryConfigurationOption represents ON/OFF/PRIMARY configuration option
type OnOffPrimaryConfigurationOption struct {
OptionKind string // "LegacyCardinalityEstimate", "ParameterSniffing", "QueryOptimizerHotFixes"
OptionState string // "On", "Off", "Primary"
}
func (o *OnOffPrimaryConfigurationOption) node() {}
func (o *OnOffPrimaryConfigurationOption) databaseConfigurationSetOption() {}
// GenericConfigurationOption represents a generic configuration option
type GenericConfigurationOption struct {
OptionKind string // "MaxDop"
GenericOptionKind *Identifier // The custom option name
GenericOptionState *IdentifierOrScalarExpression // The value (identifier or scalar)
}
func (g *GenericConfigurationOption) node() {}
func (g *GenericConfigurationOption) databaseConfigurationSetOption() {}
// IdentifierOrScalarExpression represents either an identifier or a scalar expression
type IdentifierOrScalarExpression struct {
Identifier *Identifier
ScalarExpression ScalarExpression
}
func (i *IdentifierOrScalarExpression) node() {}