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