github.com/vedadiyan/sqlparser@v1.0.0/pkg/sqlparser/constants.go (about)

     1  /*
     2  Copyright 2019 The Vitess Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package sqlparser
    18  
    19  // String constants to be used in ast.
    20  const (
    21  	// Select.Distinct
    22  	AllStr              = "all "
    23  	DistinctStr         = "distinct "
    24  	StraightJoinHint    = "straight_join "
    25  	SQLCalcFoundRowsStr = "sql_calc_found_rows "
    26  
    27  	// Select.Lock
    28  	NoLockStr    = ""
    29  	ForUpdateStr = " for update"
    30  	ShareModeStr = " lock in share mode"
    31  
    32  	// Select.Cache
    33  	SQLCacheStr   = "sql_cache "
    34  	SQLNoCacheStr = "sql_no_cache "
    35  
    36  	// Union.Type
    37  	UnionStr         = "union"
    38  	UnionAllStr      = "union all"
    39  	UnionDistinctStr = "union distinct"
    40  
    41  	// DDL strings.
    42  	InsertStr  = "insert"
    43  	ReplaceStr = "replace"
    44  
    45  	// Set.Scope or Show.Scope
    46  	SessionStr        = "session"
    47  	GlobalStr         = "global"
    48  	VitessMetadataStr = "vitess_metadata"
    49  	VariableStr       = "variable"
    50  
    51  	// DDL strings.
    52  	CreateStr           = "create"
    53  	AlterStr            = "alter"
    54  	DeallocateStr       = "deallocate"
    55  	DropStr             = "drop"
    56  	RenameStr           = "rename"
    57  	TruncateStr         = "truncate"
    58  	FlushStr            = "flush"
    59  	CreateVindexStr     = "create vindex"
    60  	DropVindexStr       = "drop vindex"
    61  	AddVschemaTableStr  = "add vschema table"
    62  	DropVschemaTableStr = "drop vschema table"
    63  	AddColVindexStr     = "on table add vindex"
    64  	DropColVindexStr    = "on table drop vindex"
    65  	AddSequenceStr      = "add sequence"
    66  	AddAutoIncStr       = "add auto_increment"
    67  
    68  	// Partition and subpartition type strings
    69  	HashTypeStr  = "hash"
    70  	KeyTypeStr   = "key"
    71  	RangeTypeStr = "range"
    72  	ListTypeStr  = "list"
    73  
    74  	// Partition value range type strings
    75  	LessThanTypeStr = "less than"
    76  	InTypeStr       = "in"
    77  
    78  	// Online DDL hint
    79  	OnlineStr = "online"
    80  
    81  	// Vindex DDL param to specify the owner of a vindex
    82  	VindexOwnerStr = "owner"
    83  
    84  	// Partition strings
    85  	ReorganizeStr        = "reorganize partition"
    86  	AddStr               = "add partition"
    87  	DiscardStr           = "discard partition"
    88  	DropPartitionStr     = "drop partition"
    89  	ImportStr            = "import partition"
    90  	TruncatePartitionStr = "truncate partition"
    91  	CoalesceStr          = "coalesce partition"
    92  	ExchangeStr          = "exchange partition"
    93  	AnalyzePartitionStr  = "analyze partition"
    94  	CheckStr             = "check partition"
    95  	OptimizeStr          = "optimize partition"
    96  	RebuildStr           = "rebuild partition"
    97  	RepairStr            = "repair partition"
    98  	RemoveStr            = "remove partitioning"
    99  	UpgradeStr           = "upgrade partitioning"
   100  
   101  	// JoinTableExpr.Join
   102  	JoinStr             = "join"
   103  	StraightJoinStr     = "straight_join"
   104  	LeftJoinStr         = "left join"
   105  	RightJoinStr        = "right join"
   106  	NaturalJoinStr      = "natural join"
   107  	NaturalLeftJoinStr  = "natural left join"
   108  	NaturalRightJoinStr = "natural right join"
   109  
   110  	// Index hints.
   111  	UseStr    = "use "
   112  	IgnoreStr = "ignore "
   113  	ForceStr  = "force "
   114  
   115  	// Index hints For types.
   116  	JoinForStr    = "join"
   117  	GroupByForStr = "group by"
   118  	OrderByForStr = "order by"
   119  
   120  	// Where.Type
   121  	WhereStr  = "where"
   122  	HavingStr = "having"
   123  
   124  	// ComparisonExpr.Operator
   125  	EqualStr         = "="
   126  	LessThanStr      = "<"
   127  	GreaterThanStr   = ">"
   128  	LessEqualStr     = "<="
   129  	GreaterEqualStr  = ">="
   130  	NotEqualStr      = "!="
   131  	NullSafeEqualStr = "<=>"
   132  	InStr            = "in"
   133  	NotInStr         = "not in"
   134  	LikeStr          = "like"
   135  	NotLikeStr       = "not like"
   136  	RegexpStr        = "regexp"
   137  	NotRegexpStr     = "not regexp"
   138  
   139  	// IsExpr.Operator
   140  	IsNullStr     = "is null"
   141  	IsNotNullStr  = "is not null"
   142  	IsTrueStr     = "is true"
   143  	IsNotTrueStr  = "is not true"
   144  	IsFalseStr    = "is false"
   145  	IsNotFalseStr = "is not false"
   146  
   147  	// BinaryExpr.Operator
   148  	BitAndStr               = "&"
   149  	BitOrStr                = "|"
   150  	BitXorStr               = "^"
   151  	PlusStr                 = "+"
   152  	MinusStr                = "-"
   153  	MultStr                 = "*"
   154  	DivStr                  = "/"
   155  	IntDivStr               = "div"
   156  	ModStr                  = "%"
   157  	ShiftLeftStr            = "<<"
   158  	ShiftRightStr           = ">>"
   159  	JSONExtractOpStr        = "->"
   160  	JSONUnquoteExtractOpStr = "->>"
   161  
   162  	// UnaryExpr.Operator
   163  	UPlusStr    = "+"
   164  	UMinusStr   = "-"
   165  	TildaStr    = "~"
   166  	BangStr     = "!"
   167  	Armscii8Str = "_armscii8"
   168  	ASCIIStr    = "_ascii"
   169  	Big5Str     = "_big5"
   170  	UBinaryStr  = "_binary"
   171  	Cp1250Str   = "_cp1250"
   172  	Cp1251Str   = "_cp1251"
   173  	Cp1256Str   = "_cp1256"
   174  	Cp1257Str   = "_cp1257"
   175  	Cp850Str    = "_cp850"
   176  	Cp852Str    = "_cp852"
   177  	Cp866Str    = "_cp866"
   178  	Cp932Str    = "_cp932"
   179  	Dec8Str     = "_dec8"
   180  	EucjpmsStr  = "_eucjpms"
   181  	EuckrStr    = "_euckr"
   182  	Gb18030Str  = "_gb18030"
   183  	Gb2312Str   = "_gb2312"
   184  	GbkStr      = "_gbk"
   185  	Geostd8Str  = "_geostd8"
   186  	GreekStr    = "_greek"
   187  	HebrewStr   = "_hebrew"
   188  	Hp8Str      = "_hp8"
   189  	Keybcs2Str  = "_keybcs2"
   190  	Koi8rStr    = "_koi8r"
   191  	Koi8uStr    = "_koi8u"
   192  	Latin1Str   = "_latin1"
   193  	Latin2Str   = "_latin2"
   194  	Latin5Str   = "_latin5"
   195  	Latin7Str   = "_latin7"
   196  	MacceStr    = "_macce"
   197  	MacromanStr = "_macroman"
   198  	SjisStr     = "_sjis"
   199  	Swe7Str     = "_swe7"
   200  	Tis620Str   = "_tis620"
   201  	Ucs2Str     = "_ucs2"
   202  	UjisStr     = "_ujis"
   203  	Utf16Str    = "_utf16"
   204  	Utf16leStr  = "_utf16le"
   205  	Utf32Str    = "_utf32"
   206  	Utf8Str     = "_utf8"
   207  	Utf8mb4Str  = "_utf8mb4"
   208  	NStringStr  = "N"
   209  
   210  	// DatabaseOption.Type
   211  	CharacterSetStr = " character set"
   212  	CollateStr      = " collate"
   213  	EncryptionStr   = " encryption"
   214  
   215  	// MatchExpr.Option
   216  	NoOptionStr                              = ""
   217  	BooleanModeStr                           = " in boolean mode"
   218  	NaturalLanguageModeStr                   = " in natural language mode"
   219  	NaturalLanguageModeWithQueryExpansionStr = " in natural language mode with query expansion"
   220  	QueryExpansionStr                        = " with query expansion"
   221  
   222  	// INTO OUTFILE
   223  	IntoOutfileStr   = " into outfile "
   224  	IntoOutfileS3Str = " into outfile s3 "
   225  	IntoDumpfileStr  = " into dumpfile "
   226  
   227  	// Order.Direction
   228  	AscScr  = "asc"
   229  	DescScr = "desc"
   230  
   231  	// SetExpr.Expr transaction variables
   232  	TransactionIsolationStr = "transaction_isolation"
   233  	TransactionReadOnlyStr  = "transaction_read_only"
   234  
   235  	// Transaction isolation levels
   236  	ReadUncommittedStr = "read-uncommitted"
   237  	ReadCommittedStr   = "read-committed"
   238  	RepeatableReadStr  = "repeatable-read"
   239  	SerializableStr    = "serializable"
   240  
   241  	// Transaction access mode
   242  	WithConsistentSnapshotStr = "with consistent snapshot"
   243  	ReadWriteStr              = "read write"
   244  	ReadOnlyStr               = "read only"
   245  
   246  	// Explain formats
   247  	EmptyStr       = ""
   248  	TreeStr        = "tree"
   249  	JSONStr        = "json"
   250  	VitessStr      = "vitess"
   251  	TraditionalStr = "traditional"
   252  	AnalyzeStr     = "analyze"
   253  	VTExplainStr   = "vtexplain"
   254  	QueriesStr     = "queries"
   255  	AllVExplainStr = "all"
   256  	PlanStr        = "plan"
   257  
   258  	// Lock Types
   259  	ReadStr             = "read"
   260  	ReadLocalStr        = "read local"
   261  	WriteStr            = "write"
   262  	LowPriorityWriteStr = "low_priority write"
   263  
   264  	// ShowCommand Types
   265  	CharsetStr                 = " charset"
   266  	CollationStr               = " collation"
   267  	ColumnStr                  = " columns"
   268  	CreateDbStr                = " create database"
   269  	CreateEStr                 = " create event"
   270  	CreateFStr                 = " create function"
   271  	CreateProcStr              = " create procedure"
   272  	CreateTblStr               = " create table"
   273  	CreateTrStr                = " create trigger"
   274  	CreateVStr                 = " create view"
   275  	DatabaseStr                = " databases"
   276  	EnginesStr                 = " engines"
   277  	FunctionCStr               = " function code"
   278  	FunctionStr                = " function status"
   279  	GtidExecGlobalStr          = " global gtid_executed"
   280  	IndexStr                   = " indexes"
   281  	OpenTableStr               = " open tables"
   282  	PluginsStr                 = " plugins"
   283  	PrivilegeStr               = " privileges"
   284  	ProcedureCStr              = " procedure code"
   285  	ProcedureStr               = " procedure status"
   286  	StatusGlobalStr            = " global status"
   287  	StatusSessionStr           = " status"
   288  	TablesStr                  = " tables"
   289  	TableStatusStr             = " table status"
   290  	TriggerStr                 = " triggers"
   291  	VariableGlobalStr          = " global variables"
   292  	VariableSessionStr         = " variables"
   293  	VGtidExecGlobalStr         = " global vgtid_executed"
   294  	KeyspaceStr                = " keyspaces"
   295  	VitessMigrationsStr        = " vitess_migrations"
   296  	VitessReplicationStatusStr = " vitess_replication_status"
   297  	VitessShardsStr            = " vitess_shards"
   298  	VitessTabletsStr           = " vitess_tablets"
   299  	VitessTargetStr            = " vitess_target"
   300  	VitessVariablesStr         = " vitess_metadata variables"
   301  	VschemaTablesStr           = " vschema tables"
   302  	VschemaVindexesStr         = " vschema vindexes"
   303  	WarningsStr                = " warnings"
   304  
   305  	// DropKeyType strings
   306  	PrimaryKeyTypeStr = "primary key"
   307  	ForeignKeyTypeStr = "foreign key"
   308  	NormalKeyTypeStr  = "key"
   309  	CheckKeyTypeStr   = "check"
   310  
   311  	// TrimType strings
   312  	BothTrimStr     = "both"
   313  	LeadingTrimStr  = "leading"
   314  	TrailingTrimStr = "trailing"
   315  
   316  	// FrameUnitType strings
   317  	FrameRowsStr  = "rows"
   318  	FrameRangeStr = "range"
   319  
   320  	// FramePointType strings
   321  	CurrentRowStr         = "current row"
   322  	UnboundedPrecedingStr = "unbounded preceding"
   323  	UnboundedFollowingStr = "unbounded following"
   324  	ExprPrecedingStr      = "preceding"
   325  	ExprFollowingStr      = "following"
   326  
   327  	// ArgumentLessWindowExprType strings
   328  	CumeDistExprStr    = "cume_dist"
   329  	DenseRankExprStr   = "dense_rank"
   330  	PercentRankExprStr = "percent_rank"
   331  	RankExprStr        = "rank"
   332  	RowNumberExprStr   = "row_number"
   333  
   334  	// NullTreatmentType strings
   335  	RespectNullsStr = "respect nulls"
   336  	IgnoreNullsStr  = "ignore nulls"
   337  
   338  	// FromFirstLastType strings
   339  	FromFirstStr = "respect nulls"
   340  	FromLastStr  = "ignore nulls"
   341  
   342  	// FirstOrLastValueExprType strings
   343  	FirstValueExprStr = "first_value"
   344  	LastValueExprStr  = "last_value"
   345  
   346  	// FirstOrLastValueExprType strings
   347  	LagExprStr  = "lag"
   348  	LeadExprStr = "lead"
   349  
   350  	// TrimFuncType strings
   351  	NormalTrimStr = "trim"
   352  	LTrimStr      = "ltrim"
   353  	RTrimStr      = "rtrim"
   354  
   355  	// JSONAttributeType strings
   356  	DepthAttributeStr  = "json_depth"
   357  	ValidAttributeStr  = "json_valid"
   358  	TypeAttributeStr   = "json_type"
   359  	LengthAttributeStr = "json_length"
   360  
   361  	// JSONValueModifierType strings
   362  	JSONArrayAppendStr = "json_array_append"
   363  	JSONArrayInsertStr = "json_array_insert"
   364  	JSONInsertStr      = "json_insert"
   365  	JSONReplaceStr     = "json_replace"
   366  	JSONSetStr         = "json_set"
   367  
   368  	// JSONValueMergeType strings
   369  	JSONMergeStr         = "json_merge"
   370  	JSONMergePatchStr    = "json_merge_patch"
   371  	JSONMergePreserveStr = "json_merge_preserve"
   372  
   373  	// LockingFuncType strings
   374  	GetLockStr         = "get_lock"
   375  	IsFreeLockStr      = "is_free_lock"
   376  	IsUsedLockStr      = "is_used_lock"
   377  	ReleaseAllLocksStr = "release_all_locks"
   378  	ReleaseLockStr     = "release_lock"
   379  
   380  	// PerformanceSchemaType strings
   381  	FormatBytesStr       = "format_bytes"
   382  	FormatPicoTimeStr    = "format_pico_time"
   383  	PsCurrentThreadIDStr = "ps_current_thread_id"
   384  	PsThreadIDStr        = "ps_thread_id"
   385  
   386  	// GTIDType strings
   387  	GTIDSubsetStr                   = "gtid_subset"
   388  	GTIDSubtractStr                 = "gtid_subtract"
   389  	WaitForExecutedGTIDSetStr       = "wait_for_executed_gtid_set"
   390  	WaitUntilSQLThreadAfterGTIDSStr = "wait_until_sql_thread_after_gtids"
   391  
   392  	// LockOptionType strings
   393  	NoneTypeStr      = "none"
   394  	SharedTypeStr    = "shared"
   395  	DefaultTypeStr   = "default"
   396  	ExclusiveTypeStr = "exclusive"
   397  
   398  	// IntervalTypes strings
   399  	DayStr               = "day"
   400  	WeekStr              = "week"
   401  	MonthStr             = "month"
   402  	YearStr              = "year"
   403  	DayHourStr           = "day_hour"
   404  	DayMicrosecondStr    = "day_microsecond"
   405  	DayMinuteStr         = "day_minute"
   406  	DaySecondStr         = "day_second"
   407  	HourStr              = "hour"
   408  	HourMicrosecondStr   = "hour_microsecond"
   409  	HourMinuteStr        = "hour_minute"
   410  	HourSecondStr        = "hour_second"
   411  	MicrosecondStr       = "microsecond"
   412  	MinuteStr            = "minute"
   413  	MinuteMicrosecondStr = "minute_microsecond"
   414  	MinuteSecondStr      = "minute_second"
   415  	QuarterStr           = "quarter"
   416  	SecondStr            = "second"
   417  	SecondMicrosecondStr = "second_microsecond"
   418  	YearMonthStr         = "year_month"
   419  )
   420  
   421  // Constants for Enum Type - Insert.Action
   422  const (
   423  	InsertAct InsertAction = iota
   424  	ReplaceAct
   425  )
   426  
   427  // Constants for Enum Type - DDL.Action
   428  const (
   429  	CreateDDLAction DDLAction = iota
   430  	AlterDDLAction
   431  	DropDDLAction
   432  	RenameDDLAction
   433  	TruncateDDLAction
   434  	CreateVindexDDLAction
   435  	DropVindexDDLAction
   436  	AddVschemaTableDDLAction
   437  	DropVschemaTableDDLAction
   438  	AddColVindexDDLAction
   439  	DropColVindexDDLAction
   440  	AddSequenceDDLAction
   441  	AddAutoIncDDLAction
   442  	RevertDDLAction
   443  )
   444  
   445  // Constants for scope of variables
   446  // See https://dev.mysql.com/doc/refman/8.0/en/set-variable.html
   447  const (
   448  	NoScope             Scope = iota
   449  	SessionScope              // [SESSION | @@SESSION.| @@LOCAL. | @@] This is the default if no scope is given
   450  	GlobalScope               // {GLOBAL | @@GLOBAL.} system_var_name
   451  	VitessMetadataScope       // @@vitess_metadata.system_var_name
   452  	PersistSysScope           // {PERSIST_ONLY | @@PERSIST_ONLY.} system_var_name
   453  	PersistOnlySysScope       // {PERSIST_ONLY | @@PERSIST_ONLY.} system_var_name
   454  	VariableScope             // @var_name   This is used for user defined variables.
   455  	NextTxScope               // This is used for transaction related variables like transaction_isolation, transaction_read_write and set transaction statement.
   456  )
   457  
   458  // Constants for Enum Type - Lock
   459  const (
   460  	NoLock Lock = iota
   461  	ForUpdateLock
   462  	ShareModeLock
   463  )
   464  
   465  // Constants for Enum Type - TrimType
   466  const (
   467  	NoTrimType TrimType = iota
   468  	BothTrimType
   469  	LeadingTrimType
   470  	TrailingTrimType
   471  )
   472  
   473  // Constants for Enum Type - TrimFuncType
   474  const (
   475  	NormalTrimType TrimFuncType = iota
   476  	LTrimType
   477  	RTrimType
   478  )
   479  
   480  // Constants for Enum Type - FrameUnitType
   481  const (
   482  	FrameRowsType FrameUnitType = iota
   483  	FrameRangeType
   484  )
   485  
   486  // Constants for Enum Type - FramePointType
   487  const (
   488  	CurrentRowType FramePointType = iota
   489  	UnboundedPrecedingType
   490  	UnboundedFollowingType
   491  	ExprPrecedingType
   492  	ExprFollowingType
   493  )
   494  
   495  // Constants for Enum Type - ArgumentLessWindowExprType
   496  const (
   497  	CumeDistExprType ArgumentLessWindowExprType = iota
   498  	DenseRankExprType
   499  	PercentRankExprType
   500  	RankExprType
   501  	RowNumberExprType
   502  )
   503  
   504  // Constants for Enum Type - NullTreatmentType
   505  const (
   506  	RespectNullsType NullTreatmentType = iota
   507  	IgnoreNullsType
   508  )
   509  
   510  // Constants for Enum Type - FromFirstLastType
   511  const (
   512  	FromFirstType FromFirstLastType = iota
   513  	FromLastType
   514  )
   515  
   516  // Constants for Enum Type - FirstOrLastValueExprType
   517  const (
   518  	FirstValueExprType FirstOrLastValueExprType = iota
   519  	LastValueExprType
   520  )
   521  
   522  // Constants for Enum Type - FirstOrLastValueExprType
   523  const (
   524  	LagExprType LagLeadExprType = iota
   525  	LeadExprType
   526  )
   527  
   528  // Constants for Enum Type - JSONAttributeType
   529  const (
   530  	DepthAttributeType JSONAttributeType = iota
   531  	ValidAttributeType
   532  	TypeAttributeType
   533  	LengthAttributeType
   534  )
   535  
   536  // Constants for Enum Type - JSONValueModifierType
   537  const (
   538  	JSONArrayAppendType JSONValueModifierType = iota
   539  	JSONArrayInsertType
   540  	JSONInsertType
   541  	JSONReplaceType
   542  	JSONSetType
   543  )
   544  
   545  // Constants for Enum Type - JSONValueMergeType
   546  const (
   547  	JSONMergeType JSONValueMergeType = iota
   548  	JSONMergePatchType
   549  	JSONMergePreserveType
   550  )
   551  
   552  // Constants for Enum Type - LockingFuncType
   553  const (
   554  	GetLock LockingFuncType = iota
   555  	IsFreeLock
   556  	IsUsedLock
   557  	ReleaseAllLocks
   558  	ReleaseLock
   559  )
   560  
   561  // Constants for Enum Type - PerformanceSchemaType
   562  const (
   563  	FormatBytesType PerformanceSchemaType = iota
   564  	FormatPicoTimeType
   565  	PsCurrentThreadIDType
   566  	PsThreadIDType
   567  )
   568  
   569  // Constants for Enum Type - GTIDType
   570  const (
   571  	GTIDSubsetType GTIDType = iota
   572  	GTIDSubtractType
   573  	WaitForExecutedGTIDSetType
   574  	WaitUntilSQLThreadAfterGTIDSType
   575  )
   576  
   577  // Constants for Enum Type - WhereType
   578  const (
   579  	WhereClause WhereType = iota
   580  	HavingClause
   581  )
   582  
   583  // Constants for Enum Type - JoinType
   584  const (
   585  	NormalJoinType JoinType = iota
   586  	StraightJoinType
   587  	LeftJoinType
   588  	RightJoinType
   589  	NaturalJoinType
   590  	NaturalLeftJoinType
   591  	NaturalRightJoinType
   592  )
   593  
   594  // Constants for Enum Type - ComparisonExprOperator
   595  const (
   596  	EqualOp ComparisonExprOperator = iota
   597  	LessThanOp
   598  	GreaterThanOp
   599  	LessEqualOp
   600  	GreaterEqualOp
   601  	NotEqualOp
   602  	NullSafeEqualOp
   603  	InOp
   604  	NotInOp
   605  	LikeOp
   606  	NotLikeOp
   607  	RegexpOp
   608  	NotRegexpOp
   609  )
   610  
   611  // Constant for Enum Type - IsExprOperator
   612  const (
   613  	IsNullOp IsExprOperator = iota
   614  	IsNotNullOp
   615  	IsTrueOp
   616  	IsNotTrueOp
   617  	IsFalseOp
   618  	IsNotFalseOp
   619  )
   620  
   621  // Constant for Enum Type - BinaryExprOperator
   622  const (
   623  	BitAndOp BinaryExprOperator = iota
   624  	BitOrOp
   625  	BitXorOp
   626  	PlusOp
   627  	MinusOp
   628  	MultOp
   629  	DivOp
   630  	IntDivOp
   631  	ModOp
   632  	ShiftLeftOp
   633  	ShiftRightOp
   634  	JSONExtractOp
   635  	JSONUnquoteExtractOp
   636  )
   637  
   638  // Constant for Enum Type - UnaryExprOperator
   639  const (
   640  	UPlusOp UnaryExprOperator = iota
   641  	UMinusOp
   642  	TildaOp
   643  	BangOp
   644  	NStringOp
   645  )
   646  
   647  // Constant for Enum Type - MatchExprOption
   648  const (
   649  	NoOption MatchExprOption = iota
   650  	BooleanModeOpt
   651  	NaturalLanguageModeOpt
   652  	NaturalLanguageModeWithQueryExpansionOpt
   653  	QueryExpansionOpt
   654  )
   655  
   656  // Constant for Enum Type - OrderDirection
   657  const (
   658  	AscOrder OrderDirection = iota
   659  	DescOrder
   660  )
   661  
   662  // Constant for Enum Type - IndexHintType
   663  const (
   664  	UseOp IndexHintType = iota
   665  	IgnoreOp
   666  	ForceOp
   667  )
   668  
   669  // Constant for Enum Type - IndexHintForType
   670  const (
   671  	NoForType IndexHintForType = iota
   672  	JoinForType
   673  	GroupByForType
   674  	OrderByForType
   675  )
   676  
   677  // Constant for Enum Type - PartitionSpecAction
   678  const (
   679  	ReorganizeAction PartitionSpecAction = iota
   680  	AddAction
   681  	DiscardAction
   682  	DropAction
   683  	ImportAction
   684  	TruncateAction
   685  	CoalesceAction
   686  	ExchangeAction
   687  	AnalyzeAction
   688  	CheckAction
   689  	OptimizeAction
   690  	RebuildAction
   691  	RepairAction
   692  	RemoveAction
   693  	UpgradeAction
   694  )
   695  
   696  // Constant for Enum Type - PartitionByType
   697  const (
   698  	HashType PartitionByType = iota
   699  	KeyType
   700  	RangeType
   701  	ListType
   702  )
   703  
   704  // Constant for Enum Type - PartitionValueRangeType
   705  const (
   706  	LessThanType PartitionValueRangeType = iota
   707  	InType
   708  )
   709  
   710  // Constant for Enum Type - ExplainType
   711  const (
   712  	EmptyType ExplainType = iota
   713  	TreeType
   714  	JSONType
   715  	VitessType
   716  	VTExplainType
   717  	TraditionalType
   718  	AnalyzeType
   719  )
   720  
   721  // Constant for Enum Type - VExplainType
   722  const (
   723  	QueriesVExplainType VExplainType = iota
   724  	PlanVExplainType
   725  	AllVExplainType
   726  )
   727  
   728  // Constant for Enum Type - SelectIntoType
   729  const (
   730  	IntoOutfile SelectIntoType = iota
   731  	IntoOutfileS3
   732  	IntoDumpfile
   733  )
   734  
   735  // Constant for Enum Type - DeallocateStmtType
   736  const (
   737  	DeallocateType DeallocateStmtType = iota
   738  	DropType
   739  )
   740  
   741  // Constant for Enum Type - JtOnResponseType
   742  const (
   743  	ErrorJSONType JtOnResponseType = iota
   744  	NullJSONType
   745  	DefaultJSONType
   746  )
   747  
   748  // Constant for Enum Type - DatabaseOptionType
   749  const (
   750  	CollateType DatabaseOptionType = iota
   751  	CharacterSetType
   752  	EncryptionType
   753  )
   754  
   755  // LockType constants
   756  const (
   757  	UnknownLockType LockType = iota
   758  	Read
   759  	ReadLocal
   760  	Write
   761  	LowPriorityWrite
   762  )
   763  
   764  // ShowCommandType constants
   765  const (
   766  	UnknownCommandType ShowCommandType = iota
   767  	Charset
   768  	Collation
   769  	Column
   770  	CreateDb
   771  	CreateE
   772  	CreateF
   773  	CreateProc
   774  	CreateTbl
   775  	CreateTr
   776  	CreateV
   777  	Database
   778  	Engines
   779  	FunctionC
   780  	Function
   781  	GtidExecGlobal
   782  	Index
   783  	OpenTable
   784  	Plugins
   785  	Privilege
   786  	ProcedureC
   787  	Procedure
   788  	StatusGlobal
   789  	StatusSession
   790  	Table
   791  	TableStatus
   792  	Trigger
   793  	VariableGlobal
   794  	VariableSession
   795  	VGtidExecGlobal
   796  	VitessMigrations
   797  	VitessReplicationStatus
   798  	VitessShards
   799  	VitessTablets
   800  	VitessTarget
   801  	VitessVariables
   802  	VschemaTables
   803  	VschemaVindexes
   804  	Warnings
   805  	Keyspace
   806  )
   807  
   808  // DropKeyType constants
   809  const (
   810  	PrimaryKeyType DropKeyType = iota
   811  	ForeignKeyType
   812  	NormalKeyType
   813  	CheckKeyType
   814  )
   815  
   816  // LockOptionType constants
   817  const (
   818  	DefaultType LockOptionType = iota
   819  	NoneType
   820  	SharedType
   821  	ExclusiveType
   822  )
   823  
   824  // AlterMigrationType constants
   825  const (
   826  	RetryMigrationType AlterMigrationType = iota
   827  	LaunchMigrationType
   828  	LaunchAllMigrationType
   829  	CompleteMigrationType
   830  	CompleteAllMigrationType
   831  	CancelMigrationType
   832  	CancelAllMigrationType
   833  	CleanupMigrationType
   834  	ThrottleMigrationType
   835  	ThrottleAllMigrationType
   836  	UnthrottleMigrationType
   837  	UnthrottleAllMigrationType
   838  )
   839  
   840  // ColumnStorage constants
   841  const (
   842  	VirtualStorage ColumnStorage = iota
   843  	StoredStorage
   844  )
   845  
   846  // ColumnFormat constants
   847  const (
   848  	UnspecifiedFormat ColumnFormat = iota
   849  	FixedFormat
   850  	DynamicFormat
   851  	DefaultFormat
   852  )
   853  
   854  // IntervalTypes constants
   855  const (
   856  	IntervalYear IntervalTypes = iota
   857  	IntervalQuarter
   858  	IntervalMonth
   859  	IntervalWeek
   860  	IntervalDay
   861  	IntervalHour
   862  	IntervalMinute
   863  	IntervalSecond
   864  	IntervalMicrosecond
   865  	IntervalYearMonth
   866  	IntervalDayHour
   867  	IntervalDayMinute
   868  	IntervalDaySecond
   869  	IntervalHourMinute
   870  	IntervalHourSecond
   871  	IntervalMinuteSecond
   872  	IntervalDayMicrosecond
   873  	IntervalHourMicrosecond
   874  	IntervalMinuteMicrosecond
   875  	IntervalSecondMicrosecond
   876  )
   877  
   878  // Transaction access mode
   879  const (
   880  	WithConsistentSnapshot TxAccessMode = iota
   881  	ReadWrite
   882  	ReadOnly
   883  )