forked from xwb1989/sqlparser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconstants.go
1089 lines (964 loc) · 25.5 KB
/
constants.go
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
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Copyright 2019 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package sqlparser
import "vitess.io/vitess/go/mysql/datetime"
// String constants to be used in ast.
const (
// Select.Distinct
AllStr = "all "
DistinctStr = "distinct "
StraightJoinHint = "straight_join "
SQLCalcFoundRowsStr = "sql_calc_found_rows "
// Select.Lock
NoLockStr = ""
ForUpdateStr = " for update"
ForUpdateNoWaitStr = " for update nowait"
ForUpdateSkipLockedStr = " for update skip locked"
ForShareStr = " for share"
ForShareNoWaitStr = " for share nowait"
ForShareSkipLockedStr = " for share skip locked"
ShareModeStr = " lock in share mode"
// Select.Cache
SQLCacheStr = "sql_cache "
SQLNoCacheStr = "sql_no_cache "
// Union.Type
UnionStr = "union"
UnionAllStr = "union all"
UnionDistinctStr = "union distinct"
// DDL strings.
InsertStr = "insert"
ReplaceStr = "replace"
// Set.Scope or Show.Scope
SessionStr = "session"
GlobalStr = "global"
VitessMetadataStr = "vitess_metadata"
VariableStr = "variable"
// DDL strings.
CreateStr = "create"
AlterStr = "alter"
DeallocateStr = "deallocate"
DropStr = "drop"
RenameStr = "rename"
TruncateStr = "truncate"
FlushStr = "flush"
CreateVindexStr = "create vindex"
DropVindexStr = "drop vindex"
AddVschemaTableStr = "add vschema table"
DropVschemaTableStr = "drop vschema table"
AddColVindexStr = "on table add vindex"
DropColVindexStr = "on table drop vindex"
AddSequenceStr = "add sequence"
DropSequenceStr = "drop sequence"
AddAutoIncStr = "add auto_increment"
DropAutoIncStr = "drop auto_increment"
// ALTER TABLE ALGORITHM string.
DefaultStr = "default"
CopyStr = "copy"
InplaceStr = "inplace"
InstantStr = "instant"
// Partition and subpartition type strings
HashTypeStr = "hash"
KeyTypeStr = "key"
RangeTypeStr = "range"
ListTypeStr = "list"
// Partition value range type strings
LessThanTypeStr = "less than"
InTypeStr = "in"
// Online DDL hint
OnlineStr = "online"
// Vindex DDL param to specify the owner of a vindex
VindexOwnerStr = "owner"
// Partition strings
ReorganizeStr = "reorganize partition"
AddStr = "add partition"
DiscardStr = "discard partition"
DropPartitionStr = "drop partition"
ImportStr = "import partition"
TruncatePartitionStr = "truncate partition"
CoalesceStr = "coalesce partition"
ExchangeStr = "exchange partition"
AnalyzePartitionStr = "analyze partition"
CheckStr = "check partition"
OptimizeStr = "optimize partition"
RebuildStr = "rebuild partition"
RepairStr = "repair partition"
RemoveStr = "remove partitioning"
UpgradeStr = "upgrade partitioning"
// JoinTableExpr.Join
JoinStr = "join"
StraightJoinStr = "straight_join"
LeftJoinStr = "left join"
RightJoinStr = "right join"
NaturalJoinStr = "natural join"
NaturalLeftJoinStr = "natural left join"
NaturalRightJoinStr = "natural right join"
// IgnoreStr string.
IgnoreStr = "ignore "
// Index hints.
UseStr = "use index"
IgnoreIndexStr = "ignore index"
ForceStr = "force index"
UseVindexStr = "use vindex"
IgnoreVindexStr = "ignore vindex"
// Index hints For types.
JoinForStr = "join"
GroupByForStr = "group by"
OrderByForStr = "order by"
// Where.Type
WhereStr = "where"
HavingStr = "having"
// ComparisonExpr.Operator
EqualStr = "="
LessThanStr = "<"
GreaterThanStr = ">"
LessEqualStr = "<="
GreaterEqualStr = ">="
NotEqualStr = "!="
NullSafeEqualStr = "<=>"
InStr = "in"
NotInStr = "not in"
LikeStr = "like"
NotLikeStr = "not like"
RegexpStr = "regexp"
NotRegexpStr = "not regexp"
// IsExpr.Operator
IsNullStr = "is null"
IsNotNullStr = "is not null"
IsTrueStr = "is true"
IsNotTrueStr = "is not true"
IsFalseStr = "is false"
IsNotFalseStr = "is not false"
// BinaryExpr.Operator
BitAndStr = "&"
BitOrStr = "|"
BitXorStr = "^"
PlusStr = "+"
MinusStr = "-"
MultStr = "*"
DivStr = "/"
IntDivStr = "div"
ModStr = "%"
ShiftLeftStr = "<<"
ShiftRightStr = ">>"
JSONExtractOpStr = "->"
JSONUnquoteExtractOpStr = "->>"
// UnaryExpr.Operator
UPlusStr = "+"
UMinusStr = "-"
TildaStr = "~"
BangStr = "!"
Armscii8Str = "_armscii8"
ASCIIStr = "_ascii"
Big5Str = "_big5"
UBinaryStr = "_binary"
Cp1250Str = "_cp1250"
Cp1251Str = "_cp1251"
Cp1256Str = "_cp1256"
Cp1257Str = "_cp1257"
Cp850Str = "_cp850"
Cp852Str = "_cp852"
Cp866Str = "_cp866"
Cp932Str = "_cp932"
Dec8Str = "_dec8"
EucjpmsStr = "_eucjpms"
EuckrStr = "_euckr"
Gb18030Str = "_gb18030"
Gb2312Str = "_gb2312"
GbkStr = "_gbk"
Geostd8Str = "_geostd8"
GreekStr = "_greek"
HebrewStr = "_hebrew"
Hp8Str = "_hp8"
Keybcs2Str = "_keybcs2"
Koi8rStr = "_koi8r"
Koi8uStr = "_koi8u"
Latin1Str = "_latin1"
Latin2Str = "_latin2"
Latin5Str = "_latin5"
Latin7Str = "_latin7"
MacceStr = "_macce"
MacromanStr = "_macroman"
SjisStr = "_sjis"
Swe7Str = "_swe7"
Tis620Str = "_tis620"
Ucs2Str = "_ucs2"
UjisStr = "_ujis"
Utf16Str = "_utf16"
Utf16leStr = "_utf16le"
Utf32Str = "_utf32"
Utf8mb3Str = "_utf8mb3"
Utf8mb4Str = "_utf8mb4"
NStringStr = "N"
// DatabaseOption.Type
CharacterSetStr = " character set"
CollateStr = " collate"
EncryptionStr = " encryption"
// MatchExpr.Option
NoOptionStr = ""
BooleanModeStr = " in boolean mode"
NaturalLanguageModeStr = " in natural language mode"
NaturalLanguageModeWithQueryExpansionStr = " in natural language mode with query expansion"
QueryExpansionStr = " with query expansion"
// INTO OUTFILE
IntoOutfileStr = " into outfile "
IntoOutfileS3Str = " into outfile s3 "
IntoDumpfileStr = " into dumpfile "
// Order.Direction
AscScr = "asc"
DescScr = "desc"
// SetExpr.Expr transaction variables
TransactionIsolationStr = "transaction_isolation"
TransactionReadOnlyStr = "transaction_read_only"
// Transaction isolation levels
ReadUncommittedStr = "read-uncommitted"
ReadCommittedStr = "read-committed"
RepeatableReadStr = "repeatable-read"
SerializableStr = "serializable"
// Transaction access mode
WithConsistentSnapshotStr = "with consistent snapshot"
ReadWriteStr = "read write"
ReadOnlyStr = "read only"
// Explain formats
EmptyStr = ""
TreeStr = "tree"
JSONStr = "json"
TraditionalStr = "traditional"
AnalyzeStr = "analyze"
QueriesStr = "queries"
AllVExplainStr = "all"
PlanStr = "plan"
// Lock Types
ReadStr = "read"
ReadLocalStr = "read local"
WriteStr = "write"
LowPriorityWriteStr = "low_priority write"
// ShowCommand Types
CharsetStr = " charset"
CollationStr = " collation"
ColumnStr = " columns"
CreateDbStr = " create database"
CreateEStr = " create event"
CreateFStr = " create function"
CreateProcStr = " create procedure"
CreateTblStr = " create table"
CreateTrStr = " create trigger"
CreateVStr = " create view"
DatabaseStr = " databases"
EnginesStr = " engines"
FunctionCStr = " function code"
FunctionStr = " function status"
GtidExecGlobalStr = " global gtid_executed"
IndexStr = " indexes"
OpenTableStr = " open tables"
PluginsStr = " plugins"
PrivilegeStr = " privileges"
ProcedureCStr = " procedure code"
ProcedureStr = " procedure status"
StatusGlobalStr = " global status"
StatusSessionStr = " status"
TablesStr = " tables"
TableStatusStr = " table status"
TriggerStr = " triggers"
VariableGlobalStr = " global variables"
VariableSessionStr = " variables"
VGtidExecGlobalStr = " global vgtid_executed"
KeyspaceStr = " keyspaces"
VitessMigrationsStr = " vitess_migrations"
VitessReplicationStatusStr = " vitess_replication_status"
VitessShardsStr = " vitess_shards"
VitessTabletsStr = " vitess_tablets"
VitessTargetStr = " vitess_target"
VitessVariablesStr = " vitess_metadata variables"
VschemaTablesStr = " vschema tables"
VschemaKeyspacesStr = " vschema keyspaces"
VschemaVindexesStr = " vschema vindexes"
WarningsStr = " warnings"
// DropKeyType strings
PrimaryKeyTypeStr = "primary key"
ForeignKeyTypeStr = "foreign key"
NormalKeyTypeStr = "key"
CheckKeyTypeStr = "check"
// TrimType strings
BothTrimStr = "both"
LeadingTrimStr = "leading"
TrailingTrimStr = "trailing"
// FrameUnitType strings
FrameRowsStr = "rows"
FrameRangeStr = "range"
// FramePointType strings
CurrentRowStr = "current row"
UnboundedPrecedingStr = "unbounded preceding"
UnboundedFollowingStr = "unbounded following"
ExprPrecedingStr = "preceding"
ExprFollowingStr = "following"
// ArgumentLessWindowExprType strings
CumeDistExprStr = "cume_dist"
DenseRankExprStr = "dense_rank"
PercentRankExprStr = "percent_rank"
RankExprStr = "rank"
RowNumberExprStr = "row_number"
// NullTreatmentType strings
RespectNullsStr = "respect nulls"
IgnoreNullsStr = "ignore nulls"
// FromFirstLastType strings
FromFirstStr = "respect nulls"
FromLastStr = "ignore nulls"
// FirstOrLastValueExprType strings
FirstValueExprStr = "first_value"
LastValueExprStr = "last_value"
// FirstOrLastValueExprType strings
LagExprStr = "lag"
LeadExprStr = "lead"
// TrimFuncType strings
NormalTrimStr = "trim"
LTrimStr = "ltrim"
RTrimStr = "rtrim"
// JSONAttributeType strings
DepthAttributeStr = "json_depth"
ValidAttributeStr = "json_valid"
TypeAttributeStr = "json_type"
LengthAttributeStr = "json_length"
// JSONValueModifierType strings
JSONArrayAppendStr = "json_array_append"
JSONArrayInsertStr = "json_array_insert"
JSONInsertStr = "json_insert"
JSONReplaceStr = "json_replace"
JSONSetStr = "json_set"
// JSONValueMergeType strings
JSONMergeStr = "json_merge"
JSONMergePatchStr = "json_merge_patch"
JSONMergePreserveStr = "json_merge_preserve"
// LockingFuncType strings
GetLockStr = "get_lock"
IsFreeLockStr = "is_free_lock"
IsUsedLockStr = "is_used_lock"
ReleaseAllLocksStr = "release_all_locks"
ReleaseLockStr = "release_lock"
// PerformanceSchemaType strings
FormatBytesStr = "format_bytes"
FormatPicoTimeStr = "format_pico_time"
PsCurrentThreadIDStr = "ps_current_thread_id"
PsThreadIDStr = "ps_thread_id"
// GTIDType strings
GTIDSubsetStr = "gtid_subset"
GTIDSubtractStr = "gtid_subtract"
WaitForExecutedGTIDSetStr = "wait_for_executed_gtid_set"
WaitUntilSQLThreadAfterGTIDSStr = "wait_until_sql_thread_after_gtids"
// LockOptionType strings
NoneTypeStr = "none"
SharedTypeStr = "shared"
DefaultTypeStr = "default"
ExclusiveTypeStr = "exclusive"
// GeomeFromWktType strings
GeometryFromTextStr = "st_geometryfromtext"
GeometryCollectionFromTextStr = "st_geometrycollectionfromtext"
PointFromTextStr = "st_pointfromtext"
MultiPointFromTextStr = "st_multipointfromtext"
LineStringFromTextStr = "st_linestringfromtext"
MultiLinestringFromTextStr = "st_multilinestringfromtext"
PolygonFromTextStr = "st_polygonfromtext"
MultiPolygonFromTextStr = "st_multipolygonfromtext"
// GeomeFromWktType strings
GeometryFromWKBStr = "st_geometryfromwkb"
GeometryCollectionFromWKBStr = "st_geometrycollectionfromwkb"
PointFromWKBStr = "st_pointfromwkb"
MultiPointFromWKBStr = "st_multipointfromwkb"
LineStringFromWKBStr = "st_linestringfromwkb"
MultiLinestringFromWKBStr = "st_multilinestringfromwkb"
PolygonFromWKBStr = "st_polygonfromwkb"
MultiPolygonFromWKBStr = "st_multipolygonfromwkb"
// GeomFormatExpr strings
TextFormatStr = "st_astext"
BinaryFormatStr = "st_asbinary"
// GeomPropertyType strings
IsSimpleStr = "st_issimple"
IsEmptyStr = "st_isempty"
EnvelopeStr = "st_envelope"
DimensionStr = "st_dimension"
GeometryTypeStr = "st_geometrytype"
// PointPropertyType strings
XCordinateStr = "st_x"
YCordinateStr = "st_y"
LatitudeStr = "st_latitude"
LongitudeStr = "st_longitude"
// LinestringPropertyType strings
EndPointStr = "st_endpoint"
IsClosedStr = "st_isclosed"
LengthStr = "st_length"
NumPointsStr = "st_numpoints"
PointNStr = "st_pointn"
StartPointStr = "st_startpoint"
// PolygonPropertyType strings
AreaStr = "st_area"
CentroidStr = "st_centroid"
ExteriorRingStr = "st_exteriorring"
InteriorRingNStr = "st_interiorringN"
NumInteriorRingsStr = "st_numinteriorrings"
// GeomCollPropType strings
NumGeometriesStr = "st_numgeometries"
GeometryNStr = "st_geometryn"
// GeomFromGeoHash strings
LatitudeFromHashStr = "st_latfromgeohash"
LongitudeFromHashStr = "st_longfromgeohash"
PointFromHashStr = "st_pointfromgeohash"
// KillType strings
ConnectionStr = "connection"
QueryStr = "query"
)
// Constants for Enum Type - Insert.Action
const (
InsertAct InsertAction = iota
ReplaceAct
)
// Constants for Enum Type - DDL.Action
const (
CreateDDLAction DDLAction = iota
AlterDDLAction
DropDDLAction
RenameDDLAction
TruncateDDLAction
CreateVindexDDLAction
DropVindexDDLAction
AddVschemaTableDDLAction
DropVschemaTableDDLAction
AddColVindexDDLAction
DropColVindexDDLAction
AddSequenceDDLAction
DropSequenceDDLAction
AddAutoIncDDLAction
DropAutoIncDDLAction
RevertDDLAction
)
// Constants for scope of variables
// See https://dev.mysql.com/doc/refman/8.0/en/set-variable.html
const (
NoScope Scope = iota
SessionScope // [SESSION | @@SESSION.| @@LOCAL. | @@] This is the default if no scope is given
GlobalScope // {GLOBAL | @@GLOBAL.} system_var_name
VitessMetadataScope // @@vitess_metadata.system_var_name
PersistSysScope // {PERSIST_ONLY | @@PERSIST_ONLY.} system_var_name
PersistOnlySysScope // {PERSIST_ONLY | @@PERSIST_ONLY.} system_var_name
VariableScope // @var_name This is used for user defined variables.
NextTxScope // This is used for transaction related variables like transaction_isolation, transaction_read_write and set transaction statement.
)
// Constants for Enum Type - Lock
const (
NoLock Lock = iota
ShareModeLock
ForShareLock
ForShareLockNoWait
ForShareLockSkipLocked
ForUpdateLock
ForUpdateLockNoWait
ForUpdateLockSkipLocked
)
// Constants for Enum Type - TrimType
const (
NoTrimType TrimType = iota
BothTrimType
LeadingTrimType
TrailingTrimType
)
// Constants for Enum Type - TrimFuncType
const (
NormalTrimType TrimFuncType = iota
LTrimType
RTrimType
)
// Constants for Enum Type - FrameUnitType
const (
FrameRowsType FrameUnitType = iota
FrameRangeType
)
// Constants for Enum Type - FramePointType
const (
CurrentRowType FramePointType = iota
UnboundedPrecedingType
UnboundedFollowingType
ExprPrecedingType
ExprFollowingType
)
// Constants for Enum Type - ArgumentLessWindowExprType
const (
CumeDistExprType ArgumentLessWindowExprType = iota
DenseRankExprType
PercentRankExprType
RankExprType
RowNumberExprType
)
// Constants for Enum Type - NullTreatmentType
const (
RespectNullsType NullTreatmentType = iota
IgnoreNullsType
)
// Constants for Enum Type - FromFirstLastType
const (
FromFirstType FromFirstLastType = iota
FromLastType
)
// Constants for Enum Type - FirstOrLastValueExprType
const (
FirstValueExprType FirstOrLastValueExprType = iota
LastValueExprType
)
// Constants for Enum Type - FirstOrLastValueExprType
const (
LagExprType LagLeadExprType = iota
LeadExprType
)
// Constants for Enum Type - JSONAttributeType
const (
DepthAttributeType JSONAttributeType = iota
ValidAttributeType
TypeAttributeType
LengthAttributeType
)
// Constants for Enum Type - JSONValueModifierType
const (
JSONArrayAppendType JSONValueModifierType = iota
JSONArrayInsertType
JSONInsertType
JSONReplaceType
JSONSetType
)
// Constants for Enum Type - JSONValueMergeType
const (
JSONMergeType JSONValueMergeType = iota
JSONMergePatchType
JSONMergePreserveType
)
// Constants for Enum Type - LockingFuncType
const (
GetLock LockingFuncType = iota
IsFreeLock
IsUsedLock
ReleaseAllLocks
ReleaseLock
)
// Constants for Enum Type - PerformanceSchemaType
const (
FormatBytesType PerformanceSchemaType = iota
FormatPicoTimeType
PsCurrentThreadIDType
PsThreadIDType
)
// Constants for Enum Type - GTIDType
const (
GTIDSubsetType GTIDType = iota
GTIDSubtractType
WaitForExecutedGTIDSetType
WaitUntilSQLThreadAfterGTIDSType
)
// Constants for Enum Type - WhereType
const (
WhereClause WhereType = iota
HavingClause
)
// Constants for Enum Type - JoinType
const (
NormalJoinType JoinType = iota
StraightJoinType
LeftJoinType
RightJoinType
NaturalJoinType
NaturalLeftJoinType
NaturalRightJoinType
)
// Constants for Enum Type - ComparisonExprOperator
const (
EqualOp ComparisonExprOperator = iota
LessThanOp
GreaterThanOp
LessEqualOp
GreaterEqualOp
NotEqualOp
NullSafeEqualOp
InOp
NotInOp
LikeOp
NotLikeOp
RegexpOp
NotRegexpOp
)
func Inverse(in ComparisonExprOperator) ComparisonExprOperator {
switch in {
case EqualOp:
return NotEqualOp
case LessThanOp:
return GreaterEqualOp
case GreaterThanOp:
return LessEqualOp
case LessEqualOp:
return GreaterThanOp
case GreaterEqualOp:
return LessThanOp
case NotEqualOp:
return EqualOp
case NullSafeEqualOp:
return NotEqualOp
case InOp:
return NotInOp
case NotInOp:
return InOp
case LikeOp:
return NotLikeOp
case NotLikeOp:
return LikeOp
case RegexpOp:
return NotRegexpOp
case NotRegexpOp:
return RegexpOp
}
panic("unreachable")
}
// Constant for Enum Type - IsExprOperator
const (
IsNullOp IsExprOperator = iota
IsNotNullOp
IsTrueOp
IsNotTrueOp
IsFalseOp
IsNotFalseOp
)
// Constant for Enum Type - BinaryExprOperator
const (
BitAndOp BinaryExprOperator = iota
BitOrOp
BitXorOp
PlusOp
MinusOp
MultOp
DivOp
IntDivOp
ModOp
ShiftLeftOp
ShiftRightOp
JSONExtractOp
JSONUnquoteExtractOp
)
// Constant for Enum Type - UnaryExprOperator
const (
UPlusOp UnaryExprOperator = iota
UMinusOp
TildaOp
BangOp
NStringOp
)
// Constant for Enum Type - MatchExprOption
const (
NoOption MatchExprOption = iota
BooleanModeOpt
NaturalLanguageModeOpt
NaturalLanguageModeWithQueryExpansionOpt
QueryExpansionOpt
)
// Constant for Enum Type - OrderDirection
const (
AscOrder OrderDirection = iota
DescOrder
)
// Constant for Enum Type - IndexHintType
const (
UseOp IndexHintType = iota
IgnoreOp
ForceOp
UseVindexOp
IgnoreVindexOp
)
// Constant for Enum Type - IndexHintForType
const (
NoForType IndexHintForType = iota
JoinForType
GroupByForType
OrderByForType
)
// Constant for Enum Type - PartitionSpecAction
const (
ReorganizeAction PartitionSpecAction = iota
AddAction
DiscardAction
DropAction
ImportAction
TruncateAction
CoalesceAction
ExchangeAction
AnalyzeAction
CheckAction
OptimizeAction
RebuildAction
RepairAction
RemoveAction
UpgradeAction
)
// Constant for Enum Type - PartitionByType
const (
HashType PartitionByType = iota
KeyType
RangeType
ListType
)
// Constant for Enum Type - PartitionValueRangeType
const (
LessThanType PartitionValueRangeType = iota
InType
)
// Constant for Enum Type - ExplainType
const (
EmptyType ExplainType = iota
TreeType
JSONType
TraditionalType
AnalyzeType
)
// Constant for Enum Type - VExplainType
const (
QueriesVExplainType VExplainType = iota
PlanVExplainType
AllVExplainType
)
// Constant for Enum Type - SelectIntoType
const (
IntoOutfile SelectIntoType = iota
IntoOutfileS3
IntoDumpfile
)
// Constant for Enum Type - JtOnResponseType
const (
ErrorJSONType JtOnResponseType = iota
NullJSONType
DefaultJSONType
)
// Constant for Enum Type - DatabaseOptionType
const (
CollateType DatabaseOptionType = iota
CharacterSetType
EncryptionType
)
// LockType constants
const (
UnknownLockType LockType = iota
Read
ReadLocal
Write
LowPriorityWrite
)
// ShowCommandType constants
const (
UnknownCommandType ShowCommandType = iota
Charset
Collation
Column
CreateDb
CreateE
CreateF
CreateProc
CreateTbl
CreateTr
CreateV
Database
Engines
FunctionC
Function
GtidExecGlobal
Index
OpenTable
Plugins
Privilege
ProcedureC
Procedure
StatusGlobal
StatusSession
Table
TableStatus
Trigger
VariableGlobal
VariableSession
VGtidExecGlobal
VitessMigrations
VitessReplicationStatus
VitessShards
VitessTablets
VitessTarget
VitessVariables
VschemaTables
VschemaKeyspaces
VschemaVindexes
Warnings
Keyspace
)
// DropKeyType constants
const (
PrimaryKeyType DropKeyType = iota
ForeignKeyType
NormalKeyType
CheckKeyType
)
// LockOptionType constants
const (
DefaultType LockOptionType = iota
NoneType
SharedType
ExclusiveType
)
// AlterMigrationType constants
const (
RetryMigrationType AlterMigrationType = iota
LaunchMigrationType
LaunchAllMigrationType
CompleteMigrationType
CompleteAllMigrationType
CancelMigrationType
CancelAllMigrationType
CleanupMigrationType
ThrottleMigrationType
ThrottleAllMigrationType
UnthrottleMigrationType
UnthrottleAllMigrationType
ForceCutOverMigrationType
ForceCutOverAllMigrationType
)
// ColumnStorage constants
const (
VirtualStorage ColumnStorage = iota
StoredStorage
)
// ColumnFormat constants
const (
UnspecifiedFormat ColumnFormat = iota
FixedFormat
DynamicFormat
DefaultFormat
)
// Transaction access mode
const (
WithConsistentSnapshot TxAccessMode = iota
ReadWrite
ReadOnly
)
// Enum Types of WKT functions
const (
GeometryFromText GeomFromWktType = iota
GeometryCollectionFromText
PointFromText
LineStringFromText
PolygonFromText
MultiPointFromText
MultiPolygonFromText
MultiLinestringFromText
)
// Enum Types of WKT functions
const (
GeometryFromWKB GeomFromWkbType = iota
GeometryCollectionFromWKB
PointFromWKB
LineStringFromWKB
PolygonFromWKB
MultiPointFromWKB
MultiPolygonFromWKB
MultiLinestringFromWKB
)
// Enum Types of spatial format functions
const (
TextFormat GeomFormatType = iota
BinaryFormat
)
// Enum Types of spatial property functions
const (
IsSimple GeomPropertyType = iota
IsEmpty
Dimension
GeometryType
Envelope
)
// Enum Types of point property functions
const (
XCordinate PointPropertyType = iota