Documentation
¶
Index ¶
- Constants
- Variables
- func FormatString(str string) string
- func GetDisplayWith(val int32) int32
- func IsContainAnalyze(options []OptionElem) bool
- func IsValue(node Expr) bool
- func String(node NodeFormatter, dialectType dialect.DialectType) string
- type AccountAuthOption
- type AccountComment
- type AccountCommentOrAttribute
- type AccountIdentified
- type AccountIdentifiedOption
- type AccountStatus
- type AccountStatusOption
- type AggType
- type AlgorithmCopy
- type AlgorithmDefault
- type AlgorithmInplace
- type AliasClause
- type AliasedTableExpr
- type AlterAccount
- type AlterUser
- type AnalyzeStmt
- type AndExpr
- type Assignment
- type AttributeAutoIncrement
- type AttributeAutoRandom
- type AttributeCheckConstraint
- type AttributeCollate
- type AttributeColumnFormat
- type AttributeComment
- type AttributeDefault
- type AttributeGeneratedAlways
- type AttributeKey
- type AttributeLowCardinality
- type AttributeNull
- type AttributeOnUpdate
- type AttributePrimaryKey
- type AttributeReference
- type AttributeStorage
- type AttributeUnique
- type AttributeUniqueKey
- type AuthRecord
- type BeginTransaction
- type BinaryExpr
- type BinaryOp
- type CTE
- type CaseExpr
- type CastExpr
- type CheckIndex
- type ColumnAttribute
- type ColumnItem
- type ColumnTableDef
- type CommitTransaction
- type ComparisonExpr
- func NewComparisonExpr(op ComparisonOp, l, r Expr) *ComparisonExpr
- func NewComparisonExprWithEscape(op ComparisonOp, l, r, e Expr) *ComparisonExpr
- func NewComparisonExprWithSubop(op, subop ComparisonOp, l, r Expr) *ComparisonExpr
- func NewSubqueryComparisonExpr(op ComparisonOp, subOp ComparisonOp, l, r Expr) *ComparisonExpr
- type ComparisonOp
- type CompletionType
- type Constant
- type CreateAccount
- type CreateDatabase
- type CreateIndex
- type CreateOption
- type CreateOptionCharset
- type CreateOptionCollate
- type CreateOptionDefault
- type CreateOptionEncryption
- type CreateRole
- type CreateTable
- type CreateUser
- type CreateView
- type DBool
- type Datum
- type Deallocate
- type Declare
- type DefaultVal
- type Delete
- type Direction
- type Do
- type DropAccount
- type DropDatabase
- type DropIndex
- type DropRole
- type DropTable
- type DropUser
- type DropView
- type DuplicateKey
- type DuplicateKeyError
- type DuplicateKeyIgnore
- type DuplicateKeyReplace
- type Execute
- type Explain
- type ExplainAnalyze
- type ExplainFor
- type ExplainStmt
- type ExportParam
- type Expr
- type ExprList
- type Exprs
- type ExternParam
- type Family
- type Fields
- type FmtCtx
- type FmtCtxOption
- type ForeignKey
- type From
- type FullTextIndex
- type FuncExpr
- type FuncType
- type FunctionReference
- type GeoMetadata
- type Grant
- type GrantPrivilege
- type GrantProxy
- type GrantRole
- type GrantType
- type GroupBy
- type HashType
- type Identifier
- type IdentifierList
- type IdentifierName
- type Import
- type Index
- type IndexCategory
- type IndexHint
- type IndexHintScope
- type IndexHintType
- type IndexOption
- type IndexType
- type Insert
- type InternalType
- type IntervalDurationField
- type IntervalExpr
- type IntervalType
- type IsFalseExpr
- type IsNotFalseExpr
- type IsNotNullExpr
- type IsNotTrueExpr
- type IsNotUnknownExpr
- type IsNullExpr
- type IsTrueExpr
- type IsUnknownExpr
- type JoinCond
- type JoinTableExpr
- type KeyPart
- type KeyType
- type LengthScaleOpt
- type Limit
- type Lines
- type ListType
- type Load
- type LoadColumn
- type LockDefault
- type LockExclusive
- type LockNone
- type LockShared
- type MatchType
- type MaxValue
- type MiscOption
- type MoDump
- type NameParts
- type NaturalJoinCond
- type NodeFormatter
- type NotExpr
- type NullsPosition
- type NumVal
- func NewNumVal(value constant.Value, origString string, negative bool) *NumVal
- func NewNumValWithResFoalt(value constant.Value, origString string, negative bool, resFloat float64) *NumVal
- func NewNumValWithResInt(value constant.Value, origString string, negative bool, resInt int64) *NumVal
- func NewNumValWithType(value constant.Value, origString string, negative bool, typ P_TYPE) *NumVal
- type ObjectName
- type ObjectNamePrefix
- type ObjectType
- type OnJoinCond
- type OptionElem
- type OrExpr
- type Order
- type OrderBy
- type P_TYPE
- type ParamExpr
- type ParenExpr
- type ParenSelect
- type ParenTableExpr
- type Partition
- type PartitionBy
- type PartitionOption
- type PartitionType
- type PersistentUserDefinedTypeMetadata
- type Precedence
- type Prepare
- type PrepareStmt
- type PrepareString
- type PrimaryKeyIndex
- type Privilege
- type PrivilegeLevel
- type PrivilegeLevelType
- type PrivilegeType
- type Property
- type RangeCond
- type RangeType
- type ReadWriteMode
- type ReferenceOnRecord
- type ReferenceOptionType
- type Replace
- type ResolvableFunctionReference
- type ResolvableTypeReference
- type ResourceOption
- type ResourceOptionMaxConnectionPerHour
- type ResourceOptionMaxQueriesPerHour
- type ResourceOptionMaxUpdatesPerHour
- type ResourceOptionMaxUserConnections
- type Revoke
- type RevokePrivilege
- type RevokeRole
- type RevokeType
- type Role
- type RollbackTransaction
- type RowFormatType
- type S3Parameter
- type SecondaryRoleType
- type Select
- type SelectClause
- type SelectExpr
- type SelectExprs
- type SelectStatement
- type SetDefaultRole
- type SetDefaultRoleType
- type SetPassword
- type SetRole
- type SetRoleType
- type SetVar
- type Show
- type ShowCollation
- type ShowColumns
- type ShowCreateDatabase
- type ShowCreateTable
- type ShowCreateView
- type ShowDatabases
- type ShowErrors
- type ShowGrants
- type ShowIndex
- type ShowProcessList
- type ShowStatus
- type ShowTableStatus
- type ShowTables
- type ShowTarget
- type ShowType
- type ShowVariables
- type ShowWarnings
- type Statement
- type StatementSource
- type StrVal
- type SubPartition
- type Subquery
- type SubqueryExpr
- type T
- type TableDef
- type TableDefs
- type TableExpr
- type TableExprs
- type TableFunction
- type TableName
- type TableNames
- type TableOption
- type TableOptionAutoIncrement
- type TableOptionAvgRowLength
- type TableOptionCharset
- type TableOptionChecksum
- type TableOptionCollate
- type TableOptionComment
- type TableOptionCompression
- type TableOptionConnection
- type TableOptionDataDirectory
- type TableOptionDelayKeyWrite
- type TableOptionEncryption
- type TableOptionEngine
- type TableOptionIndexDirectory
- type TableOptionKeyBlockSize
- type TableOptionMaxRows
- type TableOptionMinRows
- type TableOptionPackKeys
- type TableOptionPassword
- type TableOptionProperties
- type TableOptionRowFormat
- type TableOptionSecondaryEngine
- type TableOptionSecondaryEngineNull
- type TableOptionStatsAutoRecalc
- type TableOptionStatsPersistent
- type TableOptionStatsSamplePages
- type TableOptionStorageMedia
- type TableOptionTablespace
- type TableOptionUnion
- type TailParameter
- type TlsOption
- type TlsOptionCipher
- type TlsOptionIssuer
- type TlsOptionNone
- type TlsOptionSSL
- type TlsOptionSan
- type TlsOptionSubject
- type TlsOptionX509
- type TransactionModes
- type TruncateTable
- type Tuple
- type TypeExpr
- type UnaryExpr
- type UnaryOp
- type UnionClause
- type UnionType
- type UnionTypeRecord
- type UniqueIndex
- type UnqualifiedStar
- type UnresolvedName
- type UnresolvedObjectName
- type UnrestrictedIdentifier
- type Update
- type UpdateExpr
- type UpdateExprs
- type UpdateList
- type UpdateVal
- type Use
- type User
- type UserMiscOption
- type UserMiscOptionAccountLock
- type UserMiscOptionAccountUnlock
- type UserMiscOptionFailedLoginAttempts
- type UserMiscOptionPasswordExpireDefault
- type UserMiscOptionPasswordExpireInterval
- type UserMiscOptionPasswordExpireNever
- type UserMiscOptionPasswordExpireNone
- type UserMiscOptionPasswordHistoryCount
- type UserMiscOptionPasswordHistoryDefault
- type UserMiscOptionPasswordLockTimeCount
- type UserMiscOptionPasswordLockTimeUnbounded
- type UserMiscOptionPasswordRequireCurrentDefault
- type UserMiscOptionPasswordRequireCurrentNone
- type UserMiscOptionPasswordRequireCurrentOptional
- type UserMiscOptionPasswordReuseIntervalCount
- type UserMiscOptionPasswordReuseIntervalDefault
- type UsernameRecord
- type UsingJoinCond
- type Values
- type ValuesClause
- type ValuesIn
- type ValuesLessThan
- type ValuesStatement
- type VarAssignmentExpr
- type VarExpr
- type VarName
- type VisibleType
- type Visitor
- type When
- type Where
- type With
- type XorExpr
Constants ¶
const ( AstWhere = "where" AstHaving = "having" )
const ( JOIN_TYPE_FULL = "FULL" JOIN_TYPE_LEFT = "LEFT" JOIN_TYPE_RIGHT = "RIGHT" JOIN_TYPE_CROSS = "CROSS" JOIN_TYPE_INNER = "INNER" JOIN_TYPE_STRAIGHT = "STRAIGHT_JOIN" JOIN_TYPE_NATURAL = "NATURAL" JOIN_TYPE_NATURAL_LEFT = "NATURAL LEFT" JOIN_TYPE_NATURAL_RIGHT = "NATURAL RIGHT" )
const ( ShowEngines = iota ShowCharset ShowCreateUser ShowTriggers ShowProcedureStatus ShowConfig ShowEvents ShowPlugins ShowProfile ShowProfiles ShowPrivileges )
const ( DefaultDisplayWidth = -1 NotDefineDisplayWidth = 0 NotDefineDec = -1 )
const ( AUTO = "auto" NOCOMPRESS = "none" GZIP = "gzip" BZIP2 = "bz2" FLATE = "flate" LZW = "lzw" ZLIB = "zlib" LZ4 = "lz4" )
const ( CSV = "csv" JSONLINE = "jsonline" )
load data fotmat
const ( OBJECT = "object" ARRAY = "array" )
if $format is jsonline
const (
S3 = 1
)
Variables ¶
var ( DBoolTrue = &constDBoolTrue DBoolFalse = &constDBoolFalse DNull Datum = &dNull{} )
var ( TYPE_TINY = &T{InternalType: InternalType{ Family: IntFamily, Width: 8, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_TINY), }} TYPE_SHORT = &T{InternalType: InternalType{ Family: IntFamily, Width: 16, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_SHORT), }} TYPE_LONG = &T{InternalType: InternalType{ Family: IntFamily, Width: 32, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_LONG), }} TYPE_FLOAT = &T{InternalType: InternalType{ Family: FloatFamily, Width: 32, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_FLOAT), }} TYPE_DOUBLE = &T{InternalType: InternalType{ Family: FloatFamily, Width: 64, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_DOUBLE), }} TYPE_NULL = &T{InternalType: InternalType{ Family: UnknownFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_NULL), }} TYPE_TIMESTAMP = &T{InternalType: InternalType{ Family: TimestampFamily, Precision: 0, TimePrecisionIsSet: false, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_TIMESTAMP), }} TYPE_LONGLONG = &T{InternalType: InternalType{ Family: IntFamily, Width: 64, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_LONGLONG), }} TYPE_INT24 = &T{InternalType: InternalType{ Family: IntFamily, Width: 24, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_INT24), }} TYPE_DATE = &T{InternalType: InternalType{ Family: DateFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_DATE), }} TYPE_DURATION = &T{InternalType: InternalType{ Family: IntervalFamily, Precision: 0, TimePrecisionIsSet: false, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_TIME), IntervalDurationField: &IntervalDurationField{}, }} TYPE_TIME = &T{InternalType: InternalType{ Family: TimeFamily, Precision: 0, TimePrecisionIsSet: false, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_TIME), }} TYPE_DATETIME = &T{InternalType: InternalType{ Family: TimestampFamily, Precision: 0, TimePrecisionIsSet: false, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_DATETIME), }} TYPE_YEAR = &T{InternalType: InternalType{ Family: IntFamily, Width: 16, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_YEAR), }} TYPE_NEWDATE = &T{InternalType: InternalType{ Family: DateFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_NEWDATE), }} TYPE_VARCHAR = &T{InternalType: InternalType{ Family: StringFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_VARCHAR), }} TYPE_BIT = &T{InternalType: InternalType{ Family: BitFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_BIT), }} TYPE_BOOL = &T{InternalType: InternalType{ Family: BoolFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_BOOL), }} TYPE_JSON = &T{InternalType: InternalType{ Family: JsonFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_JSON)}} TYPE_UUID = &T{InternalType: InternalType{ Family: UuidFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_UUID)}} TYPE_ENUM = &T{InternalType: InternalType{ Family: EnumFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_ENUM), }} TYPE_SET = &T{InternalType: InternalType{ Family: SetFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_SET), }} TYPE_TINY_BLOB = &T{InternalType: InternalType{ Family: BlobFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_TINY_BLOB)}} TYPE_MEDIUM_BLOB = &T{InternalType: InternalType{ Family: BlobFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_MEDIUM_BLOB), }} TYPE_LONG_BLOB = &T{InternalType: InternalType{ Family: BlobFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_LONG_BLOB), }} TYPE_BLOB = &T{InternalType: InternalType{ Family: BlobFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_BLOB), }} TYPE_TEXT = &T{InternalType: InternalType{ Family: BlobFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_TEXT), }} TYPE_VARSTRING = &T{InternalType: InternalType{ Family: StringFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_VAR_STRING), }} TYPE_STRING = &T{InternalType: InternalType{ Family: StringFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_STRING), }} TYPE_GEOMETRY = &T{InternalType: InternalType{ Family: GeometryFamily, Locale: &emptyLocale, Oid: uint32(defines.MYSQL_TYPE_GEOMETRY), }} )
Functions ¶
func FormatString ¶ added in v0.5.0
func GetDisplayWith ¶
func IsContainAnalyze ¶ added in v0.6.0
func IsContainAnalyze(options []OptionElem) bool
func IsValue ¶
IsValue returns true if the Expr is a string, integral or value arg. NULL is not considered to be a value.
func String ¶
func String(node NodeFormatter, dialectType dialect.DialectType) string
Types ¶
type AccountAuthOption ¶ added in v0.6.0
type AccountAuthOption struct {
Equal string
AdminName string
IdentifiedType AccountIdentified
}
func (*AccountAuthOption) Format ¶ added in v0.6.0
func (node *AccountAuthOption) Format(ctx *FmtCtx)
type AccountComment ¶ added in v0.6.0
func (*AccountComment) Format ¶ added in v0.6.0
func (node *AccountComment) Format(ctx *FmtCtx)
type AccountCommentOrAttribute ¶ added in v0.6.0
func (*AccountCommentOrAttribute) Format ¶ added in v0.6.0
func (node *AccountCommentOrAttribute) Format(ctx *FmtCtx)
type AccountIdentified ¶ added in v0.6.0
type AccountIdentified struct {
Typ AccountIdentifiedOption
Str string
}
func (*AccountIdentified) Format ¶ added in v0.6.0
func (node *AccountIdentified) Format(ctx *FmtCtx)
type AccountIdentifiedOption ¶ added in v0.6.0
type AccountIdentifiedOption int
const ( AccountIdentifiedByPassword AccountIdentifiedOption = iota AccountIdentifiedByRandomPassword AccountIdentifiedWithSSL )
type AccountStatus ¶ added in v0.6.0
type AccountStatus struct {
Exist bool
Option AccountStatusOption
}
func (*AccountStatus) Format ¶ added in v0.6.0
func (node *AccountStatus) Format(ctx *FmtCtx)
type AccountStatusOption ¶ added in v0.6.0
type AccountStatusOption int
const ( AccountStatusOpen AccountStatusOption = iota AccountStatusSuspend )
type AggType ¶
type AggType int
AggType specifies the type of aggregation.
const (
AGG_TYPE_GENERAL AggType
)
type AlgorithmCopy ¶
type AlgorithmCopy struct {
// contains filtered or unexported fields
}
type AlgorithmDefault ¶
type AlgorithmDefault struct {
// contains filtered or unexported fields
}
type AlgorithmInplace ¶
type AlgorithmInplace struct {
// contains filtered or unexported fields
}
type AliasClause ¶
type AliasClause struct {
NodeFormatter
Alias Identifier
Cols IdentifierList
}
The alias, optionally with a column list: "AS name" or "AS name(col1, col2)".
func (*AliasClause) Format ¶
func (node *AliasClause) Format(ctx *FmtCtx)
type AliasedTableExpr ¶
type AliasedTableExpr struct {
TableExpr
Expr TableExpr
As AliasClause
IndexHints []*IndexHint
}
the table expression coupled with an optional alias.
func NewAliasedTableExpr ¶
func NewAliasedTableExpr(e TableExpr, a AliasClause) *AliasedTableExpr
func (*AliasedTableExpr) Format ¶
func (node *AliasedTableExpr) Format(ctx *FmtCtx)
type AlterAccount ¶ added in v0.6.0
type AlterAccount struct {
IfExists bool
Name string
AuthOption AccountAuthOption
//status_option or not
StatusOption AccountStatus
//comment or not
Comment AccountComment
// contains filtered or unexported fields
}
func (*AlterAccount) Format ¶ added in v0.6.0
func (ca *AlterAccount) Format(ctx *FmtCtx)
type AlterUser ¶
type AlterUser struct {
IfExists bool
Users []*User
Role *Role
MiscOpt UserMiscOption
// comment or attribute
CommentOrAttribute AccountCommentOrAttribute
// contains filtered or unexported fields
}
func NewAlterUser ¶
func NewAlterUser(ife bool, u []*User, r *Role, m UserMiscOption) *AlterUser
type AnalyzeStmt ¶
type AnalyzeStmt struct {
Table *TableName
Cols IdentifierList
// contains filtered or unexported fields
}
Use statement
func NewAnalyzeStmt ¶
func NewAnalyzeStmt(tbl *TableName, cols IdentifierList) *AnalyzeStmt
func (*AnalyzeStmt) Format ¶
func (node *AnalyzeStmt) Format(ctx *FmtCtx)
type AndExpr ¶
type AndExpr struct {
Left, Right Expr
// contains filtered or unexported fields
}
and expression
func NewAndExpr ¶
type Assignment ¶
type Assignment struct {
Column Identifier
Expr Expr
}
type AttributeAutoIncrement ¶
type AttributeAutoIncrement struct {
IsAutoIncrement bool
// contains filtered or unexported fields
}
func NewAttributeAutoIncrement ¶
func NewAttributeAutoIncrement() *AttributeAutoIncrement
func (*AttributeAutoIncrement) Format ¶
func (node *AttributeAutoIncrement) Format(ctx *FmtCtx)
type AttributeAutoRandom ¶
type AttributeAutoRandom struct {
BitLength int
// contains filtered or unexported fields
}
func NewAttributeAutoRandom ¶
func NewAttributeAutoRandom(b int) *AttributeAutoRandom
type AttributeCheckConstraint ¶
type AttributeCheckConstraint struct {
Name string
Expr Expr
Enforced bool
// contains filtered or unexported fields
}
func NewAttributeCheck ¶
func NewAttributeCheck(e Expr, f bool, n string) *AttributeCheckConstraint
func (*AttributeCheckConstraint) Format ¶
func (node *AttributeCheckConstraint) Format(ctx *FmtCtx)
type AttributeCollate ¶
type AttributeCollate struct {
Collate string
// contains filtered or unexported fields
}
func NewAttributeCollate ¶
func NewAttributeCollate(c string) *AttributeCollate
func (*AttributeCollate) Format ¶
func (node *AttributeCollate) Format(ctx *FmtCtx)
type AttributeColumnFormat ¶
type AttributeColumnFormat struct {
ColumnFormat string
// contains filtered or unexported fields
}
func NewAttributeColumnFormat ¶
func NewAttributeColumnFormat(f string) *AttributeColumnFormat
func (*AttributeColumnFormat) Format ¶
func (node *AttributeColumnFormat) Format(ctx *FmtCtx)
type AttributeComment ¶
type AttributeComment struct {
CMT Expr
// contains filtered or unexported fields
}
func NewAttributeComment ¶
func NewAttributeComment(c Expr) *AttributeComment
func (*AttributeComment) Format ¶
func (node *AttributeComment) Format(ctx *FmtCtx)
type AttributeDefault ¶
type AttributeDefault struct {
Expr Expr
// contains filtered or unexported fields
}
func NewAttributeDefault ¶
func NewAttributeDefault(e Expr) *AttributeDefault
func (*AttributeDefault) Format ¶
func (node *AttributeDefault) Format(ctx *FmtCtx)
type AttributeGeneratedAlways ¶
type AttributeGeneratedAlways struct {
Expr Expr
Stored bool
// contains filtered or unexported fields
}
func NewAttributeGeneratedAlways ¶
func NewAttributeGeneratedAlways(e Expr, s bool) *AttributeGeneratedAlways
func (*AttributeGeneratedAlways) Format ¶
func (node *AttributeGeneratedAlways) Format(ctx *FmtCtx)
type AttributeKey ¶
type AttributeKey struct {
// contains filtered or unexported fields
}
func NewAttributeKey ¶
func NewAttributeKey() *AttributeKey
func (*AttributeKey) Format ¶
func (node *AttributeKey) Format(ctx *FmtCtx)
type AttributeLowCardinality ¶ added in v0.6.0
type AttributeLowCardinality struct {
// contains filtered or unexported fields
}
func NewAttributeLowCardinality ¶ added in v0.6.0
func NewAttributeLowCardinality() *AttributeLowCardinality
func (*AttributeLowCardinality) Format ¶ added in v0.6.0
func (node *AttributeLowCardinality) Format(ctx *FmtCtx)
type AttributeNull ¶
type AttributeNull struct {
Is bool //true NULL (default); false NOT NULL
// contains filtered or unexported fields
}
func NewAttributeNull ¶
func NewAttributeNull(b bool) *AttributeNull
func (*AttributeNull) Format ¶
func (node *AttributeNull) Format(ctx *FmtCtx)
type AttributeOnUpdate ¶
type AttributeOnUpdate struct {
Expr Expr
// contains filtered or unexported fields
}
func NewAttributeOnUpdate ¶
func NewAttributeOnUpdate(e Expr) *AttributeOnUpdate
func (*AttributeOnUpdate) Format ¶ added in v0.6.0
func (node *AttributeOnUpdate) Format(ctx *FmtCtx)
type AttributePrimaryKey ¶
type AttributePrimaryKey struct {
// contains filtered or unexported fields
}
func NewAttributePrimaryKey ¶
func NewAttributePrimaryKey() *AttributePrimaryKey
func (*AttributePrimaryKey) Format ¶
func (node *AttributePrimaryKey) Format(ctx *FmtCtx)
type AttributeReference ¶
type AttributeReference struct {
TableName *TableName
KeyParts []*KeyPart
Match MatchType
OnDelete ReferenceOptionType
OnUpdate ReferenceOptionType
// contains filtered or unexported fields
}
func NewAttributeReference ¶
func NewAttributeReference(t *TableName, kps []*KeyPart, m MatchType, od ReferenceOptionType, ou ReferenceOptionType) *AttributeReference
func (*AttributeReference) Format ¶
func (node *AttributeReference) Format(ctx *FmtCtx)
type AttributeStorage ¶
type AttributeStorage struct {
Storage string
// contains filtered or unexported fields
}
func NewAttributeStorage ¶
func NewAttributeStorage(s string) *AttributeStorage
func (*AttributeStorage) Format ¶
func (node *AttributeStorage) Format(ctx *FmtCtx)
type AttributeUnique ¶
type AttributeUnique struct {
// contains filtered or unexported fields
}
func NewAttributeUnique ¶
func NewAttributeUnique() *AttributeUnique
func (*AttributeUnique) Format ¶
func (node *AttributeUnique) Format(ctx *FmtCtx)
type AttributeUniqueKey ¶
type AttributeUniqueKey struct {
// contains filtered or unexported fields
}
func NewAttributeUniqueKey ¶
func NewAttributeUniqueKey() *AttributeUniqueKey
func (*AttributeUniqueKey) Format ¶
func (node *AttributeUniqueKey) Format(ctx *FmtCtx)
type AuthRecord ¶
type BeginTransaction ¶
type BeginTransaction struct {
Modes TransactionModes
// contains filtered or unexported fields
}
Begin statement
func NewBeginTransaction ¶
func NewBeginTransaction(m TransactionModes) *BeginTransaction
func (*BeginTransaction) Format ¶
func (node *BeginTransaction) Format(ctx *FmtCtx)
type BinaryExpr ¶
type BinaryExpr struct {
//operator
Op BinaryOp
//left expression
Left Expr
//right expression
Right Expr
// contains filtered or unexported fields
}
binary expression
func NewBinaryExpr ¶
func NewBinaryExpr(op BinaryOp, left Expr, right Expr) *BinaryExpr
func (*BinaryExpr) Format ¶
func (node *BinaryExpr) Format(ctx *FmtCtx)
type CTE ¶
type CTE struct {
Name *AliasClause
Stmt Statement
}
type CaseExpr ¶
type CaseExpr struct {
Expr Expr
Whens []*When
Else Expr
// contains filtered or unexported fields
}
Case-When expression.
type CastExpr ¶
type CastExpr struct {
Expr Expr
Type ResolvableTypeReference
// contains filtered or unexported fields
}
the Cast expression
func NewCastExpr ¶
func NewCastExpr(e Expr, t ResolvableTypeReference) *CastExpr
type CheckIndex ¶
func NewCheckIndex ¶
func NewCheckIndex(e Expr, en bool) *CheckIndex
func (*CheckIndex) Format ¶
func (node *CheckIndex) Format(ctx *FmtCtx)
type ColumnItem ¶
type ColumnItem struct {
IdentifierName
//the name of the column
ColumnName Identifier
}
type ColumnTableDef ¶
type ColumnTableDef struct {
Name *UnresolvedName
Type ResolvableTypeReference
Attributes []ColumnAttribute
// contains filtered or unexported fields
}
func NewColumnTableDef ¶
func NewColumnTableDef(n *UnresolvedName, t ResolvableTypeReference, a []ColumnAttribute) *ColumnTableDef
func (*ColumnTableDef) Format ¶
func (node *ColumnTableDef) Format(ctx *FmtCtx)
type CommitTransaction ¶
type CommitTransaction struct {
Type CompletionType
// contains filtered or unexported fields
}
Commit statement
func NewCommitTransaction ¶
func NewCommitTransaction(t CompletionType) *CommitTransaction
func (*CommitTransaction) Format ¶
func (node *CommitTransaction) Format(ctx *FmtCtx)
type ComparisonExpr ¶
type ComparisonExpr struct {
Op ComparisonOp
//ANY SOME ALL with subquery
SubOp ComparisonOp
Left Expr
Right Expr
Escape Expr
// contains filtered or unexported fields
}
func NewComparisonExpr ¶
func NewComparisonExpr(op ComparisonOp, l, r Expr) *ComparisonExpr
func NewComparisonExprWithEscape ¶
func NewComparisonExprWithEscape(op ComparisonOp, l, r, e Expr) *ComparisonExpr
func NewComparisonExprWithSubop ¶
func NewComparisonExprWithSubop(op, subop ComparisonOp, l, r Expr) *ComparisonExpr
func NewSubqueryComparisonExpr ¶ added in v0.5.0
func NewSubqueryComparisonExpr(op ComparisonOp, subOp ComparisonOp, l, r Expr) *ComparisonExpr
func (*ComparisonExpr) Format ¶
func (node *ComparisonExpr) Format(ctx *FmtCtx)
type ComparisonOp ¶
type ComparisonOp int
comparion operation
const ( EQUAL ComparisonOp = iota // = LESS_THAN // < LESS_THAN_EQUAL // <= GREAT_THAN // > GREAT_THAN_EQUAL // >= NOT_EQUAL // <>, != IN // IN NOT_IN // NOT IN LIKE // LIKE NOT_LIKE // NOT LIKE REG_MATCH // REG_MATCH NOT_REG_MATCH // NOT REG_MATCH IS_DISTINCT_FROM IS_NOT_DISTINCT_FROM NULL_SAFE_EQUAL // <=> //reference: https://dev.mysql.com/doc/refman/8.0/en/all-subqueries.html //subquery with ANY,SOME,ALL //operand comparison_operator [ANY | SOME | ALL] (subquery) ANY SOME ALL )
func (ComparisonOp) ToString ¶
func (op ComparisonOp) ToString() string
type CompletionType ¶
type CompletionType int
const ( COMPLETION_TYPE_NO_CHAIN CompletionType = iota COMPLETION_TYPE_CHAIN COMPLETION_TYPE_RELEASE )
type Constant ¶
type Constant interface {
Expr
}
the AST for literals like string,numeric,bool and etc.
type CreateAccount ¶ added in v0.6.0
type CreateAccount struct {
IfNotExists bool
Name string
AuthOption AccountAuthOption
//status_option or not
StatusOption AccountStatus
//comment or not
Comment AccountComment
// contains filtered or unexported fields
}
func (*CreateAccount) Format ¶ added in v0.6.0
func (ca *CreateAccount) Format(ctx *FmtCtx)
type CreateDatabase ¶
type CreateDatabase struct {
IfNotExists bool
Name Identifier
CreateOptions []CreateOption
// contains filtered or unexported fields
}
func NewCreateDatabase ¶
func NewCreateDatabase(ine bool, name Identifier, opts []CreateOption) *CreateDatabase
func (*CreateDatabase) Format ¶
func (node *CreateDatabase) Format(ctx *FmtCtx)
type CreateIndex ¶
type CreateIndex struct {
Name Identifier
Table TableName
IndexCat IndexCategory
IfNotExists bool
KeyParts []*KeyPart
IndexOption *IndexOption
MiscOption []MiscOption
// contains filtered or unexported fields
}
func NewCreateIndex ¶
func NewCreateIndex(n Identifier, t TableName, ife bool, it IndexCategory, k []*KeyPart, i *IndexOption, m []MiscOption) *CreateIndex
func (*CreateIndex) Format ¶
func (node *CreateIndex) Format(ctx *FmtCtx)
type CreateOption ¶
type CreateOption interface {
NodeFormatter
}
type CreateOptionCharset ¶
type CreateOptionCharset struct {
IsDefault bool
Charset string
// contains filtered or unexported fields
}
func NewCreateOptionCharset ¶
func NewCreateOptionCharset(c string) *CreateOptionCharset
func (*CreateOptionCharset) Format ¶
func (node *CreateOptionCharset) Format(ctx *FmtCtx)
type CreateOptionCollate ¶
type CreateOptionCollate struct {
IsDefault bool
Collate string
// contains filtered or unexported fields
}
func NewCreateOptionCollate ¶
func NewCreateOptionCollate(c string) *CreateOptionCollate
func (*CreateOptionCollate) Format ¶
func (node *CreateOptionCollate) Format(ctx *FmtCtx)
type CreateOptionDefault ¶
type CreateOptionDefault struct {
// contains filtered or unexported fields
}
type CreateOptionEncryption ¶
type CreateOptionEncryption struct {
Encrypt string
// contains filtered or unexported fields
}
func NewCreateOptionEncryption ¶
func NewCreateOptionEncryption(e string) *CreateOptionEncryption
func (*CreateOptionEncryption) Format ¶
func (node *CreateOptionEncryption) Format(ctx *FmtCtx)
type CreateRole ¶
func NewCreateRole ¶
func NewCreateRole(ife bool, r []*Role) *CreateRole
func (*CreateRole) Format ¶
func (node *CreateRole) Format(ctx *FmtCtx)
type CreateTable ¶
type CreateTable struct {
Temporary bool
IfNotExists bool
Table TableName
Defs TableDefs
Options []TableOption
PartitionOption *PartitionOption
Param *ExternParam
// contains filtered or unexported fields
}
func (*CreateTable) Format ¶
func (node *CreateTable) Format(ctx *FmtCtx)
type CreateUser ¶
type CreateUser struct {
IfNotExists bool
Users []*User
Role *Role
MiscOpt UserMiscOption
// comment or attribute
CommentOrAttribute AccountCommentOrAttribute
// contains filtered or unexported fields
}
func NewCreateUser ¶
func NewCreateUser(ife bool, u []*User, r *Role, misc UserMiscOption) *CreateUser
func (*CreateUser) Format ¶
func (node *CreateUser) Format(ctx *FmtCtx)
type CreateView ¶ added in v0.5.0
type CreateView struct {
Name *TableName
ColNames IdentifierList
AsSource *Select
IfNotExists bool
Temporary bool
// contains filtered or unexported fields
}
func (*CreateView) Format ¶ added in v0.5.0
func (node *CreateView) Format(ctx *FmtCtx)
type Deallocate ¶ added in v0.5.1
type Deallocate struct {
Statement
IsDrop bool
Name Identifier
}
func NewDeallocate ¶ added in v0.5.1
func NewDeallocate(name Identifier, isDrop bool) *Deallocate
func (*Deallocate) Format ¶ added in v0.5.1
func (node *Deallocate) Format(ctx *FmtCtx)
type Declare ¶ added in v0.6.0
type Declare struct {
Variables []string
ColumnType *T
DefaultVal Expr
// contains filtered or unexported fields
}
Declare statement
type DefaultVal ¶
type DefaultVal struct {
Expr Expr
// contains filtered or unexported fields
}
the DEFAULT expression.
func NewDefaultVal ¶
func NewDefaultVal(e Expr) *DefaultVal
func (*DefaultVal) Format ¶
func (node *DefaultVal) Format(ctx *FmtCtx)
type Delete ¶
type Delete struct {
Tables TableExprs
TableRefs TableExprs
PartitionNames IdentifierList
Where *Where
OrderBy OrderBy
Limit *Limit
With *With
// contains filtered or unexported fields
}
Delete statement
type Do ¶ added in v0.6.0
type Do struct {
Exprs []Expr
// contains filtered or unexported fields
}
Do statement
type DropAccount ¶ added in v0.6.0
func (*DropAccount) Format ¶ added in v0.6.0
func (node *DropAccount) Format(ctx *FmtCtx)
type DropDatabase ¶
type DropDatabase struct {
Name Identifier
IfExists bool
// contains filtered or unexported fields
}
DROP Database statement
func NewDropDatabase ¶
func NewDropDatabase(n Identifier, i bool) *DropDatabase
func (*DropDatabase) Format ¶
func (node *DropDatabase) Format(ctx *FmtCtx)
type DropIndex ¶
type DropIndex struct {
Name Identifier
TableName TableName
IfExists bool
MiscOption []MiscOption
// contains filtered or unexported fields
}
func NewDropIndex ¶
func NewDropIndex(i Identifier, t TableName, ife bool, m []MiscOption) *DropIndex
type DropRole ¶
func NewDropRole ¶
type DropTable ¶
type DropTable struct {
IfExists bool
Names TableNames
// contains filtered or unexported fields
}
DROP Table statement
func NewDropTable ¶
func NewDropTable(i bool, n TableNames) *DropTable
type DropUser ¶
func NewDropUser ¶
type DropView ¶ added in v0.6.0
type DropView struct {
IfExists bool
Names TableNames
// contains filtered or unexported fields
}
DropView DROP View statement
func NewDropView ¶ added in v0.6.0
func NewDropView(i bool, n TableNames) *DropView
type DuplicateKey ¶
type DuplicateKey interface{}
type DuplicateKeyError ¶
type DuplicateKeyError struct {
// contains filtered or unexported fields
}
func NewDuplicateKeyError ¶
func NewDuplicateKeyError() *DuplicateKeyError
type DuplicateKeyIgnore ¶
type DuplicateKeyIgnore struct {
// contains filtered or unexported fields
}
func NewDuplicateKeyIgnore ¶
func NewDuplicateKeyIgnore() *DuplicateKeyIgnore
type DuplicateKeyReplace ¶
type DuplicateKeyReplace struct {
// contains filtered or unexported fields
}
func NewDuplicateKeyReplace ¶
func NewDuplicateKeyReplace() *DuplicateKeyReplace
type Execute ¶ added in v0.5.1
type Execute struct {
Statement
Name Identifier
Variables []*VarExpr
}
func NewExecute ¶ added in v0.5.1
func NewExecute(name Identifier) *Execute
func NewExecuteWithVariables ¶ added in v0.5.1
func NewExecuteWithVariables(name Identifier, variables []*VarExpr) *Execute
type ExplainAnalyze ¶
type ExplainAnalyze struct {
// contains filtered or unexported fields
}
EXPLAIN ANALYZE statement
func NewExplainAnalyze ¶
func NewExplainAnalyze(stmt Statement, f string) *ExplainAnalyze
func (*ExplainAnalyze) Format ¶
func (node *ExplainAnalyze) Format(ctx *FmtCtx)
type ExplainFor ¶
type ExplainFor struct {
ID uint64
// contains filtered or unexported fields
}
EXPLAIN FOR CONNECTION statement
func NewExplainFor ¶
func NewExplainFor(f string, id uint64) *ExplainFor
func (*ExplainFor) Format ¶
func (node *ExplainFor) Format(ctx *FmtCtx)
type ExplainStmt ¶
type ExplainStmt struct {
// contains filtered or unexported fields
}
EXPLAIN stmt statement
func NewExplainStmt ¶
func NewExplainStmt(stmt Statement, f string) *ExplainStmt
func (*ExplainStmt) Format ¶
func (node *ExplainStmt) Format(ctx *FmtCtx)
type ExportParam ¶
type ExportParam struct {
// file handler
File *os.File
// bufio.writer
Writer *bufio.Writer
// outfile flag
Outfile bool
// filename path
FilePath string
// Fields
Fields *Fields
// Lines
Lines *Lines
// fileSize
MaxFileSize uint64
// curFileSize
CurFileSize uint64
Rows uint64
FileCnt uint
// header flag
Header bool
ForceQuote []string
ColumnFlag []bool
Symbol [][]byte
// default flush size
DefaultBufSize int64
OutputStr []byte
LineSize uint64
}
func (*ExportParam) Format ¶
func (ep *ExportParam) Format(ctx *FmtCtx)
type ExprList ¶
type ExprList struct {
Exprs Exprs
// contains filtered or unexported fields
}
ast fir the list of expression
type ExternParam ¶ added in v0.6.0
type ExternParam struct {
ScanType int
Filepath string
CompressType string
Format string
JsonData string
Tail *TailParameter
FileService fileservice.FileService
NullMap map[string]([]string)
S3option []string
S3Param *S3Parameter
Ctx context.Context
LoadFile bool
}
type FmtCtx ¶
FmtCtx contains formatted text of the node.
func NewFmtCtx ¶
func NewFmtCtx(dialectType dialect.DialectType, opts ...FmtCtxOption) *FmtCtx
type FmtCtxOption ¶ added in v0.6.0
type FmtCtxOption func(*FmtCtx)
func WithQuoteString ¶ added in v0.6.0
func WithQuoteString(quote bool) FmtCtxOption
func WithSingleQuoteString ¶ added in v0.6.0
func WithSingleQuoteString() FmtCtxOption
func (FmtCtxOption) Apply ¶ added in v0.6.0
func (f FmtCtxOption) Apply(ctx *FmtCtx)
type ForeignKey ¶
type ForeignKey struct {
IfNotExists bool
KeyParts []*KeyPart
Name string
Refer *AttributeReference
Empty bool
// contains filtered or unexported fields
}
func NewForeignKey ¶
func NewForeignKey(ine bool, k []*KeyPart, n string, r *AttributeReference, e bool) *ForeignKey
func (*ForeignKey) Format ¶
func (node *ForeignKey) Format(ctx *FmtCtx)
type From ¶
type From struct {
Tables TableExprs
}
the FROM clause.
func NewFrom ¶
func NewFrom(t TableExprs) *From
type FullTextIndex ¶
type FullTextIndex struct {
KeyParts []*KeyPart
Name string
Empty bool
IndexOption *IndexOption
// contains filtered or unexported fields
}
func NewFullTextIndex ¶
func NewFullTextIndex(k []*KeyPart, n string, e bool, io *IndexOption) *FullTextIndex
func (*FullTextIndex) Format ¶
func (node *FullTextIndex) Format(ctx *FmtCtx)
type FuncExpr ¶
type FuncExpr struct {
Func ResolvableFunctionReference
Type FuncType
Exprs Exprs
//specify the type of aggregation.
AggType AggType
//aggregations which specify an order.
OrderBy OrderBy
// contains filtered or unexported fields
}
function call expression
func NewFuncExpr ¶
func NewFuncExpr(ft FuncType, name *UnresolvedName, e Exprs, order OrderBy) *FuncExpr
type FunctionReference ¶
type FunctionReference interface {
fmt.Stringer
NodeFormatter
}
the common interface to UnresolvedName and QualifiedFunctionName.
type GeoMetadata ¶
type GeoMetadata struct {
}
type Grant ¶
type Grant struct {
Typ GrantType
GrantPrivilege GrantPrivilege
GrantRole GrantRole
GrantProxy GrantProxy
// contains filtered or unexported fields
}
type GrantPrivilege ¶ added in v0.6.0
type GrantPrivilege struct {
Privileges []*Privilege
//grant privileges
ObjType ObjectType
//grant privileges
Level *PrivilegeLevel
Roles []*Role
GrantOption bool
// contains filtered or unexported fields
}
func (*GrantPrivilege) Format ¶ added in v0.6.0
func (node *GrantPrivilege) Format(ctx *FmtCtx)
type GrantProxy ¶ added in v0.6.0
type GrantProxy struct {
ProxyUser *User
Users []*User
GrantOption bool
// contains filtered or unexported fields
}
func (*GrantProxy) Format ¶ added in v0.6.0
func (node *GrantProxy) Format(ctx *FmtCtx)
type GrantRole ¶ added in v0.6.0
type HashType ¶
func NewHashType ¶
type Identifier ¶
type Identifier string
sql indentifier
func (*Identifier) Format ¶
func (node *Identifier) Format(ctx *FmtCtx)
type IdentifierList ¶
type IdentifierList []Identifier
the list of identifiers.
func (*IdentifierList) Format ¶
func (node *IdentifierList) Format(ctx *FmtCtx)
type IdentifierName ¶
type IdentifierName interface {
Expr
}
IdentifierName is referenced in the expression
type Import ¶ added in v0.6.0
type Import struct {
Local bool
DuplicateHandling DuplicateKey
Table *TableName
//Partition
Param *ExternParam
// contains filtered or unexported fields
}
type Index ¶
type Index struct {
IfNotExists bool
KeyParts []*KeyPart
Name string
KeyType IndexType
IndexOption *IndexOption
// contains filtered or unexported fields
}
type IndexCategory ¶
type IndexCategory int
const ( INDEX_CATEGORY_NONE IndexCategory = iota INDEX_CATEGORY_UNIQUE INDEX_CATEGORY_FULLTEXT INDEX_CATEGORY_SPATIAL )
func (IndexCategory) ToString ¶
func (ic IndexCategory) ToString() string
type IndexHint ¶ added in v0.6.0
type IndexHint struct {
IndexNames []string
HintType IndexHintType
HintScope IndexHintScope
}
type IndexHintScope ¶ added in v0.6.0
type IndexHintScope int
const ( HintForScan IndexHintScope = iota + 1 HintForJoin HintForOrderBy HintForGroupBy )
Index hint scopes.
type IndexHintType ¶ added in v0.6.0
type IndexHintType int
const ( HintUse IndexHintType = iota + 1 HintIgnore HintForce )
type IndexOption ¶
type IndexOption struct {
NodeFormatter
KeyBlockSize uint64
IType IndexType
ParserName string
Comment string
Visible VisibleType
EngineAttribute string
SecondaryEngineAttribute string
}
func NewIndexOption ¶
func NewIndexOption(k uint64, i IndexType, p string, c string, v VisibleType, e string, se string) *IndexOption
func (*IndexOption) Format ¶
func (node *IndexOption) Format(ctx *FmtCtx)
Must follow the following sequence when test
type Insert ¶
type Insert struct {
Table TableExpr
PartitionNames IdentifierList
Columns IdentifierList
Rows *Select
OnDuplicateUpdate *UpdateList
// contains filtered or unexported fields
}
the INSERT statement.
func NewInsert ¶
func NewInsert(t TableExpr, c IdentifierList, r *Select, p IdentifierList) *Insert
type InternalType ¶
type InternalType struct {
//the group of types that are compatible with each other
Family Family
FamilyString string
/*
From: https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html
For integer data types, M indicates the maximum display width.
The maximum display width is 255. Display width is unrelated to the range of values a type can store.
For floating-point and fixed-point data types, M is the total number of digits that can be stored.
M is the total number of digits (the precision) and D is the number of digits after the decimal point (the scale).
*/
//the size or scale of the data type, such as number of bits or characters.
Width int32
/*
From: https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html
display width
*/
DisplayWith int32
//the accuracy of the data type.
Precision int32
//Unsigned or not
Unsigned bool
//binary or not
Binary bool
Zerofill bool
Locale *string
//The slice containing the type of each tuple field.
TupleContents []*T
//the slice containing the labels of each tuple field.
TupleLabels []string
//type id
Oid uint32
EnumValues []string
//the type of array elements.
ArrayContents *T
//indicates whether the precision was explicitly set.
//From https://dev.mysql.com/doc/refman/8.0/en/date-and-time-type-syntax.html
//In mysql 8.0. Precision must be in the range 0 to 6.
//A value of 0 signifies that there is no fractional part.
//If omitted, the default precision is 0. (This differs from the standard SQL default of 6, for compatibility with previous MySQL versions.)
// if Precision > 0, the precision
// if TimePrecisionIsSet = true and precision = 0, then the precision = 0
// if TimePrecisionIsSet = false and precision = 0, then the precision has not been indicated,
// so the default value is 0.
TimePrecisionIsSet bool
//interval type
IntervalDurationField *IntervalDurationField
//geospatial types.
GeoMetadata *GeoMetadata
//user defined types that are not arrays.
UDTMetadata *PersistentUserDefinedTypeMetadata
}
for sql type
func (*InternalType) Format ¶
func (node *InternalType) Format(ctx *FmtCtx)
type IntervalDurationField ¶
type IntervalDurationField struct {
}
type IntervalExpr ¶
type IntervalExpr struct {
Expr Expr
Type IntervalType
// contains filtered or unexported fields
}
INTERVAL / time unit
func NewIntervalExpr ¶
func NewIntervalExpr(t IntervalType) *IntervalExpr
func (*IntervalExpr) Format ¶
func (node *IntervalExpr) Format(ctx *FmtCtx)
type IntervalType ¶
type IntervalType int
IntervalType is the type for time and timestamp units.
const ( //an invalid time or timestamp unit INTERVAL_TYPE_INVALID IntervalType = iota //the time or timestamp unit MICROSECOND. INTERVAL_TYPE_MICROSECOND //the time or timestamp unit SECOND. INTERVAL_TYPE_SECOND //the time or timestamp unit MINUTE. INTERVAL_TYPE_MINUTE //the time or timestamp unit HOUR. INTERVAL_TYPE_HOUR //the time or timestamp unit DAY. INTERVAL_TYPE_DAY //the time or timestamp unit WEEK. INTERVAL_TYPE_WEEK //the time or timestamp unit MONTH. INTERVAL_TYPE_MONTH //the time or timestamp unit QUARTER. INTERVAL_TYPE_QUARTER //the time or timestamp unit YEAR. INTERVAL_TYPE_YEAR //the time unit SECOND_MICROSECOND. INTERVAL_TYPE_SECOND_MICROSECOND //the time unit MINUTE_MICROSECOND. INTERVAL_TYPE_MINUTE_MICROSECOND //the time unit MINUTE_SECOND. INTERVAL_TYPE_MINUTE_SECOND //the time unit HOUR_MICROSECOND. INTERVAL_TYPE_HOUR_MICROSECOND //the time unit HOUR_SECOND. INTERVAL_TYPE_HOUR_SECOND //the time unit HOUR_MINUTE. INTERVAL_TYPE_HOUR_MINUTE //the time unit DAY_MICROSECOND. INTERVAL_TYPE_DAY_MICROSECOND //the time unit DAY_SECOND. INTERVAL_TYPE_DAY_SECOND //the time unit DAY_MINUTE. INTERVAL_TYPE_DAYMINUTE //the time unit DAY_HOUR. INTERVAL_TYPE_DAYHOUR //the time unit YEAR_MONTH. INTERVAL_TYPE_YEARMONTH )
func (*IntervalType) ToString ¶
func (node *IntervalType) ToString() string
type IsFalseExpr ¶ added in v0.6.0
type IsFalseExpr struct {
Expr Expr
// contains filtered or unexported fields
}
is false expression
func NewIsFalseExpr ¶ added in v0.6.0
func NewIsFalseExpr(e Expr) *IsFalseExpr
func (*IsFalseExpr) Format ¶ added in v0.6.0
func (node *IsFalseExpr) Format(ctx *FmtCtx)
type IsNotFalseExpr ¶ added in v0.6.0
type IsNotFalseExpr struct {
Expr Expr
// contains filtered or unexported fields
}
is not false expression
func NewIsNotFalseExpr ¶ added in v0.6.0
func NewIsNotFalseExpr(e Expr) *IsNotFalseExpr
func (*IsNotFalseExpr) Format ¶ added in v0.6.0
func (node *IsNotFalseExpr) Format(ctx *FmtCtx)
type IsNotNullExpr ¶
type IsNotNullExpr struct {
Expr Expr
// contains filtered or unexported fields
}
is not null expression
func NewIsNotNullExpr ¶
func NewIsNotNullExpr(e Expr) *IsNotNullExpr
func (*IsNotNullExpr) Format ¶
func (node *IsNotNullExpr) Format(ctx *FmtCtx)
type IsNotTrueExpr ¶ added in v0.6.0
type IsNotTrueExpr struct {
Expr Expr
// contains filtered or unexported fields
}
is not true expression
func NewIsNotTrueExpr ¶ added in v0.6.0
func NewIsNotTrueExpr(e Expr) *IsNotTrueExpr
func (*IsNotTrueExpr) Format ¶ added in v0.6.0
func (node *IsNotTrueExpr) Format(ctx *FmtCtx)
type IsNotUnknownExpr ¶ added in v0.6.0
type IsNotUnknownExpr struct {
Expr Expr
// contains filtered or unexported fields
}
is not unknown expression
func NewIsNotUnknownExpr ¶ added in v0.6.0
func NewIsNotUnknownExpr(e Expr) *IsNotUnknownExpr
func (*IsNotUnknownExpr) Format ¶ added in v0.6.0
func (node *IsNotUnknownExpr) Format(ctx *FmtCtx)
type IsNullExpr ¶
type IsNullExpr struct {
Expr Expr
// contains filtered or unexported fields
}
is null expression
func NewIsNullExpr ¶
func NewIsNullExpr(e Expr) *IsNullExpr
func (*IsNullExpr) Format ¶
func (node *IsNullExpr) Format(ctx *FmtCtx)
type IsTrueExpr ¶ added in v0.6.0
type IsTrueExpr struct {
Expr Expr
// contains filtered or unexported fields
}
is true expression
func NewIsTrueExpr ¶ added in v0.6.0
func NewIsTrueExpr(e Expr) *IsTrueExpr
func (*IsTrueExpr) Format ¶ added in v0.6.0
func (node *IsTrueExpr) Format(ctx *FmtCtx)
type IsUnknownExpr ¶ added in v0.6.0
type IsUnknownExpr struct {
Expr Expr
// contains filtered or unexported fields
}
is unknown expression
func NewIsUnknownExpr ¶ added in v0.6.0
func NewIsUnknownExpr(e Expr) *IsUnknownExpr
func (*IsUnknownExpr) Format ¶ added in v0.6.0
func (node *IsUnknownExpr) Format(ctx *FmtCtx)
type JoinTableExpr ¶
type JoinTableExpr struct {
TableExpr
JoinType string
Left TableExpr
Right TableExpr
Cond JoinCond
}
func NewJoinTableExpr ¶
func NewJoinTableExpr(jt string, l, r TableExpr, jc JoinCond) *JoinTableExpr
func (*JoinTableExpr) Format ¶
func (node *JoinTableExpr) Format(ctx *FmtCtx)
type KeyPart ¶
type KeyPart struct {
ColName *UnresolvedName
Length int
Direction Direction // asc or desc
Expr Expr
// contains filtered or unexported fields
}
func NewKeyPart ¶
func NewKeyPart(c *UnresolvedName, l int, e Expr) *KeyPart
type KeyType ¶
type KeyType struct {
Linear bool
ColumnList []*UnresolvedName
Algorithm int64
// contains filtered or unexported fields
}
func NewKeyType ¶
func NewKeyType(l bool, c []*UnresolvedName) *KeyType
type LengthScaleOpt ¶
type ListType ¶
type ListType struct {
Expr Expr
ColumnList []*UnresolvedName
// contains filtered or unexported fields
}
func NewListType ¶
func NewListType(e Expr, c []*UnresolvedName) *ListType
type Load ¶
type Load struct {
Local bool
DuplicateHandling DuplicateKey
Table *TableName
//Partition
Param *ExternParam
// contains filtered or unexported fields
}
Load data statement
type LoadColumn ¶
type LoadColumn interface {
NodeFormatter
}
column element in load data column list
type LockDefault ¶
type LockDefault struct {
// contains filtered or unexported fields
}
type LockExclusive ¶
type LockExclusive struct {
// contains filtered or unexported fields
}
type LockShared ¶
type LockShared struct {
// contains filtered or unexported fields
}
type MaxValue ¶
type MaxValue struct {
// contains filtered or unexported fields
}
func NewMaxValue ¶
func NewMaxValue() *MaxValue
type MiscOption ¶
type MiscOption interface {
NodeFormatter
}
type MoDump ¶ added in v0.6.0
type MoDump struct {
Database Identifier
Tables TableNames
OutFile string
MaxFileSize int64
// contains filtered or unexported fields
}
type NaturalJoinCond ¶
type NaturalJoinCond struct {
JoinCond
}
the NATURAL join condition
func NewNaturalJoinCond ¶
func NewNaturalJoinCond() *NaturalJoinCond
func (*NaturalJoinCond) Format ¶
func (node *NaturalJoinCond) Format(ctx *FmtCtx)
type NodeFormatter ¶
type NodeFormatter interface {
Format(ctx *FmtCtx)
}
NodeFormatter for formatted output of the node.
type NotExpr ¶
type NotExpr struct {
Expr Expr
// contains filtered or unexported fields
}
not expression
func NewNotExpr ¶
type NullsPosition ¶ added in v0.6.0
type NullsPosition int8
const ( DefaultNullsPosition NullsPosition = iota NullsFirst NullsLast )
func (NullsPosition) String ¶ added in v0.6.0
func (np NullsPosition) String() string
type NumVal ¶
type NumVal struct {
Constant
Value constant.Value
ValType P_TYPE
// contains filtered or unexported fields
}
the AST for the constant numeric value.
func NewNumValWithResFoalt ¶
func NewNumValWithResInt ¶
func NewNumValWithType ¶ added in v0.5.0
type ObjectName ¶
type ObjectName interface {
NodeFormatter
}
the common interface for qualified object names
type ObjectNamePrefix ¶
type ObjectNamePrefix struct {
CatalogName Identifier
SchemaName Identifier
//true iff the catalog was explicitly specified
ExplicitCatalog bool
//true iff the schema was explicitly specified
ExplicitSchema bool
}
the path prefix of an object name.
type ObjectType ¶
type ObjectType int
const ( OBJECT_TYPE_NONE ObjectType = iota OBJECT_TYPE_TABLE OBJECT_TYPE_DATABASE OBJECT_TYPE_FUNCTION OBJECT_TYPE_PROCEDURE OBJECT_TYPE_VIEW OBJECT_TYPE_ACCOUNT )
func (*ObjectType) String ¶ added in v0.6.0
func (node *ObjectType) String() string
type OnJoinCond ¶
the ON condition for join
func NewOnJoinCond ¶
func NewOnJoinCond(e Expr) *OnJoinCond
func (*OnJoinCond) Format ¶
func (node *OnJoinCond) Format(ctx *FmtCtx)
type OptionElem ¶ added in v0.5.0
func MakeOptionElem ¶ added in v0.5.0
func MakeOptionElem(name string, value string) OptionElem
func MakeOptions ¶ added in v0.5.0
func MakeOptions(elem OptionElem) []OptionElem
type OrExpr ¶
type OrExpr struct {
Left, Right Expr
// contains filtered or unexported fields
}
or expression
type Order ¶
type Order struct {
Expr Expr
Direction Direction
NullsPosition NullsPosition
//without order
NullOrder bool
}
the ordering expression.
type ParamExpr ¶ added in v0.5.1
type ParamExpr struct {
Offset int
// contains filtered or unexported fields
}
select a from t1 where a > ?
func NewParamExpr ¶ added in v0.5.1
type ParenExpr ¶
type ParenExpr struct {
Expr Expr
// contains filtered or unexported fields
}
the parenthesized expression.
func NewParenExpr ¶
type ParenSelect ¶
type ParenSelect struct {
SelectStatement
Select *Select
}
the parenthesized SELECT/UNION/VALUES statement.
func (*ParenSelect) Format ¶
func (node *ParenSelect) Format(ctx *FmtCtx)
type ParenTableExpr ¶
the parenthesized TableExpr.
func NewParenTableExpr ¶
func NewParenTableExpr(e TableExpr) *ParenTableExpr
func (*ParenTableExpr) Format ¶
func (node *ParenTableExpr) Format(ctx *FmtCtx)
type Partition ¶
type Partition struct {
Name Identifier
Values Values
Options []TableOption
Subs []*SubPartition
}
func NewPartition ¶
func NewPartition(n Identifier, v Values, o []TableOption, s []*SubPartition) *Partition
type PartitionBy ¶
type PartitionBy struct {
IsSubPartition bool // for format
PType PartitionType
Num uint64
}
func NewPartitionBy ¶
func NewPartitionBy(pt PartitionType, n uint64) *PartitionBy
func (*PartitionBy) Format ¶
func (node *PartitionBy) Format(ctx *FmtCtx)
type PartitionOption ¶
type PartitionOption struct {
PartBy PartitionBy
SubPartBy *PartitionBy
Partitions []*Partition
}
func NewPartitionOption ¶
func NewPartitionOption(pb *PartitionBy, spb *PartitionBy, parts []*Partition) *PartitionOption
func (*PartitionOption) Format ¶
func (node *PartitionOption) Format(ctx *FmtCtx)
type PartitionType ¶
type PartitionType interface {
NodeFormatter
}
type PersistentUserDefinedTypeMetadata ¶
type PersistentUserDefinedTypeMetadata struct {
}
type Precedence ¶ added in v0.5.0
type Precedence int
const ( Syntactic Precedence = iota P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15 P16 P17 )
type PrepareStmt ¶ added in v0.5.1
type PrepareStmt struct {
Name Identifier
Stmt Statement
// contains filtered or unexported fields
}
func NewPrepareStmt ¶ added in v0.5.1
func NewPrepareStmt(name Identifier, statement Statement) *PrepareStmt
func (*PrepareStmt) Format ¶ added in v0.5.1
func (node *PrepareStmt) Format(ctx *FmtCtx)
type PrepareString ¶ added in v0.5.1
type PrepareString struct {
Name Identifier
Sql string
// contains filtered or unexported fields
}
func NewPrepareString ¶ added in v0.5.1
func NewPrepareString(name Identifier, sql string) *PrepareString
func (*PrepareString) Format ¶ added in v0.5.1
func (node *PrepareString) Format(ctx *FmtCtx)
type PrimaryKeyIndex ¶
type PrimaryKeyIndex struct {
KeyParts []*KeyPart
Name string
Empty bool
IndexOption *IndexOption
// contains filtered or unexported fields
}
func NewPrimaryKeyIndex ¶
func NewPrimaryKeyIndex(k []*KeyPart, n string, e bool, io *IndexOption) *PrimaryKeyIndex
func (*PrimaryKeyIndex) Format ¶
func (node *PrimaryKeyIndex) Format(ctx *FmtCtx)
type Privilege ¶
type Privilege struct {
NodeFormatter
Type PrivilegeType
ColumnList []*UnresolvedName
}
func NewPrivilege ¶
func NewPrivilege(t PrivilegeType, c []*UnresolvedName) *Privilege
type PrivilegeLevel ¶
type PrivilegeLevel struct {
NodeFormatter
Level PrivilegeLevelType
DbName string
TabName string
RoutineName string
}
func NewPrivilegeLevel ¶
func NewPrivilegeLevel(l PrivilegeLevelType, d, t, r string) *PrivilegeLevel
func (*PrivilegeLevel) Format ¶
func (node *PrivilegeLevel) Format(ctx *FmtCtx)
func (*PrivilegeLevel) String ¶ added in v0.6.0
func (node *PrivilegeLevel) String() string
type PrivilegeLevelType ¶
type PrivilegeLevelType int
const ( PRIVILEGE_LEVEL_TYPE_STAR PrivilegeLevelType = iota //* PRIVILEGE_LEVEL_TYPE_STAR_STAR //*.* PRIVILEGE_LEVEL_TYPE_DATABASE //db_name PRIVILEGE_LEVEL_TYPE_DATABASE_STAR //db_name.* PRIVILEGE_LEVEL_TYPE_DATABASE_TABLE //db_name.tbl_name PRIVILEGE_LEVEL_TYPE_TABLE //tbl_name PRIVILEGE_LEVEL_TYPE_COLUMN // (x,x) PRIVILEGE_LEVEL_TYPE_STORED_ROUTINE //procedure PRIVILEGE_LEVEL_TYPE_PROXY PRIVILEGE_LEVEL_TYPE_ROUTINE )
type PrivilegeType ¶
type PrivilegeType int
const ( PRIVILEGE_TYPE_STATIC_ALL PrivilegeType = iota //Grant all privileges at specified access level except GRANT OPTION and PROXY. PRIVILEGE_TYPE_STATIC_CREATE_ACCOUNT PRIVILEGE_TYPE_STATIC_DROP_ACCOUNT PRIVILEGE_TYPE_STATIC_ALTER_ACCOUNT PRIVILEGE_TYPE_STATIC_CREATE_USER //Enable use of CREATE USER, DROP USER, RENAME USER, and REVOKE ALL PRIVILEGES. Level: Global. PRIVILEGE_TYPE_STATIC_DROP_USER PRIVILEGE_TYPE_STATIC_ALTER_USER PRIVILEGE_TYPE_STATIC_CREATE_ROLE //Enable role creation. Level: Global. PRIVILEGE_TYPE_STATIC_DROP_ROLE //Enable roles to be dropped. Level: Global. PRIVILEGE_TYPE_STATIC_ALTER_ROLE PRIVILEGE_TYPE_STATIC_CREATE_DATABASE PRIVILEGE_TYPE_STATIC_DROP_DATABASE PRIVILEGE_TYPE_STATIC_SHOW_DATABASES //Enable SHOW DATABASES to show all databases. Level: Global. PRIVILEGE_TYPE_STATIC_CONNECT PRIVILEGE_TYPE_STATIC_MANAGE_GRANTS PRIVILEGE_TYPE_STATIC_OWNERSHIP PRIVILEGE_TYPE_STATIC_SHOW_TABLES PRIVILEGE_TYPE_STATIC_CREATE_TABLE PRIVILEGE_TYPE_STATIC_DROP_TABLE PRIVILEGE_TYPE_STATIC_DROP_VIEW PRIVILEGE_TYPE_STATIC_ALTER_TABLE PRIVILEGE_TYPE_STATIC_ALTER_VIEW PRIVILEGE_TYPE_STATIC_SELECT //Enable use of SELECT. Levels: Global, database, table, column. PRIVILEGE_TYPE_STATIC_INSERT //Enable use of INSERT. Levels: Global, database, table, column. PRIVILEGE_TYPE_STATIC_TRUNCATE //Enable use of REPLACE. Levels: Global, database, table, column. PRIVILEGE_TYPE_STATIC_UPDATE //Enable use of UPDATE. Levels: Global, database, table, column. PRIVILEGE_TYPE_STATIC_DELETE //Enable use of DELETE. Level: Global, database, table. PRIVILEGE_TYPE_STATIC_REFERENCES //Enable foreign key creation. Levels: Global, database, table, column. PRIVILEGE_TYPE_STATIC_REFERENCE PRIVILEGE_TYPE_STATIC_INDEX //Enable indexes to be created or dropped. Levels: Global, database, table. PRIVILEGE_TYPE_STATIC_EXECUTE //Enable the user to execute stored routines. Levels: Global, database, routine. PRIVILEGE_TYPE_STATIC_VALUES //Enable use of VALUES. Levels: Global, database, table. PRIVILEGE_TYPE_STATIC_ALTER PRIVILEGE_TYPE_STATIC_CREATE PRIVILEGE_TYPE_STATIC_DROP PRIVILEGE_TYPE_STATIC_ALTER_ROUTINE //Enable stored routines to be altered or dropped. Levels: Global, database, routine. PRIVILEGE_TYPE_STATIC_CREATE_ROUTINE //Enable stored routine creation. Levels: Global, database. PRIVILEGE_TYPE_STATIC_CREATE_TABLESPACE //Enable tablespaces and log file groups to be created, altered, or dropped. Level: Global. PRIVILEGE_TYPE_STATIC_CREATE_TEMPORARY_TABLES //Enable use of CREATE TEMPORARY TABLE. Levels: Global, database. PRIVILEGE_TYPE_STATIC_CREATE_VIEW //Enable views to be created or altered. Levels: Global, database, table. PRIVILEGE_TYPE_STATIC_EVENT //Enable use of events for the Event Scheduler. Levels: Global, database. PRIVILEGE_TYPE_STATIC_FILE //Enable the user to cause the server to read or write files. Level: Global. PRIVILEGE_TYPE_STATIC_GRANT_OPTION //Enable privileges to be granted to or removed from other accounts. Levels: Global, database, table, routine, proxy. PRIVILEGE_TYPE_STATIC_LOCK_TABLES //Enable use of LOCK TABLES on tables for which you have the SELECT privilege. Levels: Global, database. PRIVILEGE_TYPE_STATIC_PROCESS //Enable the user to see all processes with SHOW PROCESSLIST. Level: Global. PRIVILEGE_TYPE_STATIC_PROXY //Enable user proxying. Level: From user to user. PRIVILEGE_TYPE_STATIC_RELOAD //Enable use of FLUSH operations. Level: Global. PRIVILEGE_TYPE_STATIC_REPLICATION_CLIENT //Enable the user to ask where source or replica servers are. Level: Global. PRIVILEGE_TYPE_STATIC_REPLICATION_SLAVE //Enable replicas to read binary log events from the source. Level: Global. PRIVILEGE_TYPE_STATIC_SHOW_VIEW //Enable use of SHOW CREATE VIEW. Levels: Global, database, table. PRIVILEGE_TYPE_STATIC_SHUTDOWN //Enable use of mysqladmin shutdown. Level: Global. PRIVILEGE_TYPE_STATIC_SUPER //Enable use of other administrative operations such as CHANGE REPLICATION SOURCE TO, CHANGE MASTER TO, KILL, PURGE BINARY LOGS, SET GLOBAL, and mysqladmin debug command. Level: Global. PRIVILEGE_TYPE_STATIC_TRIGGER //Enable trigger operations. Levels: Global, database, table. PRIVILEGE_TYPE_STATIC_USAGE //Synonym for “no privileges” PRIVILEGE_TYPE_ PRIVILEGE_TYPE_DYNAMIC_APPLICATION_PASSWORD_ADMIN //Enable dual password administration. Level: Global. PRIVILEGE_TYPE_DYNAMIC_AUDIT_ADMIN //Enable audit log configuration. Level: Global. PRIVILEGE_TYPE_DYNAMIC_BACKUP_ADMIN //Enable backup administration. Level: Global. PRIVILEGE_TYPE_DYNAMIC_BINLOG_ADMIN //Enable binary log control. Level: Global. PRIVILEGE_TYPE_DYNAMIC_BINLOG_ENCRYPTION_ADMIN //Enable activation and deactivation of binary log encryption. Level: Global. PRIVILEGE_TYPE_DYNAMIC_CLONE_ADMIN //Enable clone administration. Level: Global. PRIVILEGE_TYPE_DYNAMIC_CONNECTION_ADMIN //Enable connection limit/restriction control. Level: Global. PRIVILEGE_TYPE_DYNAMIC_ENCRYPTION_KEY_ADMIN //Enable InnoDB key rotation. Level: Global. PRIVILEGE_TYPE_DYNAMIC_FIREWALL_ADMIN //Enable firewall rule administration, any user. Level: Global. PRIVILEGE_TYPE_DYNAMIC_FIREWALL_EXEMPT //Exempt user from firewall restrictions. Level: Global. PRIVILEGE_TYPE_DYNAMIC_FIREWALL_USER //Enable firewall rule administration, self. Level: Global. PRIVILEGE_TYPE_DYNAMIC_FLUSH_OPTIMIZER_COSTS //Enable optimizer cost reloading. Level: Global. PRIVILEGE_TYPE_DYNAMIC_FLUSH_STATUS //Enable status indicator flushing. Level: Global. PRIVILEGE_TYPE_DYNAMIC_FLUSH_TABLES //Enable table flushing. Level: Global. PRIVILEGE_TYPE_DYNAMIC_FLUSH_USER_RESOURCES //Enable user-resource flushing. Level: Global. PRIVILEGE_TYPE_DYNAMIC_GROUP_REPLICATION_ADMIN //Enable Group Replication control. Level: Global. PRIVILEGE_TYPE_DYNAMIC_INNODB_REDO_LOG_Enable //Enable or disable redo logging. Level: Global. PRIVILEGE_TYPE_DYNAMIC_INNODB_REDO_LOG_ARCHIVE //Enable redo log archiving administration. Level: Global. PRIVILEGE_TYPE_DYNAMIC_NDB_STORED_USER //Enable sharing of user or role between SQL nodes (NDB Cluster). Level: Global. PRIVILEGE_TYPE_DYNAMIC_PERSIST_RO_VARIABLES_ADMIN //Enable persisting read-only system variables. Level: Global. PRIVILEGE_TYPE_DYNAMIC_REPLICATION_APPLIER //Act as the PRIVILEGE_CHECKS_USER for a replication channel. Level: Global. PRIVILEGE_TYPE_DYNAMIC_REPLICATION_SLAVE_ADMIN //Enable regular replication control. Level: Global. PRIVILEGE_TYPE_DYNAMIC_RESOURCE_GROUP_ADMIN //Enable resource group administration. Level: Global. PRIVILEGE_TYPE_DYNAMIC_RESOURCE_GROUP_USER //Enable resource group administration. Level: Global. PRIVILEGE_TYPE_DYNAMIC_ROLE_ADMIN //Enable roles to be granted or revoked, use of WITH ADMIN OPTION. Level: Global. PRIVILEGE_TYPE_DYNAMIC_SESSION_VARIABLES_ADMIN //Enable setting restricted session system variables. Level: Global. PRIVILEGE_TYPE_DYNAMIC_SET_USER_ID //Enable setting non-self DEFINER values. Level: Global. PRIVILEGE_TYPE_DYNAMIC_SHOW_ROUTINE //Enable access to stored routine definitions. Level: Global. PRIVILEGE_TYPE_DYNAMIC_SYSTEM_USER //Designate account as system account. Level: Global. PRIVILEGE_TYPE_DYNAMIC_SYSTEM_VARIABLES_ADMIN //Enable modifying or persisting global system variables. Level: Global. PRIVILEGE_TYPE_DYNAMIC_TABLE_ENCRYPTION_ADMIN //Enable overriding default encryption settings. Level: Global. PRIVILEGE_TYPE_DYNAMIC_VERSION_TOKEN_ADMIN //Enable use of Version Tokens functions. Level: Global. PRIVILEGE_TYPE_DYNAMIC_XA_RECOVER_ADMIN //Enable XA RECOVER execution. Level: Global. )
func (*PrivilegeType) ToString ¶
func (node *PrivilegeType) ToString() string
type RangeCond ¶
type RangeCond struct {
Not bool
Left Expr
From, To Expr
// contains filtered or unexported fields
}
the BETWEEN or a NOT BETWEEN expression
func NewRangeCond ¶
type RangeType ¶
type RangeType struct {
Expr Expr
ColumnList []*UnresolvedName
// contains filtered or unexported fields
}
func NewRangeType ¶
func NewRangeType(e Expr, c []*UnresolvedName) *RangeType
type ReadWriteMode ¶
type ReadWriteMode int
the read and write mode for a transaction.
const ( READ_WRITE_MODE_NONE ReadWriteMode = iota READ_WRITE_MODE_READ_ONLY READ_WRITE_MODE_READ_WRITE )
type ReferenceOnRecord ¶
type ReferenceOnRecord struct {
OnDelete ReferenceOptionType
OnUpdate ReferenceOptionType
}
type ReferenceOptionType ¶
type ReferenceOptionType int
const ( REFERENCE_OPTION_INVALID ReferenceOptionType = iota REFERENCE_OPTION_RESTRICT REFERENCE_OPTION_CASCADE REFERENCE_OPTION_SET_NULL REFERENCE_OPTION_NO_ACTION REFERENCE_OPTION_SET_DEFAULT )
Reference option
func (*ReferenceOptionType) ToString ¶
func (node *ReferenceOptionType) ToString() string
type Replace ¶ added in v0.6.0
type Replace struct {
Table TableExpr
PartitionNames IdentifierList
Columns IdentifierList
Rows *Select
// contains filtered or unexported fields
}
the REPLACE statement.
func NewReplace ¶ added in v0.6.0
func NewReplace(t TableExpr, c IdentifierList, r *Select, p IdentifierList) *Replace
type ResolvableFunctionReference ¶
type ResolvableFunctionReference struct {
FunctionReference
}
function reference
func FuncName2ResolvableFunctionReference ¶
func FuncName2ResolvableFunctionReference(funcName *UnresolvedName) ResolvableFunctionReference
func (*ResolvableFunctionReference) Format ¶
func (node *ResolvableFunctionReference) Format(ctx *FmtCtx)
type ResourceOption ¶
type ResourceOption interface {
NodeFormatter
}
type ResourceOptionMaxConnectionPerHour ¶
type ResourceOptionMaxConnectionPerHour struct {
Count int64
// contains filtered or unexported fields
}
func (*ResourceOptionMaxConnectionPerHour) Format ¶
func (node *ResourceOptionMaxConnectionPerHour) Format(ctx *FmtCtx)
type ResourceOptionMaxQueriesPerHour ¶
type ResourceOptionMaxQueriesPerHour struct {
Count int64
// contains filtered or unexported fields
}
func (*ResourceOptionMaxQueriesPerHour) Format ¶
func (node *ResourceOptionMaxQueriesPerHour) Format(ctx *FmtCtx)
type ResourceOptionMaxUpdatesPerHour ¶
type ResourceOptionMaxUpdatesPerHour struct {
Count int64
// contains filtered or unexported fields
}
func (*ResourceOptionMaxUpdatesPerHour) Format ¶
func (node *ResourceOptionMaxUpdatesPerHour) Format(ctx *FmtCtx)
type ResourceOptionMaxUserConnections ¶
type ResourceOptionMaxUserConnections struct {
Count int64
// contains filtered or unexported fields
}
func (*ResourceOptionMaxUserConnections) Format ¶
func (node *ResourceOptionMaxUserConnections) Format(ctx *FmtCtx)
type Revoke ¶
type Revoke struct {
Typ RevokeType
RevokePrivilege RevokePrivilege
RevokeRole RevokeRole
// contains filtered or unexported fields
}
type RevokePrivilege ¶ added in v0.6.0
type RevokePrivilege struct {
IfExists bool
Privileges []*Privilege
ObjType ObjectType
Level *PrivilegeLevel
Roles []*Role
// contains filtered or unexported fields
}
func (*RevokePrivilege) Format ¶ added in v0.6.0
func (node *RevokePrivilege) Format(ctx *FmtCtx)
type RevokeRole ¶ added in v0.6.0
type RevokeRole struct {
IfExists bool
Roles []*Role
Users []*User
// contains filtered or unexported fields
}
func (*RevokeRole) Format ¶ added in v0.6.0
func (node *RevokeRole) Format(ctx *FmtCtx)
type RevokeType ¶ added in v0.6.0
type RevokeType int
const ( RevokeTypePrivilege RevokeType = iota RevokeTypeRole )
type Role ¶
type Role struct {
NodeFormatter
UserName string
}
type RollbackTransaction ¶
type RollbackTransaction struct {
Type CompletionType
// contains filtered or unexported fields
}
Rollback statement
func NewRollbackTransaction ¶
func NewRollbackTransaction(t CompletionType) *RollbackTransaction
func (*RollbackTransaction) Format ¶
func (node *RollbackTransaction) Format(ctx *FmtCtx)
type RowFormatType ¶
type RowFormatType uint64
const ( ROW_FORMAT_DEFAULT RowFormatType = iota ROW_FORMAT_DYNAMIC ROW_FORMAT_FIXED ROW_FORMAT_COMPRESSED ROW_FORMAT_REDUNDANT ROW_FORMAT_COMPACT )
func (*RowFormatType) ToString ¶
func (node *RowFormatType) ToString() string
type S3Parameter ¶ added in v0.6.0
type SecondaryRoleType ¶ added in v0.6.0
type SecondaryRoleType int
const ( SecondaryRoleTypeAll SecondaryRoleType = iota SecondaryRoleTypeNone )
type Select ¶
type Select struct {
Select SelectStatement
OrderBy OrderBy
Limit *Limit
With *With
Ep *ExportParam
// contains filtered or unexported fields
}
Select represents a SelectStatement with an ORDER and/or LIMIT.
type SelectClause ¶
type SelectClause struct {
SelectStatement
Distinct bool
Exprs SelectExprs
From *From
Where *Where
GroupBy GroupBy
Having *Where
Option string
}
SelectClause represents a SELECT statement.
func (*SelectClause) Format ¶
func (node *SelectClause) Format(ctx *FmtCtx)
type SelectExpr ¶
type SelectExpr struct {
Expr Expr
As UnrestrictedIdentifier
// contains filtered or unexported fields
}
a SELECT expression.
func (*SelectExpr) Format ¶
func (node *SelectExpr) Format(ctx *FmtCtx)
type SelectExprs ¶
type SelectExprs []SelectExpr
SELECT expressions.
func (*SelectExprs) Format ¶
func (node *SelectExprs) Format(ctx *FmtCtx)
type SelectStatement ¶
type SelectStatement interface {
Statement
}
type SetDefaultRole ¶
type SetDefaultRole struct {
Type SetDefaultRoleType
Roles []*Role
Users []*User
// contains filtered or unexported fields
}
func NewSetDefaultRole ¶
func NewSetDefaultRole(t SetDefaultRoleType, r []*Role, u []*User) *SetDefaultRole
func (*SetDefaultRole) Format ¶
func (node *SetDefaultRole) Format(ctx *FmtCtx)
type SetDefaultRoleType ¶
type SetDefaultRoleType int
const ( SET_DEFAULT_ROLE_TYPE_NONE SetDefaultRoleType = iota SET_DEFAULT_ROLE_TYPE_ALL SET_DEFAULT_ROLE_TYPE_NORMAL )
type SetPassword ¶
func NewSetPassword ¶
func NewSetPassword(u *User, p string) *SetPassword
func (*SetPassword) Format ¶
func (node *SetPassword) Format(ctx *FmtCtx)
type SetRole ¶
type SetRole struct {
SecondaryRole bool
SecondaryRoleType SecondaryRoleType
Role *Role
// contains filtered or unexported fields
}
type SetRoleType ¶
type SetRoleType int
const ( SET_ROLE_TYPE_NORMAL SetRoleType = iota SET_ROLE_TYPE_DEFAULT SET_ROLE_TYPE_NONE SET_ROLE_TYPE_ALL SET_ROLE_TYPE_ALL_EXCEPT )
type SetVar ¶
type SetVar struct {
Assignments []*VarAssignmentExpr
// contains filtered or unexported fields
}
func NewSetVar ¶
func NewSetVar(a []*VarAssignmentExpr) *SetVar
type ShowCollation ¶ added in v0.6.0
type ShowCollation struct {
Like *ComparisonExpr
Where *Where
// contains filtered or unexported fields
}
SHOW collation statement
func (*ShowCollation) Format ¶ added in v0.6.0
func (node *ShowCollation) Format(ctx *FmtCtx)
type ShowColumns ¶
type ShowColumns struct {
Ext bool
Full bool
Table *UnresolvedObjectName
ColName *UnresolvedName
DBName string
Like *ComparisonExpr
Where *Where
// contains filtered or unexported fields
}
SHOW COLUMNS statement.
func NewShowColumns ¶
func NewShowColumns(e bool, f bool, t *UnresolvedObjectName, d string, l *ComparisonExpr, w *Where, cn *UnresolvedName) *ShowColumns
func (*ShowColumns) Format ¶
func (node *ShowColumns) Format(ctx *FmtCtx)
type ShowCreateDatabase ¶
type ShowCreateDatabase struct {
IfNotExists bool
Name string
// contains filtered or unexported fields
}
SHOW CREATE DATABASE statement
func NewShowCreateDatabase ¶
func NewShowCreateDatabase(i bool, n string) *ShowCreateDatabase
func (*ShowCreateDatabase) Format ¶
func (node *ShowCreateDatabase) Format(ctx *FmtCtx)
type ShowCreateTable ¶
type ShowCreateTable struct {
Name *UnresolvedObjectName
// contains filtered or unexported fields
}
SHOW CREATE TABLE statement
func NewShowCreate ¶
func NewShowCreate(n *UnresolvedObjectName) *ShowCreateTable
func (*ShowCreateTable) Format ¶
func (node *ShowCreateTable) Format(ctx *FmtCtx)
type ShowCreateView ¶ added in v0.6.0
type ShowCreateView struct {
Name *UnresolvedObjectName
// contains filtered or unexported fields
}
SHOW CREATE VIEW statement
func NewShowCreateView ¶ added in v0.6.0
func NewShowCreateView(n *UnresolvedObjectName) *ShowCreateView
func (*ShowCreateView) Format ¶ added in v0.6.0
func (node *ShowCreateView) Format(ctx *FmtCtx)
type ShowDatabases ¶
type ShowDatabases struct {
Like *ComparisonExpr
Where *Where
// contains filtered or unexported fields
}
the SHOW DATABASES statement.
func NewShowDatabases ¶
func NewShowDatabases(l *ComparisonExpr, w *Where) *ShowDatabases
func (*ShowDatabases) Format ¶
func (node *ShowDatabases) Format(ctx *FmtCtx)
type ShowErrors ¶
type ShowErrors struct {
// contains filtered or unexported fields
}
func NewShowErrors ¶
func NewShowErrors() *ShowErrors
func (*ShowErrors) Format ¶
func (node *ShowErrors) Format(ctx *FmtCtx)
type ShowGrants ¶ added in v0.6.0
type ShowGrants struct {
Username string
Hostname string
Roles []*Role
// contains filtered or unexported fields
}
func (*ShowGrants) Format ¶ added in v0.6.0
func (node *ShowGrants) Format(ctx *FmtCtx)
type ShowIndex ¶
type ShowIndex struct {
TableName TableName
Where *Where
// contains filtered or unexported fields
}
show index statement
func NewShowIndex ¶
type ShowProcessList ¶
type ShowProcessList struct {
Full bool
// contains filtered or unexported fields
}
SHOW PROCESSLIST
func NewShowProcessList ¶
func NewShowProcessList(f bool) *ShowProcessList
func (*ShowProcessList) Format ¶
func (node *ShowProcessList) Format(ctx *FmtCtx)
type ShowStatus ¶
type ShowStatus struct {
Global bool
Like *ComparisonExpr
Where *Where
// contains filtered or unexported fields
}
SHOW STATUS statement
func NewShowStatus ¶
func NewShowStatus(g bool, l *ComparisonExpr, w *Where) *ShowStatus
func (*ShowStatus) Format ¶
func (node *ShowStatus) Format(ctx *FmtCtx)
type ShowTableStatus ¶ added in v0.6.0
type ShowTableStatus struct {
DbName string
Like *ComparisonExpr
Where *Where
// contains filtered or unexported fields
}
func (*ShowTableStatus) Format ¶ added in v0.6.0
func (node *ShowTableStatus) Format(ctx *FmtCtx)
type ShowTables ¶
type ShowTables struct {
Ext bool
Open bool
Full bool
DBName string
Like *ComparisonExpr
Where *Where
// contains filtered or unexported fields
}
SHOW TABLES statement.
func NewShowTables ¶
func NewShowTables(e bool, f bool, n string, l *ComparisonExpr, w *Where) *ShowTables
func (*ShowTables) Format ¶
func (node *ShowTables) Format(ctx *FmtCtx)
type ShowTarget ¶ added in v0.5.0
type ShowTarget struct {
Global bool
Type ShowType
DbName string
Like *ComparisonExpr
Where *Where
// contains filtered or unexported fields
}
func (*ShowTarget) Format ¶ added in v0.5.0
func (node *ShowTarget) Format(ctx *FmtCtx)
type ShowVariables ¶
type ShowVariables struct {
Global bool
Like *ComparisonExpr
Where *Where
// contains filtered or unexported fields
}
SHOW VARIABLES statement System Variables
func NewShowVariables ¶
func NewShowVariables(g bool, l *ComparisonExpr, w *Where) *ShowVariables
func (*ShowVariables) Format ¶
func (node *ShowVariables) Format(ctx *FmtCtx)
type ShowWarnings ¶
type ShowWarnings struct {
// contains filtered or unexported fields
}
func NewShowWarnings ¶
func NewShowWarnings() *ShowWarnings
func (*ShowWarnings) Format ¶
func (node *ShowWarnings) Format(ctx *FmtCtx)
type Statement ¶
type Statement interface {
fmt.Stringer
NodeFormatter
}
type StatementSource ¶
the statements as a data source includes the select statement.
func NewStatementSource ¶
func NewStatementSource(s Statement) *StatementSource
type StrVal ¶
type StrVal struct {
Constant
// contains filtered or unexported fields
}
StrVal represents a constant string value.
type SubPartition ¶
type SubPartition struct {
Name Identifier
Options []TableOption
}
func NewSubPartition ¶
func NewSubPartition(n Identifier, o []TableOption) *SubPartition
func (*SubPartition) Format ¶
func (node *SubPartition) Format(ctx *FmtCtx)
type Subquery ¶
type Subquery struct {
SubqueryExpr
Select SelectStatement
Exists bool
}
subquery
func NewSubquery ¶
func NewSubquery(s SelectStatement, e bool) *Subquery
type TableDef ¶
type TableDef interface {
NodeFormatter
}
type TableExprs ¶
type TableExprs []TableExpr
the list of table expressions.
func (*TableExprs) Format ¶
func (node *TableExprs) Format(ctx *FmtCtx)
type TableFunction ¶ added in v0.6.0
type TableFunction struct {
Func *FuncExpr
SelectStmt *Select
// contains filtered or unexported fields
}
func (*TableFunction) Format ¶ added in v0.6.0
func (t *TableFunction) Format(ctx *FmtCtx)
func (TableFunction) Id ¶ added in v0.6.0
func (t TableFunction) Id() string
type TableName ¶
type TableName struct {
TableExpr
// contains filtered or unexported fields
}
func NewTableName ¶
func NewTableName(name Identifier, prefix ObjectNamePrefix) *TableName
func (*TableName) Catalog ¶
func (tn *TableName) Catalog() Identifier
func (*TableName) Name ¶
func (tn *TableName) Name() Identifier
func (*TableName) Schema ¶
func (tn *TableName) Schema() Identifier
type TableNames ¶
type TableNames []*TableName
table name array
func (*TableNames) Format ¶
func (node *TableNames) Format(ctx *FmtCtx)
type TableOption ¶
type TableOption interface {
NodeFormatter
}
type TableOptionAutoIncrement ¶
type TableOptionAutoIncrement struct {
Value uint64
// contains filtered or unexported fields
}
func NewTableOptionAutoIncrement ¶
func NewTableOptionAutoIncrement(v uint64) *TableOptionAutoIncrement
func (*TableOptionAutoIncrement) Format ¶
func (node *TableOptionAutoIncrement) Format(ctx *FmtCtx)
type TableOptionAvgRowLength ¶
type TableOptionAvgRowLength struct {
Length uint64
// contains filtered or unexported fields
}
func NewTableOptionAvgRowLength ¶
func NewTableOptionAvgRowLength(l uint64) *TableOptionAvgRowLength
func (*TableOptionAvgRowLength) Format ¶
func (node *TableOptionAvgRowLength) Format(ctx *FmtCtx)
type TableOptionCharset ¶
type TableOptionCharset struct {
Charset string
// contains filtered or unexported fields
}
func NewTableOptionCharset ¶
func NewTableOptionCharset(s string) *TableOptionCharset
func (*TableOptionCharset) Format ¶
func (node *TableOptionCharset) Format(ctx *FmtCtx)
type TableOptionChecksum ¶
type TableOptionChecksum struct {
Value uint64
// contains filtered or unexported fields
}
func NewTableOptionChecksum ¶
func NewTableOptionChecksum(v uint64) *TableOptionChecksum
func (*TableOptionChecksum) Format ¶
func (node *TableOptionChecksum) Format(ctx *FmtCtx)
type TableOptionCollate ¶
type TableOptionCollate struct {
Collate string
// contains filtered or unexported fields
}
func NewTableOptionCollate ¶
func NewTableOptionCollate(s string) *TableOptionCollate
func (*TableOptionCollate) Format ¶
func (node *TableOptionCollate) Format(ctx *FmtCtx)
type TableOptionComment ¶
type TableOptionComment struct {
Comment string
// contains filtered or unexported fields
}
func NewTableOptionComment ¶
func NewTableOptionComment(c string) *TableOptionComment
func (*TableOptionComment) Format ¶
func (node *TableOptionComment) Format(ctx *FmtCtx)
type TableOptionCompression ¶
type TableOptionCompression struct {
Compression string
// contains filtered or unexported fields
}
func NewTableOptionCompression ¶
func NewTableOptionCompression(c string) *TableOptionCompression
func (*TableOptionCompression) Format ¶
func (node *TableOptionCompression) Format(ctx *FmtCtx)
type TableOptionConnection ¶
type TableOptionConnection struct {
Connection string
// contains filtered or unexported fields
}
func NewTableOptionConnection ¶
func NewTableOptionConnection(c string) *TableOptionConnection
func (*TableOptionConnection) Format ¶
func (node *TableOptionConnection) Format(ctx *FmtCtx)
type TableOptionDataDirectory ¶
type TableOptionDataDirectory struct {
Dir string
// contains filtered or unexported fields
}
func NewTableOptionDataDirectory ¶
func NewTableOptionDataDirectory(d string) *TableOptionDataDirectory
func (*TableOptionDataDirectory) Format ¶
func (node *TableOptionDataDirectory) Format(ctx *FmtCtx)
type TableOptionDelayKeyWrite ¶
type TableOptionDelayKeyWrite struct {
Value uint64
// contains filtered or unexported fields
}
func NewTableOptionDelayKeyWrite ¶
func NewTableOptionDelayKeyWrite(v uint64) *TableOptionDelayKeyWrite
func (*TableOptionDelayKeyWrite) Format ¶
func (node *TableOptionDelayKeyWrite) Format(ctx *FmtCtx)
type TableOptionEncryption ¶
type TableOptionEncryption struct {
Encryption string
// contains filtered or unexported fields
}
func NewTableOptionEncryption ¶
func NewTableOptionEncryption(e string) *TableOptionEncryption
func (*TableOptionEncryption) Format ¶
func (node *TableOptionEncryption) Format(ctx *FmtCtx)
type TableOptionEngine ¶
type TableOptionEngine struct {
Engine string
// contains filtered or unexported fields
}
func NewTableOptionEngine ¶
func NewTableOptionEngine(s string) *TableOptionEngine
func (*TableOptionEngine) Format ¶
func (node *TableOptionEngine) Format(ctx *FmtCtx)
type TableOptionIndexDirectory ¶
type TableOptionIndexDirectory struct {
Dir string
// contains filtered or unexported fields
}
func NewTableOptionIndexDirectory ¶
func NewTableOptionIndexDirectory(d string) *TableOptionIndexDirectory
func (*TableOptionIndexDirectory) Format ¶
func (node *TableOptionIndexDirectory) Format(ctx *FmtCtx)
type TableOptionKeyBlockSize ¶
type TableOptionKeyBlockSize struct {
Value uint64
// contains filtered or unexported fields
}
func NewTableOptionKeyBlockSize ¶
func NewTableOptionKeyBlockSize(v uint64) *TableOptionKeyBlockSize
func (*TableOptionKeyBlockSize) Format ¶
func (node *TableOptionKeyBlockSize) Format(ctx *FmtCtx)
type TableOptionMaxRows ¶
type TableOptionMaxRows struct {
Value uint64
// contains filtered or unexported fields
}
func NewTableOptionMaxRows ¶
func NewTableOptionMaxRows(v uint64) *TableOptionMaxRows
func (*TableOptionMaxRows) Format ¶
func (node *TableOptionMaxRows) Format(ctx *FmtCtx)
type TableOptionMinRows ¶
type TableOptionMinRows struct {
Value uint64
// contains filtered or unexported fields
}
func NewTableOptionMinRows ¶
func NewTableOptionMinRows(v uint64) *TableOptionMinRows
func (*TableOptionMinRows) Format ¶
func (node *TableOptionMinRows) Format(ctx *FmtCtx)
type TableOptionPackKeys ¶
type TableOptionPackKeys struct {
Value int64
Default bool
// contains filtered or unexported fields
}
func NewTableOptionPackKeys ¶
func NewTableOptionPackKeys(value int64) *TableOptionPackKeys
func (*TableOptionPackKeys) Format ¶
func (node *TableOptionPackKeys) Format(ctx *FmtCtx)
type TableOptionPassword ¶
type TableOptionPassword struct {
Password string
// contains filtered or unexported fields
}
func NewTableOptionPassword ¶
func NewTableOptionPassword(p string) *TableOptionPassword
func (*TableOptionPassword) Format ¶
func (node *TableOptionPassword) Format(ctx *FmtCtx)
type TableOptionProperties ¶
type TableOptionProperties struct {
Preperties []Property
// contains filtered or unexported fields
}
func (*TableOptionProperties) Format ¶
func (node *TableOptionProperties) Format(ctx *FmtCtx)
type TableOptionRowFormat ¶
type TableOptionRowFormat struct {
Value RowFormatType
// contains filtered or unexported fields
}
func NewTableOptionRowFormat ¶
func NewTableOptionRowFormat(v RowFormatType) *TableOptionRowFormat
func (*TableOptionRowFormat) Format ¶
func (node *TableOptionRowFormat) Format(ctx *FmtCtx)
type TableOptionSecondaryEngine ¶
type TableOptionSecondaryEngine struct {
Engine string
// contains filtered or unexported fields
}
func NewTableOptionSecondaryEngine ¶
func NewTableOptionSecondaryEngine(s string) *TableOptionSecondaryEngine
func (*TableOptionSecondaryEngine) Format ¶
func (node *TableOptionSecondaryEngine) Format(ctx *FmtCtx)
type TableOptionSecondaryEngineNull ¶
type TableOptionSecondaryEngineNull struct {
// contains filtered or unexported fields
}
func NewTableOptionSecondaryEngineNull ¶
func NewTableOptionSecondaryEngineNull() *TableOptionSecondaryEngineNull
type TableOptionStatsAutoRecalc ¶
type TableOptionStatsAutoRecalc struct {
Value uint64
Default bool //false -- see Value; true -- Value is useless
// contains filtered or unexported fields
}
func NewTableOptionStatsAutoRecalc ¶
func NewTableOptionStatsAutoRecalc(v uint64, d bool) *TableOptionStatsAutoRecalc
func (*TableOptionStatsAutoRecalc) Format ¶
func (node *TableOptionStatsAutoRecalc) Format(ctx *FmtCtx)
type TableOptionStatsPersistent ¶
type TableOptionStatsPersistent struct {
Value uint64
Default bool
// contains filtered or unexported fields
}
func NewTableOptionStatsPersistent ¶
func NewTableOptionStatsPersistent() *TableOptionStatsPersistent
func (*TableOptionStatsPersistent) Format ¶
func (node *TableOptionStatsPersistent) Format(ctx *FmtCtx)
type TableOptionStatsSamplePages ¶
type TableOptionStatsSamplePages struct {
Value uint64
Default bool //false -- see Value; true -- Value is useless
// contains filtered or unexported fields
}
func NewTableOptionStatsSamplePages ¶
func NewTableOptionStatsSamplePages(v uint64, d bool) *TableOptionStatsSamplePages
func (*TableOptionStatsSamplePages) Format ¶
func (node *TableOptionStatsSamplePages) Format(ctx *FmtCtx)
type TableOptionStorageMedia ¶
type TableOptionStorageMedia struct {
Media string
// contains filtered or unexported fields
}
func NewTableOptionStorageMedia ¶
func NewTableOptionStorageMedia(m string) *TableOptionStorageMedia
func (*TableOptionStorageMedia) Format ¶
func (node *TableOptionStorageMedia) Format(ctx *FmtCtx)
type TableOptionTablespace ¶
type TableOptionTablespace struct {
Name string
StorageOpt string
// contains filtered or unexported fields
}
func NewTableOptionTablespace ¶
func NewTableOptionTablespace(n string, s string) *TableOptionTablespace
func (*TableOptionTablespace) Format ¶
func (node *TableOptionTablespace) Format(ctx *FmtCtx)
type TableOptionUnion ¶
type TableOptionUnion struct {
Names TableNames
// contains filtered or unexported fields
}
func NewTableOptionUnion ¶
func NewTableOptionUnion(n TableNames) *TableOptionUnion
func (*TableOptionUnion) Format ¶
func (node *TableOptionUnion) Format(ctx *FmtCtx)
type TailParameter ¶ added in v0.6.0
type TailParameter struct {
//Fields
Fields *Fields
//Lines
Lines *Lines
//Ignored lines
IgnoredLines uint64
//col_name_or_user_var
ColumnList []LoadColumn
//set col_name
Assignments UpdateExprs
}
type TlsOption ¶
type TlsOption interface {
NodeFormatter
}
type TlsOptionCipher ¶
type TlsOptionCipher struct {
Cipher string
// contains filtered or unexported fields
}
func (*TlsOptionCipher) Format ¶
func (node *TlsOptionCipher) Format(ctx *FmtCtx)
type TlsOptionIssuer ¶
type TlsOptionIssuer struct {
Issuer string
// contains filtered or unexported fields
}
func (*TlsOptionIssuer) Format ¶
func (node *TlsOptionIssuer) Format(ctx *FmtCtx)
type TlsOptionNone ¶
type TlsOptionNone struct {
// contains filtered or unexported fields
}
func (*TlsOptionNone) Format ¶
func (node *TlsOptionNone) Format(ctx *FmtCtx)
type TlsOptionSSL ¶
type TlsOptionSSL struct {
// contains filtered or unexported fields
}
func (*TlsOptionSSL) Format ¶
func (node *TlsOptionSSL) Format(ctx *FmtCtx)
type TlsOptionSan ¶
type TlsOptionSan struct {
San string
// contains filtered or unexported fields
}
func (*TlsOptionSan) Format ¶
func (node *TlsOptionSan) Format(ctx *FmtCtx)
type TlsOptionSubject ¶
type TlsOptionSubject struct {
Subject string
// contains filtered or unexported fields
}
func (*TlsOptionSubject) Format ¶
func (node *TlsOptionSubject) Format(ctx *FmtCtx)
type TlsOptionX509 ¶
type TlsOptionX509 struct {
// contains filtered or unexported fields
}
func (*TlsOptionX509) Format ¶
func (node *TlsOptionX509) Format(ctx *FmtCtx)
type TransactionModes ¶
type TransactionModes struct {
RwMode ReadWriteMode
}
modes for a transaction
func MakeTransactionModes ¶
func MakeTransactionModes(rwm ReadWriteMode) TransactionModes
func (*TransactionModes) Format ¶
func (node *TransactionModes) Format(ctx *FmtCtx)
type TruncateTable ¶ added in v0.6.0
type TruncateTable struct {
Name *TableName
// contains filtered or unexported fields
}
truncate table statement
func NewTruncateTable ¶ added in v0.6.0
func NewTruncateTable(name *TableName) *TruncateTable
func (*TruncateTable) Format ¶ added in v0.6.0
func (node *TruncateTable) Format(ctx *FmtCtx)
type Tuple ¶
type Tuple struct {
Exprs Exprs
// contains filtered or unexported fields
}
the parenthesized list of expressions.
type UnaryExpr ¶
type UnaryExpr struct {
//operator
Op UnaryOp
//expression
Expr Expr
// contains filtered or unexported fields
}
unary expression
func NewUnaryExpr ¶
type UnionClause ¶
type UnionClause struct {
SelectStatement
Type UnionType
//Left, Right *Select
Left, Right SelectStatement
All bool
Distinct bool
}
the UNION statement
func NewUnionClause ¶
func NewUnionClause(t UnionType, l, r SelectStatement, a bool) *UnionClause
func NewUnionClause(t UnionType,l,r *Select,a bool)*UnionClause{
func (*UnionClause) Format ¶
func (node *UnionClause) Format(ctx *FmtCtx)
type UnionTypeRecord ¶
type UniqueIndex ¶
type UniqueIndex struct {
KeyParts []*KeyPart
Name string
Empty bool
IndexOption *IndexOption
// contains filtered or unexported fields
}
func NewUniqueIndex ¶
func NewUniqueIndex(k []*KeyPart, n string, e bool, io *IndexOption) *UniqueIndex
func (*UniqueIndex) Format ¶
func (node *UniqueIndex) Format(ctx *FmtCtx)
type UnqualifiedStar ¶
type UnqualifiedStar struct {
VarName
}
'*' in the scalar expression
func (UnqualifiedStar) Format ¶
func (node UnqualifiedStar) Format(ctx *FmtCtx)
type UnresolvedName ¶
type UnresolvedName struct {
//the number of name parts specified, including the star. Always 1 or greater.
NumParts int
//the name ends with a star. then the first element is empty in the Parts
Star bool
// Parts are the name components (at most 4: column, table, db/schema, catalog.), in reverse order.
Parts NameParts
// contains filtered or unexported fields
}
the unresolved qualified name like column name.
func NewUnresolvedName ¶
func NewUnresolvedName(parts ...string) (*UnresolvedName, error)
func NewUnresolvedNameWithStar ¶
func NewUnresolvedNameWithStar(parts ...string) (*UnresolvedName, error)
func SetUnresolvedName ¶
func SetUnresolvedName(parts ...string) *UnresolvedName
func SetUnresolvedNameWithStar ¶
func SetUnresolvedNameWithStar(parts ...string) *UnresolvedName
func (*UnresolvedName) Format ¶
func (node *UnresolvedName) Format(ctx *FmtCtx)
type UnresolvedObjectName ¶
type UnresolvedObjectName struct {
//the number of name parts; >= 1
NumParts int
//At most three components, in reverse order.
//object name, db/schema, catalog.
Parts [3]string
}
the unresolved qualified name for a database object (table, view, etc)
func NewUnresolvedObjectName ¶
func NewUnresolvedObjectName(num int, parts [3]string) (*UnresolvedObjectName, error)
func SetUnresolvedObjectName ¶
func SetUnresolvedObjectName(num int, parts [3]string) *UnresolvedObjectName
func (*UnresolvedObjectName) Format ¶
func (node *UnresolvedObjectName) Format(ctx *FmtCtx)
func (*UnresolvedObjectName) GetDBName ¶ added in v0.6.0
func (node *UnresolvedObjectName) GetDBName() string
func (*UnresolvedObjectName) ToTableName ¶
func (node *UnresolvedObjectName) ToTableName() TableName
type UnrestrictedIdentifier ¶
type UnrestrictedIdentifier string
type Update ¶
type Update struct {
Tables TableExprs
Exprs UpdateExprs
Where *Where
OrderBy OrderBy
Limit *Limit
With *With
// contains filtered or unexported fields
}
update statement
type UpdateExpr ¶
type UpdateExpr struct {
NodeFormatter
Tuple bool
Names []*UnresolvedName
Expr Expr
}
the update expression.
func NewUpdateExpr ¶
func NewUpdateExpr(t bool, n []*UnresolvedName, e Expr) *UpdateExpr
func (*UpdateExpr) Format ¶
func (node *UpdateExpr) Format(ctx *FmtCtx)
type UpdateExprs ¶
type UpdateExprs []*UpdateExpr
func (*UpdateExprs) Format ¶
func (node *UpdateExprs) Format(ctx *FmtCtx)
type UpdateList ¶ added in v0.6.0
type UpdateList struct {
Columns IdentifierList
Rows *Select
}
func (*UpdateList) Format ¶ added in v0.6.0
func (node *UpdateList) Format(ctx *FmtCtx)
type UpdateVal ¶ added in v0.6.0
type UpdateVal struct {
// contains filtered or unexported fields
}
type Use ¶
type Use struct {
Name string
SecondaryRole bool
SecondaryRoleType SecondaryRoleType
Role *Role
// contains filtered or unexported fields
}
Use statement
type User ¶
type User struct {
NodeFormatter
Username string
Hostname string
AuthOption *AccountIdentified
}
type UserMiscOption ¶
type UserMiscOption interface {
NodeFormatter
}
type UserMiscOptionAccountLock ¶
type UserMiscOptionAccountLock struct {
// contains filtered or unexported fields
}
func (*UserMiscOptionAccountLock) Format ¶
func (node *UserMiscOptionAccountLock) Format(ctx *FmtCtx)
type UserMiscOptionAccountUnlock ¶
type UserMiscOptionAccountUnlock struct {
// contains filtered or unexported fields
}
func (*UserMiscOptionAccountUnlock) Format ¶
func (node *UserMiscOptionAccountUnlock) Format(ctx *FmtCtx)
type UserMiscOptionFailedLoginAttempts ¶
type UserMiscOptionFailedLoginAttempts struct {
Value int64
// contains filtered or unexported fields
}
func (*UserMiscOptionFailedLoginAttempts) Format ¶ added in v0.6.0
func (node *UserMiscOptionFailedLoginAttempts) Format(ctx *FmtCtx)
type UserMiscOptionPasswordExpireDefault ¶
type UserMiscOptionPasswordExpireDefault struct {
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordExpireDefault) Format ¶
func (node *UserMiscOptionPasswordExpireDefault) Format(ctx *FmtCtx)
type UserMiscOptionPasswordExpireInterval ¶
type UserMiscOptionPasswordExpireInterval struct {
Value int64
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordExpireInterval) Format ¶
func (node *UserMiscOptionPasswordExpireInterval) Format(ctx *FmtCtx)
type UserMiscOptionPasswordExpireNever ¶
type UserMiscOptionPasswordExpireNever struct {
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordExpireNever) Format ¶
func (node *UserMiscOptionPasswordExpireNever) Format(ctx *FmtCtx)
type UserMiscOptionPasswordExpireNone ¶
type UserMiscOptionPasswordExpireNone struct {
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordExpireNone) Format ¶
func (node *UserMiscOptionPasswordExpireNone) Format(ctx *FmtCtx)
type UserMiscOptionPasswordHistoryCount ¶
type UserMiscOptionPasswordHistoryCount struct {
Value int64
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordHistoryCount) Format ¶ added in v0.6.0
func (node *UserMiscOptionPasswordHistoryCount) Format(ctx *FmtCtx)
type UserMiscOptionPasswordHistoryDefault ¶
type UserMiscOptionPasswordHistoryDefault struct {
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordHistoryDefault) Format ¶ added in v0.6.0
func (node *UserMiscOptionPasswordHistoryDefault) Format(ctx *FmtCtx)
type UserMiscOptionPasswordLockTimeCount ¶
type UserMiscOptionPasswordLockTimeCount struct {
Value int64
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordLockTimeCount) Format ¶ added in v0.6.0
func (node *UserMiscOptionPasswordLockTimeCount) Format(ctx *FmtCtx)
type UserMiscOptionPasswordLockTimeUnbounded ¶
type UserMiscOptionPasswordLockTimeUnbounded struct {
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordLockTimeUnbounded) Format ¶ added in v0.6.0
func (node *UserMiscOptionPasswordLockTimeUnbounded) Format(ctx *FmtCtx)
type UserMiscOptionPasswordRequireCurrentDefault ¶
type UserMiscOptionPasswordRequireCurrentDefault struct {
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordRequireCurrentDefault) Format ¶ added in v0.6.0
func (node *UserMiscOptionPasswordRequireCurrentDefault) Format(ctx *FmtCtx)
type UserMiscOptionPasswordRequireCurrentNone ¶ added in v0.6.0
type UserMiscOptionPasswordRequireCurrentNone struct {
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordRequireCurrentNone) Format ¶ added in v0.6.0
func (node *UserMiscOptionPasswordRequireCurrentNone) Format(ctx *FmtCtx)
type UserMiscOptionPasswordRequireCurrentOptional ¶
type UserMiscOptionPasswordRequireCurrentOptional struct {
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordRequireCurrentOptional) Format ¶ added in v0.6.0
func (node *UserMiscOptionPasswordRequireCurrentOptional) Format(ctx *FmtCtx)
type UserMiscOptionPasswordReuseIntervalCount ¶
type UserMiscOptionPasswordReuseIntervalCount struct {
Value int64
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordReuseIntervalCount) Format ¶ added in v0.6.0
func (node *UserMiscOptionPasswordReuseIntervalCount) Format(ctx *FmtCtx)
type UserMiscOptionPasswordReuseIntervalDefault ¶
type UserMiscOptionPasswordReuseIntervalDefault struct {
// contains filtered or unexported fields
}
func (*UserMiscOptionPasswordReuseIntervalDefault) Format ¶ added in v0.6.0
func (node *UserMiscOptionPasswordReuseIntervalDefault) Format(ctx *FmtCtx)
type UsernameRecord ¶
type UsingJoinCond ¶
type UsingJoinCond struct {
JoinCond
Cols IdentifierList
}
the USING condition
func NewUsingJoinCond ¶
func NewUsingJoinCond(c IdentifierList) *UsingJoinCond
func (*UsingJoinCond) Format ¶
func (node *UsingJoinCond) Format(ctx *FmtCtx)
type Values ¶
type Values interface {
NodeFormatter
}
type ValuesClause ¶
type ValuesClause struct {
SelectStatement
Rows []Exprs
}
the VALUES clause
func NewValuesClause ¶
func NewValuesClause(r []Exprs) *ValuesClause
func (*ValuesClause) Format ¶
func (node *ValuesClause) Format(ctx *FmtCtx)
type ValuesIn ¶
type ValuesIn struct {
ValueList Exprs
// contains filtered or unexported fields
}
func NewValuesIn ¶
type ValuesLessThan ¶
type ValuesLessThan struct {
ValueList Exprs
// contains filtered or unexported fields
}
func NewValuesLessThan ¶
func NewValuesLessThan(vl Exprs) *ValuesLessThan
func (*ValuesLessThan) Format ¶
func (node *ValuesLessThan) Format(ctx *FmtCtx)
type ValuesStatement ¶ added in v0.6.0
type ValuesStatement struct {
NodeFormatter
Rows []Exprs
OrderBy OrderBy
Limit *Limit
// contains filtered or unexported fields
}
ValuesStatement the VALUES Statement
func (*ValuesStatement) Format ¶ added in v0.6.0
func (node *ValuesStatement) Format(ctx *FmtCtx)
type VarAssignmentExpr ¶
type VarAssignmentExpr struct {
NodeFormatter
System bool
Global bool
Name string
Value Expr
Reserved Expr
}
for variable = expr
func NewVarAssignmentExpr ¶
func (*VarAssignmentExpr) Format ¶
func (node *VarAssignmentExpr) Format(ctx *FmtCtx)
type VarExpr ¶
type VisibleType ¶
type VisibleType int
const ( VISIBLE_TYPE_INVALID VisibleType = iota VISIBLE_TYPE_VISIBLE VISIBLE_TYPE_INVISIBLE )
func (VisibleType) ToString ¶
func (vt VisibleType) ToString() string
Source Files
¶
- accept.go
- alter.go
- analyze.go
- constant.go
- create.go
- datum.go
- deallocate.go
- declare.go
- delete.go
- do.go
- drop.go
- execute.go
- explain.go
- expr.go
- format.go
- grant.go
- identifier.go
- insert.go
- mo_dump.go
- object_name.go
- precedence.go
- prepare.go
- replace.go
- revoke.go
- select.go
- set.go
- show.go
- stmt.go
- table_function.go
- table_name.go
- truncate.go
- txn.go
- types.go
- union.go
- update.go
- use.go
- values.go
- view.go
- with.go