tree

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AstWhere  = "where"
	AstHaving = "having"
)
View Source
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"
)
View Source
const (
	ShowEngines = iota
	ShowCharset
	ShowCreateUser
	ShowTriggers
	ShowConfig
	ShowEvents
	ShowPlugins
	ShowProfile
	ShowProfiles
	ShowPrivileges
)
View Source
const (
	GrantForUser = iota
	GrantForRole
)
View Source
const (
	// QueryTypeDQL (Data Query Language) Select, MoDump, ValuesStatement, With
	QueryTypeDQL = "DQL"
	// QueryTypeDDL (Data Definition Language): CreateDatabase, DropDatabase, DropTable,
	// Create/Drop/Alter/Rename Database/Table/View/Index/Function, TruncateTable,
	QueryTypeDDL = "DDL"
	// QueryTypeDML (Data Manipulation Language): Insert, Update, Delete, Load
	QueryTypeDML = "DML"
	// QueryTypeDCL (Data Control Language)
	// statement: Grant, Revoke
	// CreateAccount, CreateUser, CreateRole, AlterAccount, AlterUser, DropAccount, DropUser, DropRole
	QueryTypeDCL = "DCL"
	// QueryTypeTCL (Transaction Control Language): BeginTransaction, RollbackTransaction, CommitTransaction, Savepoint(Not Support)
	QueryTypeTCL = "TCL"
	// QueryTypeOth (Other.)
	// statement: AnalyzeStmt(Not Support), ExplainStmt, ExplainAnalyze, ExplainFor,
	// SetVar, SetDefaultRole, SetRole, SetPassword, Declare, Do, TableFunction, Use, PrepareStmt, Execute, Deallocate, Kill
	// Show ..., ShowCreateTable, ShowColumns(Desc)
	QueryTypeOth = "Other"
)
View Source
const (
	DefaultDisplayWidth   = -1
	NotDefineDisplayWidth = 0
	NotDefineDec          = -1
)
View Source
const (
	AUTO       = "auto"
	NOCOMPRESS = "none"
	GZIP       = "gzip"
	GZ         = "gz" // alias of gzip
	BZIP2      = "bzip2"
	BZ2        = "bz2" // alias for bzip2
	FLATE      = "flate"
	LZW        = "lzw"
	ZLIB       = "zlib"
	LZ4        = "lz4"
)
View Source
const (
	CSV      = "csv"
	JSONLINE = "jsonline"
)

load data fotmat

View Source
const (
	OBJECT = "object"
	ARRAY  = "array"
)

if $format is jsonline

View Source
const (
	S3     = 1
	INLINE = 2
)

Variables

View Source
var (
	DBoolTrue  = &constDBoolTrue
	DBoolFalse = &constDBoolFalse

	DNull Datum = &dNull{}
)
View Source
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,
		Scale:              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,
		Scale:                 0,
		TimePrecisionIsSet:    false,
		Locale:                &emptyLocale,
		Oid:                   uint32(defines.MYSQL_TYPE_TIME),
		IntervalDurationField: &IntervalDurationField{},
	}}

	TYPE_TIME = &T{InternalType: InternalType{
		Family:             TimeFamily,
		Scale:              0,
		TimePrecisionIsSet: false,
		Locale:             &emptyLocale,
		Oid:                uint32(defines.MYSQL_TYPE_TIME),
	}}

	TYPE_DATETIME = &T{InternalType: InternalType{
		Family:             TimestampFamily,
		Scale:              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_BINARY = &T{InternalType: InternalType{
		Family: StringFamily,
		Locale: &emptyLocale,
		Oid:    uint32(defines.MYSQL_TYPE_VARCHAR),
	}}

	TYPE_VARBINARY = &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 FormatString(str string) string

func GetDisplayWith

func GetDisplayWith(val int32) int32

func IsContainAnalyze added in v0.6.0

func IsContainAnalyze(options []OptionElem) bool

func IsValue

func IsValue(node Expr) bool

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 AccessModeType added in v0.8.0

type AccessModeType int
const (
	ACCESS_MODE_NONE AccessModeType = iota
	ACCESS_MODE_READ_WRITE
	ACCESS_MODE_READ_ONLY
)

func (AccessModeType) String added in v0.8.0

func (amt AccessModeType) String() string

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

type AccountComment struct {
	Exist   bool
	Comment string
}

func (*AccountComment) Format added in v0.6.0

func (node *AccountComment) Format(ctx *FmtCtx)

type AccountCommentOrAttribute added in v0.6.0

type AccountCommentOrAttribute struct {
	Exist     bool
	IsComment bool
	Str       string
}

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
	AccountStatusRestricted
)

func (AccountStatusOption) String added in v0.7.0

func (aso AccountStatusOption) String() string

type AccountsSetOption added in v0.8.0

type AccountsSetOption struct {
	All          bool
	SetAccounts  IdentifierList
	AddAccounts  IdentifierList
	DropAccounts IdentifierList
}

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 AlterAccountAuthOption
	//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)

func (*AlterAccount) GetQueryType added in v0.7.0

func (ca *AlterAccount) GetQueryType() string

func (*AlterAccount) GetStatementType added in v0.7.0

func (ca *AlterAccount) GetStatementType() string

type AlterAccountAuthOption added in v0.7.0

type AlterAccountAuthOption struct {
	Exist          bool
	Equal          string
	AdminName      string
	IdentifiedType AccountIdentified
}

func (*AlterAccountAuthOption) Format added in v0.7.0

func (node *AlterAccountAuthOption) Format(ctx *FmtCtx)

type AlterAddCol added in v0.8.0

type AlterAddCol struct {
	Column   *ColumnTableDef
	Position *ColumnPosition
}

suggest rename: AlterAddColumnPosition

func (*AlterAddCol) Format added in v0.8.0

func (node *AlterAddCol) Format(ctx *FmtCtx)

type AlterColPos added in v0.8.0

type AlterColPos struct {
	PreColName *UnresolvedName
	Pos        int32
}

type AlterColumnOptionType added in v1.0.0

type AlterColumnOptionType int

AlterColumnOptionType is the type for AlterTableAlterColumn

const (
	AlterColumnOptionSetDefault AlterColumnOptionType = iota
	AlterColumnOptionSetVisibility
	AlterColumnOptionDropDefault
)

AlterColumnOptionType types.

type AlterColumnOrder added in v1.0.0

type AlterColumnOrder struct {
	Column    *UnresolvedName
	Direction Direction
}

func (*AlterColumnOrder) Format added in v1.0.0

func (node *AlterColumnOrder) Format(ctx *FmtCtx)

type AlterDataBaseConfig added in v0.7.0

type AlterDataBaseConfig struct {
	AccountName    string
	DbName         string
	IsAccountLevel bool
	UpdateConfig   string
	// contains filtered or unexported fields
}

alter configuration for mo_mysql_compatibility_mode

func (*AlterDataBaseConfig) Format added in v0.7.0

func (node *AlterDataBaseConfig) Format(ctx *FmtCtx)

func (*AlterDataBaseConfig) GetQueryType added in v0.7.0

func (node *AlterDataBaseConfig) GetQueryType() string

func (*AlterDataBaseConfig) GetStatementType added in v0.7.0

func (node *AlterDataBaseConfig) GetStatementType() string

type AlterOptionAdd added in v0.8.0

type AlterOptionAdd struct {
	Def TableDef
	// contains filtered or unexported fields
}

func (*AlterOptionAdd) Format added in v0.8.0

func (node *AlterOptionAdd) Format(ctx *FmtCtx)

type AlterOptionAlterCheck added in v1.0.0

type AlterOptionAlterCheck struct {
	Type    string
	Enforce bool
	// contains filtered or unexported fields
}

func (*AlterOptionAlterCheck) Format added in v1.0.0

func (node *AlterOptionAlterCheck) Format(ctx *FmtCtx)

type AlterOptionAlterIndex added in v0.8.0

type AlterOptionAlterIndex struct {
	Name       Identifier
	Visibility VisibleType
	// contains filtered or unexported fields
}

func (*AlterOptionAlterIndex) Format added in v0.8.0

func (node *AlterOptionAlterIndex) Format(ctx *FmtCtx)

type AlterOptionDrop added in v0.8.0

type AlterOptionDrop struct {
	Typ  AlterTableDropType
	Name Identifier
	// contains filtered or unexported fields
}

func (*AlterOptionDrop) Format added in v0.8.0

func (node *AlterOptionDrop) Format(ctx *FmtCtx)

type AlterPublication added in v0.8.0

type AlterPublication struct {
	IfExists    bool
	Name        Identifier
	AccountsSet *AccountsSetOption
	Comment     string
	// contains filtered or unexported fields
}

func (*AlterPublication) Format added in v0.8.0

func (node *AlterPublication) Format(ctx *FmtCtx)

func (*AlterPublication) GetQueryType added in v0.8.0

func (node *AlterPublication) GetQueryType() string

func (*AlterPublication) GetStatementType added in v0.8.0

func (node *AlterPublication) GetStatementType() string

type AlterSequence added in v1.0.0

type AlterSequence struct {
	Name        *TableName
	Type        *TypeOption
	IfExists    bool
	IncrementBy *IncrementByOption
	MinValue    *MinValueOption
	MaxValue    *MaxValueOption
	StartWith   *StartWithOption
	Cycle       *CycleOption
	// contains filtered or unexported fields
}

func (*AlterSequence) Format added in v1.0.0

func (node *AlterSequence) Format(ctx *FmtCtx)

func (*AlterSequence) GetQueryType added in v1.0.0

func (node *AlterSequence) GetQueryType() string

func (*AlterSequence) GetStatementType added in v1.0.0

func (node *AlterSequence) GetStatementType() string

type AlterStage added in v1.0.0

type AlterStage struct {
	IfNotExists       bool
	Name              Identifier
	UrlOption         StageUrl
	CredentialsOption StageCredentials
	StatusOption      StageStatus
	Comment           StageComment
	// contains filtered or unexported fields
}

func (*AlterStage) Format added in v1.0.0

func (node *AlterStage) Format(ctx *FmtCtx)

func (*AlterStage) GetQueryType added in v1.0.0

func (node *AlterStage) GetQueryType() string

func (*AlterStage) GetStatementType added in v1.0.0

func (node *AlterStage) GetStatementType() string

type AlterTable added in v0.8.0

type AlterTable struct {
	Table   *TableName
	Options AlterTableOptions
	// contains filtered or unexported fields
}

AlterTable see https://dev.mysql.com/doc/refman/8.0/en/alter-table.html

func (*AlterTable) Format added in v0.8.0

func (node *AlterTable) Format(ctx *FmtCtx)

func (*AlterTable) GetQueryType added in v0.8.0

func (node *AlterTable) GetQueryType() string

func (*AlterTable) GetStatementType added in v0.8.0

func (node *AlterTable) GetStatementType() string

type AlterTableAddColumnClause added in v1.0.0

type AlterTableAddColumnClause struct {
	Typ        AlterTableOptionType
	NewColumns []*ColumnTableDef
	Position   *ColumnPosition
	// contains filtered or unexported fields
}

func (*AlterTableAddColumnClause) Format added in v1.0.0

func (node *AlterTableAddColumnClause) Format(ctx *FmtCtx)

type AlterTableAlterColumnClause added in v1.0.0

type AlterTableAlterColumnClause struct {
	Typ         AlterTableOptionType
	ColumnName  *UnresolvedName
	DefalutExpr *AttributeDefault
	Visibility  VisibleType
	OptionType  AlterColumnOptionType
	// contains filtered or unexported fields
}

func (*AlterTableAlterColumnClause) Format added in v1.0.0

func (node *AlterTableAlterColumnClause) Format(ctx *FmtCtx)

type AlterTableChangeColumnClause added in v1.0.0

type AlterTableChangeColumnClause struct {
	Typ           AlterTableOptionType
	OldColumnName *UnresolvedName
	NewColumn     *ColumnTableDef
	Position      *ColumnPosition
	// contains filtered or unexported fields
}

func (*AlterTableChangeColumnClause) Format added in v1.0.0

func (node *AlterTableChangeColumnClause) Format(ctx *FmtCtx)

type AlterTableDropType added in v0.8.0

type AlterTableDropType int
const (
	AlterTableDropColumn AlterTableDropType = iota
	AlterTableDropIndex
	AlterTableDropKey
	AlterTableDropPrimaryKey
	AlterTableDropForeignKey
)

type AlterTableModifyColumnClause added in v1.0.0

type AlterTableModifyColumnClause struct {
	Typ       AlterTableOptionType
	NewColumn *ColumnTableDef
	Position  *ColumnPosition
	// contains filtered or unexported fields
}

func (*AlterTableModifyColumnClause) Format added in v1.0.0

func (node *AlterTableModifyColumnClause) Format(ctx *FmtCtx)

type AlterTableName added in v0.8.0

type AlterTableName struct {
	Name *UnresolvedObjectName
}

func (*AlterTableName) Format added in v0.8.0

func (node *AlterTableName) Format(ctx *FmtCtx)

type AlterTableOption added in v0.8.0

type AlterTableOption interface {
	NodeFormatter
}

type AlterTableOptionType added in v1.0.0

type AlterTableOptionType int

AlterTableType is the type for AlterTableOptionType.

const (
	AlterTableModifyColumn AlterTableOptionType = iota
	AlterTableChangeColumn
	AlterTableRenameColumn
	AlterTableAlterColumn
	AlterTableOrderByColumn
	AlterTableAddConstraint
	AlterTableAddColumn
)

AlterTable types.

type AlterTableOptions added in v0.8.0

type AlterTableOptions = []AlterTableOption

type AlterTableOrderByColumnClause added in v1.0.0

type AlterTableOrderByColumnClause struct {
	Typ              AlterTableOptionType
	AlterOrderByList []*AlterColumnOrder
	// contains filtered or unexported fields
}

func (*AlterTableOrderByColumnClause) Format added in v1.0.0

func (node *AlterTableOrderByColumnClause) Format(ctx *FmtCtx)

type AlterTableRenameColumnClause added in v1.0.0

type AlterTableRenameColumnClause struct {
	Typ           AlterTableOptionType
	OldColumnName *UnresolvedName
	NewColumnName *UnresolvedName
	// contains filtered or unexported fields
}

func (*AlterTableRenameColumnClause) Format added in v1.0.0

func (node *AlterTableRenameColumnClause) 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

func (*AlterUser) Format

func (node *AlterUser) Format(ctx *FmtCtx)

func (*AlterUser) GetQueryType added in v0.7.0

func (node *AlterUser) GetQueryType() string

func (*AlterUser) GetStatementType added in v0.7.0

func (node *AlterUser) GetStatementType() string

type AlterView added in v0.7.0

type AlterView struct {
	IfExists bool
	Name     *TableName
	ColNames IdentifierList
	AsSource *Select
	// contains filtered or unexported fields
}

func (*AlterView) Format added in v0.7.0

func (node *AlterView) Format(ctx *FmtCtx)

func (*AlterView) GetQueryType added in v0.7.0

func (node *AlterView) GetQueryType() string

func (*AlterView) GetStatementType added in v0.7.0

func (node *AlterView) GetStatementType() string

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)

func (*AnalyzeStmt) GetQueryType added in v0.7.0

func (node *AnalyzeStmt) GetQueryType() string

func (*AnalyzeStmt) GetStatementType added in v0.7.0

func (node *AnalyzeStmt) GetStatementType() string

type AndExpr

type AndExpr struct {
	Left, Right Expr
	// contains filtered or unexported fields
}

and expression

func NewAndExpr

func NewAndExpr(l, r Expr) *AndExpr

func (*AndExpr) Accept added in v0.8.0

func (node *AndExpr) Accept(v Visitor) (Expr, bool)

func (*AndExpr) Format

func (node *AndExpr) Format(ctx *FmtCtx)

func (*AndExpr) String

func (node *AndExpr) String() string

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 AttributeHeader added in v1.0.0

type AttributeHeader struct {
	Key string
	// contains filtered or unexported fields
}

func NewAttributeHeader added in v1.0.0

func NewAttributeHeader(key string) *AttributeHeader

func (*AttributeHeader) Format added in v1.0.0

func (node *AttributeHeader) Format(ctx *FmtCtx)

type AttributeHeaders added in v1.0.0

type AttributeHeaders struct {
	// contains filtered or unexported fields
}

func NewAttributeHeaders added in v1.0.0

func NewAttributeHeaders() *AttributeHeaders

func (*AttributeHeaders) Format added in v1.0.0

func (node *AttributeHeaders) 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 (*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 AttributeVisable added in v1.0.0

type AttributeVisable struct {
	Is bool //true NULL (default); false NOT NULL
	// contains filtered or unexported fields
}

func NewAttributeVisable added in v1.0.0

func NewAttributeVisable(b bool) *AttributeVisable

func (*AttributeVisable) Format added in v1.0.0

func (node *AttributeVisable) Format(ctx *FmtCtx)

type AuthRecord

type AuthRecord struct {
	AuthPlugin string
	AuthString string
	HashString string
	ByAuth     bool
}

type BackupStart added in v1.0.0

type BackupStart struct {
	Timestamp string
	IsS3      bool
	Dir       string
	//s3 option
	Option []string
	// contains filtered or unexported fields
}

func (*BackupStart) Format added in v1.0.0

func (node *BackupStart) Format(ctx *FmtCtx)

func (*BackupStart) GetQueryType added in v1.0.0

func (node *BackupStart) GetQueryType() string

func (*BackupStart) GetStatementType added in v1.0.0

func (node *BackupStart) GetStatementType() string

type BeginCompound added in v0.8.0

type BeginCompound struct {
	// contains filtered or unexported fields
}

Begin statement

func (*BeginCompound) Format added in v0.8.0

func (node *BeginCompound) Format(ctx *FmtCtx)

func (*BeginCompound) GetQueryType added in v0.8.0

func (node *BeginCompound) GetQueryType() string

func (*BeginCompound) GetStatementType added in v0.8.0

func (node *BeginCompound) GetStatementType() string

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)

func (*BeginTransaction) GetQueryType added in v0.7.0

func (node *BeginTransaction) GetQueryType() string

func (*BeginTransaction) GetStatementType added in v0.7.0

func (node *BeginTransaction) GetStatementType() string

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) Accept added in v0.8.0

func (node *BinaryExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*BinaryExpr) Format

func (node *BinaryExpr) Format(ctx *FmtCtx)

func (*BinaryExpr) String

func (node *BinaryExpr) String() string

type BinaryOp

type BinaryOp int

Binary Operator

const (
	PLUS BinaryOp = iota
	MINUS
	MULTI
	DIV         // /
	INTEGER_DIV //
	BIT_OR      // |
	BIT_AND     // &
	BIT_XOR     // ^
	LEFT_SHIFT  // <<
	RIGHT_SHIFT // >>
	MOD         // %
)

func (BinaryOp) ToString

func (op BinaryOp) ToString() string

type BitCastExpr added in v1.0.0

type BitCastExpr struct {
	Expr Expr
	Type ResolvableTypeReference
	// contains filtered or unexported fields
}

func NewBitCastExpr added in v1.0.0

func NewBitCastExpr(e Expr, t ResolvableTypeReference) *BitCastExpr

func (*BitCastExpr) Accept added in v1.0.0

func (node *BitCastExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*BitCastExpr) Format added in v1.0.0

func (node *BitCastExpr) Format(ctx *FmtCtx)

func (*BitCastExpr) String added in v1.0.0

func (node *BitCastExpr) String() string

type BoundType added in v0.8.0

type BoundType int
const (
	Following BoundType = iota
	Preceding
	CurrentRow
)

type CStr added in v0.8.0

type CStr struct {
	// contains filtered or unexported fields
}

func NewCStr added in v0.8.0

func NewCStr(str string, lower int64) *CStr

func (*CStr) Compare added in v0.8.0

func (cs *CStr) Compare() string

func (*CStr) Empty added in v0.8.0

func (cs *CStr) Empty() bool

func (*CStr) Origin added in v0.8.0

func (cs *CStr) Origin() string

func (*CStr) SetConfig added in v0.8.0

func (cs *CStr) SetConfig(lower int64)

func (*CStr) ToLower added in v0.8.0

func (cs *CStr) ToLower() string

type CTE

type CTE struct {
	Name *AliasClause
	Stmt Statement
}

func (*CTE) Format

func (node *CTE) Format(ctx *FmtCtx)

type CallStmt added in v0.8.0

type CallStmt struct {
	Name *ProcedureName
	Args Exprs
	// contains filtered or unexported fields
}

func (*CallStmt) Format added in v0.8.0

func (node *CallStmt) Format(ctx *FmtCtx)

func (*CallStmt) GetQueryType added in v0.8.0

func (node *CallStmt) GetQueryType() string

func (*CallStmt) GetStatementType added in v0.8.0

func (node *CallStmt) GetStatementType() string

type CaseExpr

type CaseExpr struct {
	Expr  Expr
	Whens []*When
	Else  Expr
	// contains filtered or unexported fields
}

Case-When expression.

func NewCaseExpr

func NewCaseExpr(e Expr, w []*When, el Expr) *CaseExpr

func (*CaseExpr) Accept added in v0.8.0

func (node *CaseExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*CaseExpr) Format

func (node *CaseExpr) Format(ctx *FmtCtx)

func (*CaseExpr) String

func (node *CaseExpr) String() string

type CaseStmt added in v0.8.0

type CaseStmt struct {
	Expr  Expr
	Whens []*WhenStmt
	Else  []Statement
	// contains filtered or unexported fields
}

func (*CaseStmt) Format added in v0.8.0

func (node *CaseStmt) Format(ctx *FmtCtx)

func (*CaseStmt) GetQueryType added in v0.8.0

func (node *CaseStmt) GetQueryType() string

func (*CaseStmt) GetStatementType added in v0.8.0

func (node *CaseStmt) GetStatementType() string

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

func (*CastExpr) Accept added in v0.8.0

func (node *CastExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*CastExpr) Format

func (node *CastExpr) Format(ctx *FmtCtx)

func (*CastExpr) String

func (node *CastExpr) String() string

type CheckIndex

type CheckIndex struct {
	Expr     Expr
	Enforced bool
	// contains filtered or unexported fields
}

func NewCheckIndex

func NewCheckIndex(e Expr, en bool) *CheckIndex

func (*CheckIndex) Format

func (node *CheckIndex) Format(ctx *FmtCtx)

type ClusterByOption added in v0.7.0

type ClusterByOption struct {
	ColumnList []*UnresolvedName
}

type ColumnAttribute

type ColumnAttribute interface {
	NodeFormatter
}

column attribute

type ColumnItem

type ColumnItem struct {
	IdentifierName

	//the name of the column
	ColumnName Identifier
}

type ColumnPosition added in v1.0.0

type ColumnPosition struct {
	NodeFormatter
	// Tp is either ColumnPositionNone, ColumnPositionFirst or ColumnPositionAfter.
	Typ ColumnPositionType
	// RelativeColumn is the column the newly added column after if type is ColumnPositionAfter
	RelativeColumn *UnresolvedName
}

ColumnPosition represent the position of the newly added column

func (*ColumnPosition) Format added in v1.0.0

func (node *ColumnPosition) Format(ctx *FmtCtx)

type ColumnPositionType added in v1.0.0

type ColumnPositionType int

ColumnPositionType is the type for ColumnPosition.

const (
	ColumnPositionNone  ColumnPositionType = -1
	ColumnPositionFirst ColumnPositionType = 0
	ColumnPositionAfter ColumnPositionType = 1
)

ColumnPosition Types Do not change the value of a constant, as there are external dependencies

type ColumnTableDef

type ColumnTableDef struct {
	Name       *UnresolvedName
	Type       ResolvableTypeReference
	Attributes []ColumnAttribute
	// contains filtered or unexported fields
}

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)

func (*CommitTransaction) GetQueryType added in v0.7.0

func (node *CommitTransaction) GetQueryType() string

func (*CommitTransaction) GetStatementType added in v0.7.0

func (node *CommitTransaction) GetStatementType() string

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) Accept added in v0.8.0

func (node *ComparisonExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*ComparisonExpr) Format

func (node *ComparisonExpr) Format(ctx *FmtCtx)

func (*ComparisonExpr) String

func (node *ComparisonExpr) String() string

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
	ILIKE
	NOT_ILIKE
	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 CompoundStmt added in v0.8.0

type CompoundStmt struct {
	Stmts []Statement
	// contains filtered or unexported fields
}

func NewCompoundStmt added in v0.8.0

func NewCompoundStmt(s []Statement) *CompoundStmt

func (*CompoundStmt) Format added in v0.8.0

func (node *CompoundStmt) Format(ctx *FmtCtx)

func (*CompoundStmt) GetQueryType added in v0.8.0

func (node *CompoundStmt) GetQueryType() string

func (*CompoundStmt) GetStatementType added in v0.8.0

func (node *CompoundStmt) GetStatementType() string

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)

func (*CreateAccount) GetQueryType added in v0.7.0

func (ca *CreateAccount) GetQueryType() string

func (*CreateAccount) GetStatementType added in v0.7.0

func (ca *CreateAccount) GetStatementType() string

type CreateDatabase

type CreateDatabase struct {
	IfNotExists        bool
	Name               Identifier
	CreateOptions      []CreateOption
	SubscriptionOption *SubscriptionOption
	Sql                string
	// 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)

func (*CreateDatabase) GetQueryType added in v0.7.0

func (node *CreateDatabase) GetQueryType() string

func (*CreateDatabase) GetStatementType added in v0.7.0

func (node *CreateDatabase) GetStatementType() string

type CreateExtension added in v0.7.0

type CreateExtension struct {
	Language string
	Name     Identifier
	Filename Identifier
	// contains filtered or unexported fields
}

func (*CreateExtension) Format added in v0.7.0

func (node *CreateExtension) Format(ctx *FmtCtx)

type CreateFunction added in v0.7.0

type CreateFunction struct {
	Name       *FunctionName
	Args       FunctionArgs
	ReturnType *ReturnType
	Body       string
	Language   string
	// contains filtered or unexported fields
}

func (*CreateFunction) Format added in v0.7.0

func (node *CreateFunction) Format(ctx *FmtCtx)

func (*CreateFunction) GetQueryType added in v0.7.0

func (node *CreateFunction) GetQueryType() string

func (*CreateFunction) GetStatementType added in v0.7.0

func (node *CreateFunction) GetStatementType() string

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)

func (*CreateIndex) GetQueryType added in v0.7.0

func (node *CreateIndex) GetQueryType() string

func (*CreateIndex) GetStatementType added in v0.7.0

func (node *CreateIndex) GetStatementType() string

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 CreateProcedure added in v0.8.0

type CreateProcedure struct {
	Name *ProcedureName
	Args ProcedureArgs
	Body string
	// contains filtered or unexported fields
}

func (*CreateProcedure) Format added in v0.8.0

func (node *CreateProcedure) Format(ctx *FmtCtx)

func (*CreateProcedure) GetQueryType added in v0.8.0

func (node *CreateProcedure) GetQueryType() string

func (*CreateProcedure) GetStatementType added in v0.8.0

func (node *CreateProcedure) GetStatementType() string

type CreatePublication added in v0.8.0

type CreatePublication struct {
	IfNotExists bool
	Name        Identifier
	Database    Identifier
	AccountsSet *AccountsSetOption
	Comment     string
	// contains filtered or unexported fields
}

func (*CreatePublication) Format added in v0.8.0

func (node *CreatePublication) Format(ctx *FmtCtx)

func (*CreatePublication) GetQueryType added in v0.8.0

func (node *CreatePublication) GetQueryType() string

func (*CreatePublication) GetStatementType added in v0.8.0

func (node *CreatePublication) GetStatementType() string

type CreateRole

type CreateRole struct {
	IfNotExists bool
	Roles       []*Role
	// contains filtered or unexported fields
}

func NewCreateRole

func NewCreateRole(ife bool, r []*Role) *CreateRole

func (*CreateRole) Format

func (node *CreateRole) Format(ctx *FmtCtx)

func (*CreateRole) GetQueryType added in v0.7.0

func (node *CreateRole) GetQueryType() string

func (*CreateRole) GetStatementType added in v0.7.0

func (node *CreateRole) GetStatementType() string

type CreateSequence added in v0.8.0

type CreateSequence struct {
	Name        *TableName
	Type        ResolvableTypeReference
	IfNotExists bool
	IncrementBy *IncrementByOption
	MinValue    *MinValueOption
	MaxValue    *MaxValueOption
	StartWith   *StartWithOption
	Cycle       bool
	// contains filtered or unexported fields
}

func (*CreateSequence) Format added in v0.8.0

func (node *CreateSequence) Format(ctx *FmtCtx)

func (*CreateSequence) GetQueryType added in v0.8.0

func (node *CreateSequence) GetQueryType() string

func (*CreateSequence) GetStatementType added in v0.8.0

func (node *CreateSequence) GetStatementType() string

type CreateStage added in v1.0.0

type CreateStage struct {
	IfNotExists bool
	Name        Identifier
	Url         string
	Credentials StageCredentials
	Status      StageStatus
	Comment     StageComment
	// contains filtered or unexported fields
}

func (*CreateStage) Format added in v1.0.0

func (node *CreateStage) Format(ctx *FmtCtx)

func (*CreateStage) GetQueryType added in v1.0.0

func (node *CreateStage) GetQueryType() string

func (*CreateStage) GetStatementType added in v1.0.0

func (node *CreateStage) GetStatementType() string

type CreateStream added in v1.0.0

type CreateStream struct {
	Replace     bool
	Source      bool
	IfNotExists bool
	StreamName  *TableName
	Defs        TableDefs
	ColNames    IdentifierList
	AsSource    *Select
	Options     []TableOption
	// contains filtered or unexported fields
}

func (*CreateStream) Format added in v1.0.0

func (node *CreateStream) Format(ctx *FmtCtx)

func (*CreateStream) GetQueryType added in v1.0.0

func (node *CreateStream) GetQueryType() string

func (*CreateStream) GetStatementType added in v1.0.0

func (node *CreateStream) GetStatementType() string

type CreateStreamWithOption added in v1.0.0

type CreateStreamWithOption struct {
	Key Identifier
	Val Expr
	// contains filtered or unexported fields
}

func (*CreateStreamWithOption) Format added in v1.0.0

func (node *CreateStreamWithOption) Format(ctx *FmtCtx)

type CreateTable

type CreateTable struct {

	/*
		it is impossible to be the temporary table, the cluster table,
		the normal table and the external table at the same time.
	*/
	Temporary       bool
	IsClusterTable  bool
	IfNotExists     bool
	Table           TableName
	Defs            TableDefs
	Options         []TableOption
	PartitionOption *PartitionOption
	ClusterByOption *ClusterByOption
	Param           *ExternParam
	// contains filtered or unexported fields
}

func (*CreateTable) Format

func (node *CreateTable) Format(ctx *FmtCtx)

func (*CreateTable) GetQueryType added in v0.7.0

func (node *CreateTable) GetQueryType() string

func (*CreateTable) GetStatementType added in v0.7.0

func (node *CreateTable) GetStatementType() string

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)

func (*CreateUser) GetQueryType added in v0.7.0

func (node *CreateUser) GetQueryType() string

func (*CreateUser) GetStatementType added in v0.7.0

func (node *CreateUser) GetStatementType() string

type CreateView added in v0.5.0

type CreateView struct {
	Replace     bool
	Name        *TableName
	ColNames    IdentifierList
	AsSource    *Select
	IfNotExists bool
	// contains filtered or unexported fields
}

func (*CreateView) Format added in v0.5.0

func (node *CreateView) Format(ctx *FmtCtx)

func (*CreateView) GetQueryType added in v0.7.0

func (node *CreateView) GetQueryType() string

func (*CreateView) GetStatementType added in v0.7.0

func (node *CreateView) GetStatementType() string

type CycleOption added in v1.0.0

type CycleOption struct {
	Cycle bool
}

func (*CycleOption) Format added in v1.0.0

func (node *CycleOption) Format(ctx *FmtCtx)

type DBool

type DBool bool

func MakeDBool

func MakeDBool(d bool) *DBool

func (*DBool) Format

func (node *DBool) Format(ctx *FmtCtx)

func (*DBool) String

func (node *DBool) String() string

type Datum

type Datum interface {
	Expr
}

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)

func (*Deallocate) GetQueryType added in v0.7.0

func (node *Deallocate) GetQueryType() string

func (*Deallocate) GetStatementType added in v0.7.0

func (node *Deallocate) GetStatementType() string

type Declare added in v0.6.0

type Declare struct {
	Variables  []string
	ColumnType *T
	DefaultVal Expr
	// contains filtered or unexported fields
}

Declare statement

func (*Declare) Format added in v0.6.0

func (node *Declare) Format(ctx *FmtCtx)

func (*Declare) GetQueryType added in v0.7.0

func (node *Declare) GetQueryType() string

func (*Declare) GetStatementType added in v0.7.0

func (node *Declare) GetStatementType() string

type DefaultVal

type DefaultVal struct {
	Expr Expr
	// contains filtered or unexported fields
}

the DEFAULT expression.

func NewDefaultVal

func NewDefaultVal(e Expr) *DefaultVal

func (*DefaultVal) Accept added in v0.8.0

func (node *DefaultVal) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*DefaultVal) Format

func (node *DefaultVal) Format(ctx *FmtCtx)

func (*DefaultVal) String

func (node *DefaultVal) String() string

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

func NewDelete

func NewDelete(ts TableExprs, w *Where, o OrderBy, l *Limit) *Delete

func (*Delete) Format

func (node *Delete) Format(ctx *FmtCtx)

func (*Delete) GetQueryType added in v0.7.0

func (node *Delete) GetQueryType() string

func (*Delete) GetStatementType added in v0.7.0

func (node *Delete) GetStatementType() string

type Direction

type Direction int8

Direction for ordering results.

const (
	DefaultDirection Direction = iota
	Ascending
	Descending
)

Direction values.

func (Direction) String

func (d Direction) String() string

type Do added in v0.6.0

type Do struct {
	Exprs []Expr
	// contains filtered or unexported fields
}

Do statement

func (*Do) Format added in v0.6.0

func (node *Do) Format(ctx *FmtCtx)

func (*Do) GetQueryType added in v0.7.0

func (node *Do) GetQueryType() string

func (*Do) GetStatementType added in v0.7.0

func (node *Do) GetStatementType() string

type DropAccount added in v0.6.0

type DropAccount struct {
	IfExists bool
	Name     string
	// contains filtered or unexported fields
}

func (*DropAccount) Format added in v0.6.0

func (node *DropAccount) Format(ctx *FmtCtx)

func (*DropAccount) GetQueryType added in v0.7.0

func (node *DropAccount) GetQueryType() string

func (*DropAccount) GetStatementType added in v0.7.0

func (node *DropAccount) GetStatementType() string

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)

func (*DropDatabase) GetQueryType added in v0.7.0

func (node *DropDatabase) GetQueryType() string

func (*DropDatabase) GetStatementType added in v0.7.0

func (node *DropDatabase) GetStatementType() string

type DropFunction added in v0.7.0

type DropFunction struct {
	Name *FunctionName
	Args FunctionArgs
	// contains filtered or unexported fields
}

func (*DropFunction) Format added in v0.7.0

func (node *DropFunction) Format(ctx *FmtCtx)

func (*DropFunction) GetQueryType added in v0.7.0

func (node *DropFunction) GetQueryType() string

func (*DropFunction) GetStatementType added in v0.7.0

func (node *DropFunction) GetStatementType() string

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

func (*DropIndex) Format

func (node *DropIndex) Format(ctx *FmtCtx)

func (*DropIndex) GetQueryType added in v0.7.0

func (node *DropIndex) GetQueryType() string

func (*DropIndex) GetStatementType added in v0.7.0

func (node *DropIndex) GetStatementType() string

type DropProcedure added in v0.8.0

type DropProcedure struct {
	Name     *ProcedureName
	IfExists bool
	// contains filtered or unexported fields
}

func (*DropProcedure) Format added in v0.8.0

func (node *DropProcedure) Format(ctx *FmtCtx)

func (*DropProcedure) GetQueryType added in v0.8.0

func (node *DropProcedure) GetQueryType() string

func (*DropProcedure) GetStatementType added in v0.8.0

func (node *DropProcedure) GetStatementType() string

type DropPublication added in v0.8.0

type DropPublication struct {
	Name     Identifier
	IfExists bool
	// contains filtered or unexported fields
}

func (*DropPublication) Format added in v0.8.0

func (node *DropPublication) Format(ctx *FmtCtx)

func (*DropPublication) GetQueryType added in v0.8.0

func (node *DropPublication) GetQueryType() string

func (*DropPublication) GetStatementType added in v0.8.0

func (node *DropPublication) GetStatementType() string

type DropRole

type DropRole struct {
	IfExists bool
	Roles    []*Role
	// contains filtered or unexported fields
}

func NewDropRole

func NewDropRole(ife bool, r []*Role) *DropRole

func (*DropRole) Format

func (node *DropRole) Format(ctx *FmtCtx)

func (*DropRole) GetQueryType added in v0.7.0

func (node *DropRole) GetQueryType() string

func (*DropRole) GetStatementType added in v0.7.0

func (node *DropRole) GetStatementType() string

type DropSequence added in v0.8.0

type DropSequence struct {
	IfExists bool
	Names    TableNames
	// contains filtered or unexported fields
}

func (*DropSequence) Format added in v0.8.0

func (node *DropSequence) Format(ctx *FmtCtx)

func (*DropSequence) GetQueryType added in v0.8.0

func (node *DropSequence) GetQueryType() string

func (*DropSequence) GetStatementType added in v0.8.0

func (node *DropSequence) GetStatementType() string

type DropStage added in v1.0.0

type DropStage struct {
	IfNotExists bool
	Name        Identifier
	// contains filtered or unexported fields
}

func (*DropStage) Format added in v1.0.0

func (node *DropStage) Format(ctx *FmtCtx)

func (*DropStage) GetQueryType added in v1.0.0

func (node *DropStage) GetQueryType() string

func (*DropStage) GetStatementType added in v1.0.0

func (node *DropStage) GetStatementType() string

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

func (*DropTable) Format

func (node *DropTable) Format(ctx *FmtCtx)

func (*DropTable) GetQueryType added in v0.7.0

func (node *DropTable) GetQueryType() string

func (*DropTable) GetStatementType added in v0.7.0

func (node *DropTable) GetStatementType() string

type DropUser

type DropUser struct {
	IfExists bool
	Users    []*User
	// contains filtered or unexported fields
}

func NewDropUser

func NewDropUser(ife bool, u []*User) *DropUser

func (*DropUser) Format

func (node *DropUser) Format(ctx *FmtCtx)

func (*DropUser) GetQueryType added in v0.7.0

func (node *DropUser) GetQueryType() string

func (*DropUser) GetStatementType added in v0.7.0

func (node *DropUser) GetStatementType() string

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

func (*DropView) Format added in v0.6.0

func (node *DropView) Format(ctx *FmtCtx)

func (*DropView) GetQueryType added in v0.7.0

func (node *DropView) GetQueryType() string

func (*DropView) GetStatementType added in v0.7.0

func (node *DropView) GetStatementType() string

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 ElseIfStmt added in v0.8.0

type ElseIfStmt struct {
	Cond Expr
	Body []Statement
	// contains filtered or unexported fields
}

func (*ElseIfStmt) Format added in v0.8.0

func (node *ElseIfStmt) Format(ctx *FmtCtx)

func (*ElseIfStmt) GetQueryType added in v0.8.0

func (node *ElseIfStmt) GetQueryType() string

func (*ElseIfStmt) GetStatementType added in v0.8.0

func (node *ElseIfStmt) GetStatementType() string

type EmptyStmt added in v1.0.0

type EmptyStmt struct {
	// contains filtered or unexported fields
}

func (*EmptyStmt) Format added in v1.0.0

func (e *EmptyStmt) Format(ctx *FmtCtx)

func (EmptyStmt) GetQueryType added in v1.0.0

func (e EmptyStmt) GetQueryType() string

func (EmptyStmt) GetStatementType added in v1.0.0

func (e EmptyStmt) GetStatementType() string

func (*EmptyStmt) String added in v1.0.0

func (e *EmptyStmt) String() string

type EndCompound added in v0.8.0

type EndCompound struct {
	// contains filtered or unexported fields
}

func (*EndCompound) Format added in v0.8.0

func (node *EndCompound) Format(ctx *FmtCtx)

func (*EndCompound) GetQueryType added in v0.8.0

func (node *EndCompound) GetQueryType() string

func (*EndCompound) GetStatementType added in v0.8.0

func (node *EndCompound) GetStatementType() string

type ExParam added in v0.7.0

type ExParam struct {
	JsonData    string
	FileService fileservice.FileService
	NullMap     map[string]([]string)
	S3Param     *S3Parameter
	Ctx         context.Context
	LoadFile    bool
	Local       bool
	QueryResult bool
	SysTable    bool
	Parallel    bool
}

type ExParamConst added in v0.7.0

type ExParamConst struct {
	ScanType     int
	Filepath     string
	CompressType string
	Format       string
	Option       []string
	Data         string
	Tail         *TailParameter
}

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

func (*Execute) Format added in v0.5.1

func (node *Execute) Format(ctx *FmtCtx)

func (*Execute) GetQueryType added in v0.7.0

func (node *Execute) GetQueryType() string

func (*Execute) GetStatementType added in v0.7.0

func (node *Execute) GetStatementType() string

type Explain

type Explain interface {
	Statement
}

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)

func (*ExplainAnalyze) GetQueryType added in v0.7.0

func (node *ExplainAnalyze) GetQueryType() string

func (*ExplainAnalyze) GetStatementType added in v0.7.0

func (node *ExplainAnalyze) GetStatementType() string

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)

func (*ExplainFor) GetQueryType added in v0.7.0

func (node *ExplainFor) GetQueryType() string

func (*ExplainFor) GetStatementType added in v0.7.0

func (node *ExplainFor) GetStatementType() string

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)

func (*ExplainStmt) GetQueryType added in v0.7.0

func (node *ExplainStmt) GetQueryType() string

func (*ExplainStmt) GetStatementType added in v0.7.0

func (node *ExplainStmt) GetStatementType() string

type ExportParam

type ExportParam struct {
	// outfile flag
	Outfile bool
	// query id
	QueryId string
	// filename path
	FilePath string
	// Fields
	Fields *Fields
	// Lines
	Lines *Lines
	// fileSize
	MaxFileSize uint64
	// header flag
	Header     bool
	ForceQuote []string
	// stage filename path
	StageFilePath string
}

func (*ExportParam) Format

func (ep *ExportParam) Format(ctx *FmtCtx)

type Expr

type Expr interface {
	fmt.Stringer
	NodeFormatter
	NodeChecker
}

AST for the expression

type ExprList

type ExprList struct {
	Exprs Exprs
	// contains filtered or unexported fields
}

ast fir the list of expression

func (*ExprList) Accept added in v0.8.0

func (n *ExprList) Accept(v Visitor) (Expr, bool)

func (*ExprList) String

func (node *ExprList) String() string

type Exprs

type Exprs []Expr

a list of expression.

func (Exprs) Format

func (node Exprs) Format(ctx *FmtCtx)

type ExternParam added in v0.6.0

type ExternParam struct {
	// params which come from parser
	ExParamConst
	// params which come from internal construct
	ExParam
}

type Family

type Family int32
const (
	UnknownFamily Family = iota
	IntFamily
	FloatFamily
	TimestampFamily
	DateFamily
	IntervalFamily
	TimeFamily
	StringFamily
	BitFamily
	BoolFamily
	JsonFamily
	EnumFamily
	SetFamily
	UuidFamily

	//test
	BlobFamily

	GeometryFamily
)

type Fields

type Fields struct {
	Terminated string
	Optionally bool
	EnclosedBy byte
	EscapedBy  byte
}

func NewFields

func NewFields(t string, o bool, en byte, es byte) *Fields

func (*Fields) Format

func (node *Fields) Format(ctx *FmtCtx)

type FmtCtx

type FmtCtx struct {
	*strings.Builder
	// contains filtered or unexported fields
}

FmtCtx contains formatted text of the node.

func NewFmtCtx

func NewFmtCtx(dialectType dialect.DialectType, opts ...FmtCtxOption) *FmtCtx

func (*FmtCtx) PrintExpr

func (ctx *FmtCtx) PrintExpr(currentExpr Expr, expr Expr, left bool)

func (*FmtCtx) WriteStringQuote added in v0.7.0

func (ctx *FmtCtx) WriteStringQuote(v string) (int, error)

func (*FmtCtx) WriteValue added in v0.6.0

func (ctx *FmtCtx) WriteValue(t P_TYPE, v string) (int, error)

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
	ConstraintSymbol 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 FrameBound added in v0.8.0

type FrameBound struct {
	Type      BoundType
	UnBounded bool
	Expr      Expr
}

func (*FrameBound) Format added in v0.8.0

func (node *FrameBound) Format(ctx *FmtCtx)

type FrameClause added in v0.8.0

type FrameClause struct {
	Type   FrameType
	HasEnd bool
	Start  *FrameBound
	End    *FrameBound
}

func (*FrameClause) Format added in v0.8.0

func (node *FrameClause) Format(ctx *FmtCtx)

type FrameType added in v0.8.0

type FrameType int
const (
	Rows FrameType = iota
	Range
	Groups
)

type From

type From struct {
	Tables TableExprs
}

the FROM clause.

func NewFrom

func NewFrom(t TableExprs) *From

func (*From) Format

func (node *From) Format(ctx *FmtCtx)

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

	WindowSpec *WindowSpec

	OrderBy OrderBy
	// contains filtered or unexported fields
}

function call expression

func (*FuncExpr) Accept added in v0.8.0

func (node *FuncExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*FuncExpr) Format

func (node *FuncExpr) Format(ctx *FmtCtx)

func (*FuncExpr) String

func (node *FuncExpr) String() string

type FuncType

type FuncType int
const (
	FUNC_TYPE_DEFAULT FuncType = iota
	FUNC_TYPE_DISTINCT
	FUNC_TYPE_ALL
	FUNC_TYPE_TABLE
)

func (*FuncType) ToString

func (node *FuncType) ToString() string

type FunctionArg added in v0.7.0

type FunctionArg interface {
	NodeFormatter
	Expr
	GetName(ctx *FmtCtx) string
	GetType(ctx *FmtCtx) string
}

type FunctionArgDecl added in v0.7.0

type FunctionArgDecl struct {
	FunctionArgImpl
	Name       *UnresolvedName
	Type       ResolvableTypeReference
	DefaultVal Expr
}

func NewFunctionArgDecl added in v0.7.0

func NewFunctionArgDecl(n *UnresolvedName, t ResolvableTypeReference, d Expr) *FunctionArgDecl

func (*FunctionArgDecl) Format added in v0.7.0

func (node *FunctionArgDecl) Format(ctx *FmtCtx)

func (*FunctionArgDecl) GetName added in v0.7.0

func (node *FunctionArgDecl) GetName(ctx *FmtCtx) string

func (*FunctionArgDecl) GetType added in v0.7.0

func (node *FunctionArgDecl) GetType(ctx *FmtCtx) string

type FunctionArgImpl added in v0.7.0

type FunctionArgImpl struct {
	FunctionArg
}

type FunctionArgs added in v0.7.0

type FunctionArgs []FunctionArg

container holding list of arguments in udf

type FunctionName added in v0.7.0

type FunctionName struct {
	Name objName
}

func NewFuncName added in v0.7.0

func NewFuncName(name Identifier, prefix ObjectNamePrefix) *FunctionName

func (*FunctionName) Format added in v0.7.0

func (node *FunctionName) Format(ctx *FmtCtx)

func (*FunctionName) HasNoNameQualifier added in v0.7.0

func (node *FunctionName) HasNoNameQualifier() bool

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
}

func NewGrant

func NewGrant() *Grant

func (*Grant) Format

func (node *Grant) Format(ctx *FmtCtx)

func (*Grant) GetQueryType added in v0.7.0

func (node *Grant) GetQueryType() string

func (*Grant) GetStatementType added in v0.7.0

func (node *Grant) GetStatementType() string

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)

func (*GrantPrivilege) GetQueryType added in v0.7.0

func (node *GrantPrivilege) GetQueryType() string

func (*GrantPrivilege) GetStatementType added in v0.7.0

func (node *GrantPrivilege) GetStatementType() string

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)

func (*GrantProxy) GetQueryType added in v0.7.0

func (node *GrantProxy) GetQueryType() string

func (*GrantProxy) GetStatementType added in v0.7.0

func (node *GrantProxy) GetStatementType() string

type GrantRole added in v0.6.0

type GrantRole struct {
	Roles       []*Role
	Users       []*User
	GrantOption bool
	// contains filtered or unexported fields
}

func (*GrantRole) Format added in v0.6.0

func (node *GrantRole) Format(ctx *FmtCtx)

func (*GrantRole) GetQueryType added in v0.7.0

func (node *GrantRole) GetQueryType() string

func (*GrantRole) GetStatementType added in v0.7.0

func (node *GrantRole) GetStatementType() string

type GrantType added in v0.6.0

type GrantType int
const (
	GrantTypePrivilege GrantType = iota
	GrantTypeRole
	GrantTypeProxy
)

type GroupBy

type GroupBy []Expr

a GROUP BY clause.

func (*GroupBy) Format

func (node *GroupBy) Format(ctx *FmtCtx)

type HashType

type HashType struct {
	Linear bool
	Expr   Expr
	// contains filtered or unexported fields
}

func NewHashType

func NewHashType(l bool, e Expr) *HashType

func (*HashType) Format

func (node *HashType) Format(ctx *FmtCtx)

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 IfStmt added in v0.8.0

type IfStmt struct {
	Cond  Expr
	Body  []Statement
	Elifs []*ElseIfStmt
	Else  []Statement
	// contains filtered or unexported fields
}

func (*IfStmt) Format added in v0.8.0

func (node *IfStmt) Format(ctx *FmtCtx)

func (*IfStmt) GetQueryType added in v0.8.0

func (node *IfStmt) GetQueryType() string

func (*IfStmt) GetStatementType added in v0.8.0

func (node *IfStmt) GetStatementType() string

type InOutArgType added in v0.8.0

type InOutArgType int
const (
	TYPE_IN InOutArgType = iota
	TYPE_OUT
	TYPE_INOUT
)

type IncrementByOption added in v0.8.0

type IncrementByOption struct {
	Minus bool
	Num   any
}

func (*IncrementByOption) Format added in v0.8.0

func (node *IncrementByOption) Format(ctx *FmtCtx)

type Index

type Index struct {
	IfNotExists bool
	KeyParts    []*KeyPart
	Name        string
	KeyType     IndexType
	IndexOption *IndexOption
	// contains filtered or unexported fields
}

func NewIndex

func NewIndex(k []*KeyPart, n string, t IndexType, io *IndexOption) *Index

func (*Index) Format

func (node *Index) Format(ctx *FmtCtx)

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
}

func (*IndexHint) Format added in v0.6.0

func (node *IndexHint) Format(ctx *FmtCtx)

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 IndexType

type IndexType int
const (
	INDEX_TYPE_INVALID IndexType = iota
	INDEX_TYPE_BTREE
	INDEX_TYPE_HASH
	INDEX_TYPE_RTREE
	INDEX_TYPE_BSI
	INDEX_TYPE_ZONEMAP
)

func (IndexType) ToString

func (it IndexType) ToString() string

type Insert

type Insert struct {
	Table             TableExpr
	Accounts          IdentifierList
	PartitionNames    IdentifierList
	Columns           IdentifierList
	Rows              *Select
	OnDuplicateUpdate UpdateExprs
	// contains filtered or unexported fields
}

the INSERT statement.

func NewInsert

func NewInsert(t TableExpr, c IdentifierList, r *Select, p IdentifierList) *Insert

func (*Insert) Format

func (node *Insert) Format(ctx *FmtCtx)

func (*Insert) GetQueryType added in v0.7.0

func (node *Insert) GetQueryType() string

func (*Insert) GetStatementType added in v0.7.0

func (node *Insert) GetStatementType() string

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 width) 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.
	Scale 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) Accept added in v0.8.0

func (node *IntervalExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker Accept interface.

func (*IntervalExpr) Format

func (node *IntervalExpr) Format(ctx *FmtCtx)

func (*IntervalExpr) String

func (node *IntervalExpr) String() string

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) Accept added in v0.8.0

func (node *IsFalseExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*IsFalseExpr) Format added in v0.6.0

func (node *IsFalseExpr) Format(ctx *FmtCtx)

func (*IsFalseExpr) String added in v0.6.0

func (node *IsFalseExpr) String() string

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) Accept added in v0.8.0

func (node *IsNotFalseExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*IsNotFalseExpr) Format added in v0.6.0

func (node *IsNotFalseExpr) Format(ctx *FmtCtx)

func (*IsNotFalseExpr) String added in v0.6.0

func (node *IsNotFalseExpr) String() string

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) Accept added in v0.8.0

func (node *IsNotNullExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*IsNotNullExpr) Format

func (node *IsNotNullExpr) Format(ctx *FmtCtx)

func (*IsNotNullExpr) String

func (node *IsNotNullExpr) String() string

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) Accept added in v0.8.0

func (node *IsNotTrueExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*IsNotTrueExpr) Format added in v0.6.0

func (node *IsNotTrueExpr) Format(ctx *FmtCtx)

func (*IsNotTrueExpr) String added in v0.6.0

func (node *IsNotTrueExpr) String() string

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) Accept added in v0.8.0

func (node *IsNotUnknownExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*IsNotUnknownExpr) Format added in v0.6.0

func (node *IsNotUnknownExpr) Format(ctx *FmtCtx)

func (*IsNotUnknownExpr) String added in v0.6.0

func (node *IsNotUnknownExpr) String() string

type IsNullExpr

type IsNullExpr struct {
	Expr Expr
	// contains filtered or unexported fields
}

is null expression

func NewIsNullExpr

func NewIsNullExpr(e Expr) *IsNullExpr

func (*IsNullExpr) Accept added in v0.8.0

func (node *IsNullExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*IsNullExpr) Format

func (node *IsNullExpr) Format(ctx *FmtCtx)

func (*IsNullExpr) String

func (node *IsNullExpr) String() string

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) Accept added in v0.8.0

func (node *IsTrueExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*IsTrueExpr) Format added in v0.6.0

func (node *IsTrueExpr) Format(ctx *FmtCtx)

func (*IsTrueExpr) String added in v0.6.0

func (node *IsTrueExpr) String() string

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) Accept added in v0.8.0

func (node *IsUnknownExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*IsUnknownExpr) Format added in v0.6.0

func (node *IsUnknownExpr) Format(ctx *FmtCtx)

func (*IsUnknownExpr) String added in v0.6.0

func (node *IsUnknownExpr) String() string

type IsolationLevelType added in v0.8.0

type IsolationLevelType int
const (
	ISOLATION_LEVEL_NONE IsolationLevelType = iota
	ISOLATION_LEVEL_REPEATABLE_READ
	ISOLATION_LEVEL_READ_COMMITTED
	ISOLATION_LEVEL_READ_UNCOMMITTED
	ISOLATION_LEVEL_SERIALIZABLE
)

func (IsolationLevelType) String added in v0.8.0

func (ilt IsolationLevelType) String() string

type IterateStmt added in v0.8.0

type IterateStmt struct {
	Name Identifier
	// contains filtered or unexported fields
}

func (*IterateStmt) Format added in v0.8.0

func (node *IterateStmt) Format(ctx *FmtCtx)

func (*IterateStmt) GetQueryType added in v0.8.0

func (node *IterateStmt) GetQueryType() string

func (*IterateStmt) GetStatementType added in v0.8.0

func (node *IterateStmt) GetStatementType() string

type JoinCond

type JoinCond interface {
	NodeFormatter
}

the join condition.

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

func (*KeyPart) Format

func (node *KeyPart) Format(ctx *FmtCtx)

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

func (*KeyType) Format

func (node *KeyType) Format(ctx *FmtCtx)

type Kill added in v0.7.0

type Kill struct {
	Option       KillOption
	ConnectionId uint64
	StmtOption   StatementOption
	// contains filtered or unexported fields
}

func (*Kill) Format added in v0.7.0

func (k *Kill) Format(ctx *FmtCtx)

func (*Kill) GetQueryType added in v0.7.0

func (k *Kill) GetQueryType() string

func (*Kill) GetStatementType added in v0.7.0

func (k *Kill) GetStatementType() string

type KillOption added in v0.7.0

type KillOption struct {
	Exist bool
	Typ   KillType
}

func (KillOption) Format added in v0.7.0

func (ko KillOption) Format(ctx *FmtCtx)

type KillType added in v0.7.0

type KillType int
const (
	KillTypeConnection KillType = iota
	KillTypeQuery
)

func (KillType) String added in v0.7.0

func (k KillType) String() string

type LeaveStmt added in v0.8.0

type LeaveStmt struct {
	Name Identifier
	// contains filtered or unexported fields
}

func (*LeaveStmt) Format added in v0.8.0

func (node *LeaveStmt) Format(ctx *FmtCtx)

func (*LeaveStmt) GetQueryType added in v0.8.0

func (node *LeaveStmt) GetQueryType() string

func (*LeaveStmt) GetStatementType added in v0.8.0

func (node *LeaveStmt) GetStatementType() string

type LengthScaleOpt

type LengthScaleOpt struct {
	DisplayWith int32
	Scale       int32
}

type Limit

type Limit struct {
	Offset, Count Expr
}

the LIMIT clause.

func NewLimit

func NewLimit(o, c Expr) *Limit

func (*Limit) Format

func (node *Limit) Format(ctx *FmtCtx)

type Lines

type Lines struct {
	StartingBy   string
	TerminatedBy string
}

func NewLines

func NewLines(s string, t string) *Lines

func (*Lines) Format

func (node *Lines) Format(ctx *FmtCtx)

type ListType

type ListType struct {
	Expr       Expr
	ColumnList []*UnresolvedName
	// contains filtered or unexported fields
}

func NewListType

func NewListType(e Expr, c []*UnresolvedName) *ListType

func (*ListType) Format

func (node *ListType) Format(ctx *FmtCtx)

type Load

type Load struct {
	Local             bool
	DuplicateHandling DuplicateKey
	Table             *TableName
	Accounts          IdentifierList
	//Partition
	Param *ExternParam
	// contains filtered or unexported fields
}

Load data statement

func (*Load) Format

func (node *Load) Format(ctx *FmtCtx)

func (*Load) GetQueryType added in v0.7.0

func (node *Load) GetQueryType() string

func (*Load) GetStatementType added in v0.7.0

func (node *Load) GetStatementType() string

type LoadColumn

type LoadColumn interface {
	NodeFormatter
}

column element in load data column list

type LoadExtension added in v0.7.0

type LoadExtension struct {
	Name Identifier
	// contains filtered or unexported fields
}

func (*LoadExtension) Format added in v0.7.0

func (node *LoadExtension) Format(ctx *FmtCtx)

type LockDefault

type LockDefault struct {
	// contains filtered or unexported fields
}

type LockExclusive

type LockExclusive struct {
	// contains filtered or unexported fields
}

type LockNone

type LockNone struct {
	// contains filtered or unexported fields
}

type LockShared

type LockShared struct {
	// contains filtered or unexported fields
}

type LockTableStmt added in v0.7.0

type LockTableStmt struct {
	TableLocks []TableLock
	// contains filtered or unexported fields
}

func (*LockTableStmt) Format added in v0.7.0

func (node *LockTableStmt) Format(ctx *FmtCtx)

func (*LockTableStmt) GetQueryType added in v0.7.0

func (node *LockTableStmt) GetQueryType() string

func (*LockTableStmt) GetStatementType added in v0.7.0

func (node *LockTableStmt) GetStatementType() string

type LoopStmt added in v0.8.0

type LoopStmt struct {
	Name Identifier
	Body []Statement
	// contains filtered or unexported fields
}

func (*LoopStmt) Format added in v0.8.0

func (node *LoopStmt) Format(ctx *FmtCtx)

func (*LoopStmt) GetQueryType added in v0.8.0

func (node *LoopStmt) GetQueryType() string

func (*LoopStmt) GetStatementType added in v0.8.0

func (node *LoopStmt) GetStatementType() string

type MatchType

type MatchType int

in reference definition

const (
	MATCH_INVALID MatchType = iota
	MATCH_FULL
	MATCH_PARTIAL
	MATCH_SIMPLE
)

func (*MatchType) ToString

func (node *MatchType) ToString() string

type MaxValue

type MaxValue struct {
	// contains filtered or unexported fields
}

func NewMaxValue

func NewMaxValue() *MaxValue

func (*MaxValue) Accept added in v0.8.0

func (node *MaxValue) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*MaxValue) Format added in v0.6.0

func (node *MaxValue) Format(ctx *FmtCtx)

func (*MaxValue) String

func (node *MaxValue) String() string

type MaxValueOption added in v0.8.0

type MaxValueOption struct {
	Minus bool
	Num   any
}

func (*MaxValueOption) Format added in v0.8.0

func (node *MaxValueOption) Format(ctx *FmtCtx)

type MinValueOption added in v0.8.0

type MinValueOption struct {
	Minus bool
	Num   any
}

func (*MinValueOption) Format added in v0.8.0

func (node *MinValueOption) Format(ctx *FmtCtx)

type MiscOption

type MiscOption interface {
	NodeFormatter
}

type MoDump added in v0.6.0

type MoDump struct {
	ExportParams *ExportParam
	// contains filtered or unexported fields
}

func (*MoDump) Format added in v0.6.0

func (node *MoDump) Format(ctx *FmtCtx)

func (*MoDump) GetQueryType added in v0.7.0

func (node *MoDump) GetQueryType() string

func (*MoDump) GetStatementType added in v0.7.0

func (node *MoDump) GetStatementType() string

type NameParts

type NameParts = [4]string

the path in an UnresolvedName.

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 NodeChecker added in v0.8.0

type NodeChecker interface {

	//	The general implementation logic of the `Accept` method is:
	//	First, call the Visitor.`Enter` method, and assign the returned `node` to the receiver of the `Accept` method,
	//	If the returnd `skipChildren` value is true, then it is necessary to stop accessing the receiver's child node
	//	Otherwise, recursively call the` Accept` of its children nodes,
	//	Finally, don't forget to call the Visitor's `Exit` method
	Accept(v Visitor) (node Expr, ok bool)
}

Visitor Design Pattern NodeChecker is abstract tree Node

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

func NewNotExpr(e Expr) *NotExpr

func (*NotExpr) Accept added in v0.8.0

func (node *NotExpr) Accept(v Visitor) (Expr, bool)

func (*NotExpr) Format

func (node *NotExpr) Format(ctx *FmtCtx)

func (*NotExpr) String

func (node *NotExpr) String() string

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 NewNumVal

func NewNumVal(value constant.Value, origString string, negative bool) *NumVal

func NewNumValWithResFoalt

func NewNumValWithResFoalt(value constant.Value, origString string, negative bool, resFloat float64) *NumVal

func NewNumValWithResInt

func NewNumValWithResInt(value constant.Value, origString string, negative bool, resInt int64) *NumVal

func NewNumValWithType added in v0.5.0

func NewNumValWithType(value constant.Value, origString string, negative bool, typ P_TYPE) *NumVal

func (*NumVal) Accept added in v0.8.0

func (n *NumVal) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker Accept interface.

func (*NumVal) Format

func (n *NumVal) Format(ctx *FmtCtx)

func (*NumVal) Negative

func (n *NumVal) Negative() bool

func (*NumVal) OrigString added in v0.8.0

func (n *NumVal) OrigString() string

func (*NumVal) String

func (n *NumVal) String() string

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

type OnJoinCond struct {
	JoinCond
	Expr Expr
}

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

type OptionElem struct {
	Name  string
	Value string
}

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

func NewOrExpr

func NewOrExpr(l, r Expr) *OrExpr

func (*OrExpr) Accept added in v0.8.0

func (node *OrExpr) Accept(v Visitor) (Expr, bool)

func (*OrExpr) Format

func (node *OrExpr) Format(ctx *FmtCtx)

func (*OrExpr) String

func (node *OrExpr) String() string

type Order

type Order struct {
	Expr          Expr
	Direction     Direction
	NullsPosition NullsPosition
	//without order
	NullOrder bool
}

the ordering expression.

func NewOrder

func NewOrder(e Expr, d Direction, np NullsPosition, o bool) *Order

func (*Order) Format

func (node *Order) Format(ctx *FmtCtx)

type OrderBy

type OrderBy []*Order

OrderBy represents an ORDER BY clause.

func (*OrderBy) Format

func (node *OrderBy) Format(ctx *FmtCtx)

type P_TYPE added in v0.5.0

type P_TYPE uint8
const (
	P_any P_TYPE = iota
	P_hexnum
	P_null
	P_bool
	P_int64
	P_uint64
	P_float64
	P_char
	P_decimal
	P_bit
	P_ScoreBinary
	P_nulltext
)

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

func NewParamExpr(offset int) *ParamExpr

func (*ParamExpr) Accept added in v0.8.0

func (node *ParamExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker Accept interface.

func (*ParamExpr) Format added in v0.5.1

func (node *ParamExpr) Format(ctx *FmtCtx)

func (*ParamExpr) String added in v0.5.1

func (node *ParamExpr) String() string

type ParenExpr

type ParenExpr struct {
	Expr Expr
	// contains filtered or unexported fields
}

the parenthesized expression.

func NewParenExpr

func NewParenExpr(e Expr) *ParenExpr

func (*ParenExpr) Accept added in v0.8.0

func (node *ParenExpr) Accept(v Visitor) (Expr, bool)

func (*ParenExpr) Format

func (node *ParenExpr) Format(ctx *FmtCtx)

func (*ParenExpr) String

func (node *ParenExpr) String() string

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

type ParenTableExpr struct {
	TableExpr
	Expr TableExpr
}

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

func (*Partition) Format

func (node *Partition) Format(ctx *FmtCtx)

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 Prepare added in v0.5.1

type Prepare interface {
	Statement
}

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)

func (*PrepareStmt) GetQueryType added in v0.7.0

func (node *PrepareStmt) GetQueryType() string

func (*PrepareStmt) GetStatementType added in v0.7.0

func (node *PrepareStmt) GetStatementType() string

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)

func (*PrepareString) GetQueryType added in v0.7.0

func (node *PrepareString) GetQueryType() string

func (*PrepareString) GetStatementType added in v0.7.0

func (node *PrepareString) GetStatementType() string

type PrimaryKeyIndex

type PrimaryKeyIndex struct {
	KeyParts         []*KeyPart
	Name             string
	ConstraintSymbol 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

func (*Privilege) Format

func (node *Privilege) Format(ctx *FmtCtx)

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.
)

* From: https://dev.mysql.com/doc/refman/8.0/en/grant.html

func (*PrivilegeType) ToString

func (node *PrivilegeType) ToString() string

type ProcedureArg added in v0.8.0

type ProcedureArg interface {
	NodeFormatter
	GetName(ctx *FmtCtx) string
	GetType() int
}

type ProcedureArgDecl added in v0.8.0

type ProcedureArgDecl struct {
	ProcedureArgImpl
	Name      *UnresolvedName
	Type      ResolvableTypeReference
	InOutType InOutArgType
}

func NewProcedureArgDecl added in v0.8.0

func (*ProcedureArgDecl) Format added in v0.8.0

func (node *ProcedureArgDecl) Format(ctx *FmtCtx)

func (*ProcedureArgDecl) GetName added in v0.8.0

func (node *ProcedureArgDecl) GetName(ctx *FmtCtx) string

func (*ProcedureArgDecl) GetType added in v0.8.0

func (node *ProcedureArgDecl) GetType() int

type ProcedureArgForMarshal added in v0.8.0

type ProcedureArgForMarshal struct {
	Name      *UnresolvedName
	Type      ResolvableTypeReference
	InOutType InOutArgType
}

type ProcedureArgImpl added in v0.8.0

type ProcedureArgImpl struct {
	ProcedureArg
}

type ProcedureArgType added in v0.8.0

type ProcedureArgType struct {
	Type InOutArgType
}

type ProcedureArgs added in v0.8.0

type ProcedureArgs []ProcedureArg

container holding list of arguments in udf

type ProcedureName added in v0.8.0

type ProcedureName struct {
	Name objName
}

func NewProcedureName added in v0.8.0

func NewProcedureName(name Identifier, prefix ObjectNamePrefix) *ProcedureName

func (*ProcedureName) Format added in v0.8.0

func (node *ProcedureName) Format(ctx *FmtCtx)

func (*ProcedureName) HasNoNameQualifier added in v0.8.0

func (node *ProcedureName) HasNoNameQualifier() bool

type Property

type Property struct {
	Key   string
	Value string
}

func (*Property) Format

func (node *Property) Format(ctx *FmtCtx)

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

func NewRangeCond(n bool, l, f, t Expr) *RangeCond

func (*RangeCond) Accept added in v0.8.0

func (node *RangeCond) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*RangeCond) Format

func (node *RangeCond) Format(ctx *FmtCtx)

func (*RangeCond) String

func (node *RangeCond) String() string

type RangeType

type RangeType struct {
	Expr       Expr
	ColumnList []*UnresolvedName
	// contains filtered or unexported fields
}

func NewRangeType

func NewRangeType(e Expr, c []*UnresolvedName) *RangeType

func (*RangeType) Format

func (node *RangeType) Format(ctx *FmtCtx)

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 RepeatStmt added in v0.8.0

type RepeatStmt struct {
	Name Identifier
	Body []Statement
	Cond Expr
	// contains filtered or unexported fields
}

func (*RepeatStmt) Format added in v0.8.0

func (node *RepeatStmt) Format(ctx *FmtCtx)

func (*RepeatStmt) GetQueryType added in v0.8.0

func (node *RepeatStmt) GetQueryType() string

func (*RepeatStmt) GetStatementType added in v0.8.0

func (node *RepeatStmt) GetStatementType() 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

func (*Replace) Format added in v0.6.0

func (node *Replace) Format(ctx *FmtCtx)

func (*Replace) GetQueryType added in v0.7.0

func (node *Replace) GetQueryType() string

func (*Replace) GetStatementType added in v0.7.0

func (node *Replace) GetStatementType() string

type Reset added in v0.7.0

type Reset struct {
	Statement
	Name Identifier
}

func NewReset added in v0.7.0

func NewReset(name Identifier) *Reset

func (*Reset) Format added in v0.7.0

func (node *Reset) Format(ctx *FmtCtx)

func (*Reset) GetQueryType added in v0.7.0

func (node *Reset) GetQueryType() string

func (*Reset) GetStatementType added in v0.7.0

func (node *Reset) GetStatementType() string

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 ResolvableTypeReference

type ResolvableTypeReference interface {
}

type reference

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 ReturnType added in v0.7.0

type ReturnType struct {
	Type ResolvableTypeReference
}

func NewReturnType added in v0.7.0

func NewReturnType(t ResolvableTypeReference) *ReturnType

func (*ReturnType) Format added in v0.7.0

func (node *ReturnType) Format(ctx *FmtCtx)

type Revoke

type Revoke struct {
	Typ             RevokeType
	RevokePrivilege RevokePrivilege
	RevokeRole      RevokeRole
	// contains filtered or unexported fields
}

func NewRevoke

func NewRevoke() *Revoke

func (*Revoke) Format

func (node *Revoke) Format(ctx *FmtCtx)

func (*Revoke) GetQueryType added in v0.7.0

func (node *Revoke) GetQueryType() string

func (*Revoke) GetStatementType added in v0.7.0

func (node *Revoke) GetStatementType() string

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)

func (*RevokePrivilege) GetQueryType added in v0.7.0

func (node *RevokePrivilege) GetQueryType() string

func (*RevokePrivilege) GetStatementType added in v0.7.0

func (node *RevokePrivilege) GetStatementType() string

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)

func (*RevokeRole) GetQueryType added in v0.7.0

func (node *RevokeRole) GetQueryType() string

func (*RevokeRole) GetStatementType added in v0.7.0

func (node *RevokeRole) GetStatementType() string

type RevokeType added in v0.6.0

type RevokeType int
const (
	RevokeTypePrivilege RevokeType = iota
	RevokeTypeRole
)

type Role

type Role struct {
	NodeFormatter
	UserName string
}

func NewRole

func NewRole(u string) *Role

func (*Role) Format

func (node *Role) Format(ctx *FmtCtx)

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)

func (*RollbackTransaction) GetQueryType added in v0.7.0

func (node *RollbackTransaction) GetQueryType() string

func (*RollbackTransaction) GetStatementType added in v0.7.0

func (node *RollbackTransaction) GetStatementType() string

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 S3Parameter struct {
	Endpoint   string `json:"s3-test-endpoint"`
	Region     string `json:"s3-test-region"`
	APIKey     string `json:"s3-test-key"`
	APISecret  string `json:"s3-test-secret"`
	Bucket     string `json:"s3-test-bucket"`
	Provider   string `json:"s3-test-rovider"`
	RoleArn    string `json:"s3-test-rolearn"`
	ExternalId string `json:"s3-test-externalid"`
}

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
	SelectLockInfo *SelectLockInfo
	// contains filtered or unexported fields
}

Select represents a SelectStatement with an ORDER and/or LIMIT.

func NewSelect

func NewSelect(s SelectStatement, o OrderBy, l *Limit) *Select

func (*Select) Format

func (node *Select) Format(ctx *FmtCtx)

func (*Select) GetQueryType added in v0.7.0

func (node *Select) GetQueryType() string

func (*Select) GetStatementType added in v0.7.0

func (node *Select) GetStatementType() string

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)

func (*SelectClause) GetQueryType added in v0.7.0

func (node *SelectClause) GetQueryType() string

func (*SelectClause) GetStatementType added in v0.7.0

func (node *SelectClause) GetStatementType() string

type SelectExpr

type SelectExpr struct {
	Expr Expr
	As   *CStr
	// contains filtered or unexported fields
}

a SELECT expression.

func (*SelectExpr) Format

func (node *SelectExpr) Format(ctx *FmtCtx)

func (*SelectExpr) String

func (node *SelectExpr) String() string

type SelectExprs

type SelectExprs []SelectExpr

SELECT expressions.

func (*SelectExprs) Format

func (node *SelectExprs) Format(ctx *FmtCtx)

type SelectLockInfo added in v0.8.0

type SelectLockInfo struct {
	LockType SelectLockType
	WaitSec  uint64
	Tables   []*TableName
}

func (*SelectLockInfo) Format added in v0.8.0

func (node *SelectLockInfo) Format(ctx *FmtCtx)

type SelectLockType added in v0.8.0

type SelectLockType int

SelectLockType is the lock type for SelectStmt.

const (
	SelectLockNone SelectLockType = iota
	SelectLockForUpdate
	SelectLockForShare
	SelectLockForUpdateNoWait
	SelectLockForUpdateWaitN
	SelectLockForShareNoWait
	SelectLockForUpdateSkipLocked
	SelectLockForShareSkipLocked
)

Select lock types.

func (SelectLockType) String added in v0.8.0

func (n SelectLockType) String() string

String implements fmt.Stringer.

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)

func (*SetDefaultRole) GetQueryType added in v0.7.0

func (node *SetDefaultRole) GetQueryType() string

func (*SetDefaultRole) GetStatementType added in v0.7.0

func (node *SetDefaultRole) GetStatementType() string

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

type SetPassword struct {
	User     *User
	Password string
	// contains filtered or unexported fields
}

func NewSetPassword

func NewSetPassword(u *User, p string) *SetPassword

func (*SetPassword) Format

func (node *SetPassword) Format(ctx *FmtCtx)

func (*SetPassword) GetQueryType added in v0.7.0

func (node *SetPassword) GetQueryType() string

func (*SetPassword) GetStatementType added in v0.7.0

func (node *SetPassword) GetStatementType() string

type SetRole

type SetRole struct {
	SecondaryRole     bool
	SecondaryRoleType SecondaryRoleType
	Role              *Role
	// contains filtered or unexported fields
}

func (*SetRole) Format

func (node *SetRole) Format(ctx *FmtCtx)

func (*SetRole) GetQueryType added in v0.7.0

func (node *SetRole) GetQueryType() string

func (*SetRole) GetStatementType added in v0.7.0

func (node *SetRole) GetStatementType() string

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 SetTransaction added in v0.8.0

type SetTransaction struct {
	Global        bool
	CharacterList []*TransactionCharacteristic
	// contains filtered or unexported fields
}

func (*SetTransaction) Format added in v0.8.0

func (node *SetTransaction) Format(ctx *FmtCtx)

func (*SetTransaction) GetQueryType added in v0.8.0

func (node *SetTransaction) GetQueryType() string

func (*SetTransaction) GetStatementType added in v0.8.0

func (node *SetTransaction) GetStatementType() string

type SetVar

type SetVar struct {
	Assignments []*VarAssignmentExpr
	// contains filtered or unexported fields
}

func NewSetVar

func NewSetVar(a []*VarAssignmentExpr) *SetVar

func (*SetVar) Accept added in v0.8.0

func (node *SetVar) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface.

func (*SetVar) Format

func (node *SetVar) Format(ctx *FmtCtx)

func (*SetVar) GetQueryType added in v0.7.0

func (node *SetVar) GetQueryType() string

func (*SetVar) GetStatementType added in v0.7.0

func (node *SetVar) GetStatementType() string

type Show

type Show interface {
	Explain
}

type ShowAccounts added in v0.7.0

type ShowAccounts struct {
	Like *ComparisonExpr
	// contains filtered or unexported fields
}

func (*ShowAccounts) Format added in v0.7.0

func (node *ShowAccounts) Format(ctx *FmtCtx)

func (*ShowAccounts) GetQueryType added in v0.7.0

func (node *ShowAccounts) GetQueryType() string

func (*ShowAccounts) GetStatementType added in v0.7.0

func (node *ShowAccounts) GetStatementType() string

type ShowBackendServers added in v0.8.0

type ShowBackendServers struct {
	// contains filtered or unexported fields
}

ShowBackendServers indicates SHOW BACKEND SERVERS statement.

func (*ShowBackendServers) Format added in v0.8.0

func (node *ShowBackendServers) Format(ctx *FmtCtx)

func (*ShowBackendServers) GetQueryType added in v0.8.0

func (node *ShowBackendServers) GetQueryType() string

func (*ShowBackendServers) GetStatementType added in v0.8.0

func (node *ShowBackendServers) GetStatementType() string

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)

func (*ShowCollation) GetQueryType added in v0.7.0

func (node *ShowCollation) GetQueryType() string

func (*ShowCollation) GetStatementType added in v0.7.0

func (node *ShowCollation) GetStatementType() string

type ShowColumnNumber added in v0.7.0

type ShowColumnNumber struct {
	Table  *UnresolvedObjectName
	DbName string
	// contains filtered or unexported fields
}

show column number

func NewShowColumnNumber added in v0.7.0

func NewShowColumnNumber(table *UnresolvedObjectName, dbname string) *ShowColumnNumber

func (*ShowColumnNumber) Format added in v0.7.0

func (node *ShowColumnNumber) Format(ctx *FmtCtx)

func (*ShowColumnNumber) GetQueryType added in v0.7.0

func (node *ShowColumnNumber) GetQueryType() string

func (*ShowColumnNumber) GetStatementType added in v0.7.0

func (node *ShowColumnNumber) GetStatementType() string

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)

func (*ShowColumns) GetQueryType added in v0.7.0

func (node *ShowColumns) GetQueryType() string

func (*ShowColumns) GetStatementType added in v0.7.0

func (node *ShowColumns) GetStatementType() string

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)

func (*ShowCreateDatabase) GetQueryType added in v0.7.0

func (node *ShowCreateDatabase) GetQueryType() string

func (*ShowCreateDatabase) GetStatementType added in v0.7.0

func (node *ShowCreateDatabase) GetStatementType() string

type ShowCreatePublications added in v0.8.0

type ShowCreatePublications struct {
	Name string
	// contains filtered or unexported fields
}

func (*ShowCreatePublications) Format added in v0.8.0

func (node *ShowCreatePublications) Format(ctx *FmtCtx)

func (*ShowCreatePublications) GetQueryType added in v0.8.0

func (node *ShowCreatePublications) GetQueryType() string

func (*ShowCreatePublications) GetStatementType added in v0.8.0

func (node *ShowCreatePublications) GetStatementType() string

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)

func (*ShowCreateTable) GetQueryType added in v0.7.0

func (node *ShowCreateTable) GetQueryType() string

func (*ShowCreateTable) GetStatementType added in v0.7.0

func (node *ShowCreateTable) GetStatementType() string

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)

func (*ShowCreateView) GetQueryType added in v0.7.0

func (node *ShowCreateView) GetQueryType() string

func (*ShowCreateView) GetStatementType added in v0.7.0

func (node *ShowCreateView) GetStatementType() string

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)

func (*ShowDatabases) GetQueryType added in v0.7.0

func (node *ShowDatabases) GetQueryType() string

func (*ShowDatabases) GetStatementType added in v0.7.0

func (node *ShowDatabases) GetStatementType() string

type ShowErrors

type ShowErrors struct {
	// contains filtered or unexported fields
}

func NewShowErrors

func NewShowErrors() *ShowErrors

func (*ShowErrors) Format

func (node *ShowErrors) Format(ctx *FmtCtx)

func (*ShowErrors) GetQueryType added in v0.7.0

func (node *ShowErrors) GetQueryType() string

func (*ShowErrors) GetStatementType added in v0.7.0

func (node *ShowErrors) GetStatementType() string

type ShowFunctionOrProcedureStatus added in v0.8.0

type ShowFunctionOrProcedureStatus struct {
	Like       *ComparisonExpr
	Where      *Where
	IsFunction bool
	// contains filtered or unexported fields
}

func NewShowFunctionOrProcedureStatus added in v0.8.0

func NewShowFunctionOrProcedureStatus(l *ComparisonExpr, w *Where, i bool) *ShowFunctionOrProcedureStatus

func (*ShowFunctionOrProcedureStatus) Format added in v0.8.0

func (node *ShowFunctionOrProcedureStatus) Format(ctx *FmtCtx)

func (*ShowFunctionOrProcedureStatus) GetQueryType added in v0.8.0

func (node *ShowFunctionOrProcedureStatus) GetQueryType() string

func (*ShowFunctionOrProcedureStatus) GetStatementType added in v0.8.0

func (node *ShowFunctionOrProcedureStatus) GetStatementType() string

type ShowGrantType added in v0.7.0

type ShowGrantType int

type ShowGrants added in v0.6.0

type ShowGrants struct {
	Username      string
	Hostname      string
	Roles         []*Role
	ShowGrantType ShowGrantType
	// contains filtered or unexported fields
}

func (*ShowGrants) Format added in v0.6.0

func (node *ShowGrants) Format(ctx *FmtCtx)

func (*ShowGrants) GetQueryType added in v0.7.0

func (node *ShowGrants) GetQueryType() string

func (*ShowGrants) GetStatementType added in v0.7.0

func (node *ShowGrants) GetStatementType() string

type ShowIndex

type ShowIndex struct {
	TableName TableName
	Where     *Where
	// contains filtered or unexported fields
}

show index statement

func NewShowIndex

func NewShowIndex(t TableName, w *Where) *ShowIndex

func (*ShowIndex) Format

func (node *ShowIndex) Format(ctx *FmtCtx)

func (*ShowIndex) GetQueryType added in v0.7.0

func (node *ShowIndex) GetQueryType() string

func (*ShowIndex) GetStatementType added in v0.7.0

func (node *ShowIndex) GetStatementType() string

type ShowLocks added in v0.7.0

type ShowLocks struct {
	// contains filtered or unexported fields
}

show locks

func NewShowLocks added in v0.7.0

func NewShowLocks() *ShowLocks

func (*ShowLocks) Format added in v0.7.0

func (node *ShowLocks) Format(ctx *FmtCtx)

func (*ShowLocks) GetQueryType added in v0.7.0

func (node *ShowLocks) GetQueryType() string

func (*ShowLocks) GetStatementType added in v0.7.0

func (node *ShowLocks) GetStatementType() string

type ShowNodeList added in v0.7.0

type ShowNodeList struct {
	// contains filtered or unexported fields
}

show node list

func NewShowNodeList added in v0.7.0

func NewShowNodeList() *ShowNodeList

func (*ShowNodeList) Format added in v0.7.0

func (node *ShowNodeList) Format(ctx *FmtCtx)

func (*ShowNodeList) GetQueryType added in v0.7.0

func (node *ShowNodeList) GetQueryType() string

func (*ShowNodeList) GetStatementType added in v0.7.0

func (node *ShowNodeList) GetStatementType() string

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)

func (*ShowProcessList) GetQueryType added in v0.7.0

func (node *ShowProcessList) GetQueryType() string

func (*ShowProcessList) GetStatementType added in v0.7.0

func (node *ShowProcessList) GetStatementType() string

type ShowPublications added in v0.8.0

type ShowPublications struct {
	Like *ComparisonExpr
	// contains filtered or unexported fields
}

func (*ShowPublications) Format added in v0.8.0

func (node *ShowPublications) Format(ctx *FmtCtx)

func (*ShowPublications) GetQueryType added in v0.8.0

func (node *ShowPublications) GetQueryType() string

func (*ShowPublications) GetStatementType added in v0.8.0

func (node *ShowPublications) GetStatementType() string

type ShowRolesStmt added in v0.8.0

type ShowRolesStmt struct {
	Like *ComparisonExpr
	// contains filtered or unexported fields
}

func (*ShowRolesStmt) Format added in v0.8.0

func (node *ShowRolesStmt) Format(ctx *FmtCtx)

func (*ShowRolesStmt) GetQueryType added in v0.8.0

func (node *ShowRolesStmt) GetQueryType() string

func (*ShowRolesStmt) GetStatementType added in v0.8.0

func (node *ShowRolesStmt) GetStatementType() string

type ShowSequences added in v0.8.0

type ShowSequences struct {
	DBName string
	Where  *Where
	// contains filtered or unexported fields
}

SHOW SEQUENCES statement.

func (*ShowSequences) Format added in v0.8.0

func (node *ShowSequences) Format(ctx *FmtCtx)

func (*ShowSequences) GetQueryType added in v0.8.0

func (node *ShowSequences) GetQueryType() string

func (*ShowSequences) GetStatementType added in v0.8.0

func (node *ShowSequences) GetStatementType() string

type ShowStages added in v1.0.0

type ShowStages struct {
	Like *ComparisonExpr
	// contains filtered or unexported fields
}

func (*ShowStages) Format added in v1.0.0

func (node *ShowStages) Format(ctx *FmtCtx)

func (*ShowStages) GetQueryType added in v1.0.0

func (node *ShowStages) GetQueryType() string

func (*ShowStages) GetStatementType added in v1.0.0

func (node *ShowStages) GetStatementType() string

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)

func (*ShowStatus) GetQueryType added in v0.7.0

func (node *ShowStatus) GetQueryType() string

func (*ShowStatus) GetStatementType added in v0.7.0

func (node *ShowStatus) GetStatementType() string

type ShowSubscriptions added in v0.8.0

type ShowSubscriptions struct {
	Like *ComparisonExpr
	// contains filtered or unexported fields
}

func (*ShowSubscriptions) Format added in v0.8.0

func (node *ShowSubscriptions) Format(ctx *FmtCtx)

func (*ShowSubscriptions) GetQueryType added in v0.8.0

func (node *ShowSubscriptions) GetQueryType() string

func (*ShowSubscriptions) GetStatementType added in v0.8.0

func (node *ShowSubscriptions) GetStatementType() string

type ShowTableNumber added in v0.7.0

type ShowTableNumber struct {
	DbName string
	// contains filtered or unexported fields
}

show table number

func NewShowTableNumber added in v0.7.0

func NewShowTableNumber(dbname string) *ShowTableNumber

func (*ShowTableNumber) Format added in v0.7.0

func (node *ShowTableNumber) Format(ctx *FmtCtx)

func (*ShowTableNumber) GetQueryType added in v0.7.0

func (node *ShowTableNumber) GetQueryType() string

func (*ShowTableNumber) GetStatementType added in v0.7.0

func (node *ShowTableNumber) GetStatementType() string

type ShowTableSize added in v0.8.0

type ShowTableSize struct {
	Table  *UnresolvedObjectName
	DbName string
	// contains filtered or unexported fields
}

func NewShowTableSize added in v0.8.0

func NewShowTableSize(table *UnresolvedObjectName, dbname string) *ShowTableSize

func (*ShowTableSize) Format added in v0.8.0

func (node *ShowTableSize) Format(ctx *FmtCtx)

func (*ShowTableSize) GetQueryType added in v0.8.0

func (node *ShowTableSize) GetQueryType() string

func (*ShowTableSize) GetStatementType added in v0.8.0

func (node *ShowTableSize) GetStatementType() string

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)

func (*ShowTableStatus) GetQueryType added in v0.7.0

func (node *ShowTableStatus) GetQueryType() string

func (*ShowTableStatus) GetStatementType added in v0.7.0

func (node *ShowTableStatus) GetStatementType() string

type ShowTableValues added in v0.7.0

type ShowTableValues struct {
	Table  *UnresolvedObjectName
	DbName string
	// contains filtered or unexported fields
}

show table values

func NewShowTableValues added in v0.7.0

func NewShowTableValues(table *UnresolvedObjectName, dbname string) *ShowTableValues

func (*ShowTableValues) Format added in v0.7.0

func (node *ShowTableValues) Format(ctx *FmtCtx)

func (*ShowTableValues) GetQueryType added in v0.7.0

func (node *ShowTableValues) GetQueryType() string

func (*ShowTableValues) GetStatementType added in v0.7.0

func (node *ShowTableValues) GetStatementType() string

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)

func (*ShowTables) GetQueryType added in v0.7.0

func (node *ShowTables) GetQueryType() string

func (*ShowTables) GetStatementType added in v0.7.0

func (node *ShowTables) GetStatementType() string

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)

func (*ShowTarget) GetQueryType added in v0.7.0

func (node *ShowTarget) GetQueryType() string

func (*ShowTarget) GetStatementType added in v0.7.0

func (node *ShowTarget) GetStatementType() string

type ShowType added in v0.6.0

type ShowType int

func (ShowType) String added in v0.6.0

func (s ShowType) String() string

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)

func (*ShowVariables) GetQueryType added in v0.7.0

func (node *ShowVariables) GetQueryType() string

func (*ShowVariables) GetStatementType added in v0.7.0

func (node *ShowVariables) GetStatementType() string

type ShowWarnings

type ShowWarnings struct {
	// contains filtered or unexported fields
}

func NewShowWarnings

func NewShowWarnings() *ShowWarnings

func (*ShowWarnings) Format

func (node *ShowWarnings) Format(ctx *FmtCtx)

func (*ShowWarnings) GetQueryType added in v0.7.0

func (node *ShowWarnings) GetQueryType() string

func (*ShowWarnings) GetStatementType added in v0.7.0

func (node *ShowWarnings) GetStatementType() string

type StageComment added in v1.0.0

type StageComment struct {
	Exist   bool
	Comment string
}

func (*StageComment) Format added in v1.0.0

func (node *StageComment) Format(ctx *FmtCtx)

type StageCredentials added in v1.0.0

type StageCredentials struct {
	Exist       bool
	Credentials []string
}

func (*StageCredentials) Format added in v1.0.0

func (node *StageCredentials) Format(ctx *FmtCtx)

type StageStatus added in v1.0.0

type StageStatus struct {
	Exist  bool
	Option StageStatusOption
}

func (*StageStatus) Format added in v1.0.0

func (node *StageStatus) Format(ctx *FmtCtx)

type StageStatusOption added in v1.0.0

type StageStatusOption int
const (
	StageStatusEnabled StageStatusOption = iota
	StageStatusDisabled
)

func (StageStatusOption) String added in v1.0.0

func (sso StageStatusOption) String() string

type StageUrl added in v1.0.0

type StageUrl struct {
	Exist bool
	Url   string
}

func (*StageUrl) Format added in v1.0.0

func (node *StageUrl) Format(ctx *FmtCtx)

type StartWithOption added in v0.8.0

type StartWithOption struct {
	Minus bool
	Num   any
}

func (*StartWithOption) Format added in v0.8.0

func (node *StartWithOption) Format(ctx *FmtCtx)

type Statement

type Statement interface {
	fmt.Stringer
	NodeFormatter
	StatementType
}

type StatementOption added in v0.7.0

type StatementOption struct {
	Exist       bool
	StatementId string
}

func (StatementOption) Format added in v0.7.0

func (so StatementOption) Format(ctx *FmtCtx)

type StatementSource

type StatementSource struct {
	TableExpr
	Statement Statement
}

the statements as a data source includes the select statement.

func NewStatementSource

func NewStatementSource(s Statement) *StatementSource

type StatementType added in v0.7.0

type StatementType interface {
	// GetStatementType return like insert, update, delete, begin, rename database, rename table, ...
	GetStatementType() string
	// GetQueryType return val like DQL, DML, DDL, ...
	GetQueryType() string
}

type StrVal

type StrVal struct {
	Constant
	// contains filtered or unexported fields
}

StrVal represents a constant string value.

func NewStrVal

func NewStrVal(s string) *StrVal

func (*StrVal) Accept added in v0.8.0

func (node *StrVal) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker Accept interface.

func (*StrVal) Format

func (node *StrVal) Format(ctx *FmtCtx)

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

func (*Subquery) Accept added in v0.8.0

func (node *Subquery) Accept(v Visitor) (Expr, bool)

func (*Subquery) Format

func (node *Subquery) Format(ctx *FmtCtx)

type SubqueryExpr

type SubqueryExpr interface {
	Expr
}

subquery interface

type SubscriptionOption added in v0.8.0

type SubscriptionOption struct {
	From        Identifier
	Publication Identifier
	// contains filtered or unexported fields
}

func (*SubscriptionOption) Format added in v0.8.0

func (node *SubscriptionOption) Format(ctx *FmtCtx)

type T

type T struct {
	InternalType InternalType
}

sql type

type TableDef

type TableDef interface {
	NodeFormatter
}

type TableDefs

type TableDefs []TableDef

the list of table definitions

type TableExpr

type TableExpr interface {
	NodeFormatter
}

the table expression

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) GetQueryType added in v0.7.0

func (t *TableFunction) GetQueryType() string

func (*TableFunction) GetStatementType added in v0.7.0

func (t *TableFunction) GetStatementType() string

func (TableFunction) Id added in v0.6.0

func (t TableFunction) Id() string

type TableLock added in v0.7.0

type TableLock struct {
	Table    TableName
	LockType TableLockType
}

type TableLockType added in v0.7.0

type TableLockType int32

TableLockType is the type of the table lock.

const (
	// TableLockNone means this table lock is absent.
	TableLockNone TableLockType = iota
	// TableLockRead means the session with this lock can read the table (but not write it).
	// Multiple sessions can acquire a READ lock for the table at the same time.
	// Other sessions can read the table without explicitly acquiring a READ lock.
	TableLockRead
	// The locks are the same as READ except that they allow INSERT commands to be executed
	TableLockReadLocal
	// TableLockWrite means only the session with this lock has write/read permission.
	// Only the session that holds the lock can access the table. No other session can access it until the lock is released.
	TableLockWrite
	// Low priority write locks
	TableLockLowPriorityWrite
)

func (TableLockType) String added in v0.7.0

func (t TableLockType) String() 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) Format

func (tn TableName) Format(ctx *FmtCtx)

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 {
	AlterTableOption
}

type TableOptionAUTOEXTEND_SIZE added in v1.0.0

type TableOptionAUTOEXTEND_SIZE struct {
	Value uint64
	// contains filtered or unexported fields
}

func NewTableOptionAUTOEXTEND_SIZE added in v1.0.0

func NewTableOptionAUTOEXTEND_SIZE(v uint64) *TableOptionAUTOEXTEND_SIZE

func (*TableOptionAUTOEXTEND_SIZE) Format added in v1.0.0

func (node *TableOptionAUTOEXTEND_SIZE) Format(ctx *FmtCtx)

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 TableOptionEngineAttr added in v1.0.0

type TableOptionEngineAttr struct {
	Engine string
	// contains filtered or unexported fields
}

func NewTableOptionEngineAttr added in v1.0.0

func NewTableOptionEngineAttr(s string) *TableOptionEngineAttr

func (*TableOptionEngineAttr) Format added in v1.0.0

func (node *TableOptionEngineAttr) 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 TableOptionInsertMethod added in v1.0.0

type TableOptionInsertMethod struct {
	Method string
	// contains filtered or unexported fields
}

func NewTableOptionInsertMethod added in v1.0.0

func NewTableOptionInsertMethod(s string) *TableOptionInsertMethod

func (*TableOptionInsertMethod) Format added in v1.0.0

func (node *TableOptionInsertMethod) 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 TableOptionSecondaryEngineAttr added in v1.0.0

type TableOptionSecondaryEngineAttr struct {
	Attr string
	// contains filtered or unexported fields
}

func NewTTableOptionSecondaryEngineAttr added in v1.0.0

func NewTTableOptionSecondaryEngineAttr(v string) *TableOptionSecondaryEngineAttr

func (*TableOptionSecondaryEngineAttr) Format added in v1.0.0

func (node *TableOptionSecondaryEngineAttr) Format(ctx *FmtCtx)

type TableOptionSecondaryEngineNull

type TableOptionSecondaryEngineNull struct {
	// contains filtered or unexported fields
}

func NewTableOptionSecondaryEngineNull

func NewTableOptionSecondaryEngineNull() *TableOptionSecondaryEngineNull

type TableOptionStartTrans added in v1.0.0

type TableOptionStartTrans struct {
	Value bool
	// contains filtered or unexported fields
}

func NewTTableOptionStartTrans added in v1.0.0

func NewTTableOptionStartTrans(v bool) *TableOptionStartTrans

func (*TableOptionStartTrans) Format added in v1.0.0

func (node *TableOptionStartTrans) Format(ctx *FmtCtx)

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 TransactionCharacteristic added in v0.8.0

type TransactionCharacteristic struct {
	IsLevel   bool
	Isolation IsolationLevelType
	Access    AccessModeType
}

func (*TransactionCharacteristic) Format added in v0.8.0

func (tc *TransactionCharacteristic) 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)

func (*TruncateTable) GetQueryType added in v0.7.0

func (node *TruncateTable) GetQueryType() string

func (*TruncateTable) GetStatementType added in v0.7.0

func (node *TruncateTable) GetStatementType() string

type Tuple

type Tuple struct {
	Exprs Exprs
	// contains filtered or unexported fields
}

the parenthesized list of expressions.

func NewTuple

func NewTuple(e Exprs) *Tuple

func (*Tuple) Accept added in v0.8.0

func (node *Tuple) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*Tuple) Format

func (node *Tuple) Format(ctx *FmtCtx)

func (*Tuple) String

func (node *Tuple) String() string

type TypeExpr

type TypeExpr interface {
	Expr
}

type TypeOption added in v1.0.0

type TypeOption struct {
	Type ResolvableTypeReference
}

func (*TypeOption) Format added in v1.0.0

func (node *TypeOption) Format(ctx *FmtCtx)

type UnLockTableStmt added in v0.7.0

type UnLockTableStmt struct {
	// contains filtered or unexported fields
}

func (*UnLockTableStmt) Format added in v0.7.0

func (node *UnLockTableStmt) Format(ctx *FmtCtx)

func (*UnLockTableStmt) GetQueryType added in v0.7.0

func (node *UnLockTableStmt) GetQueryType() string

func (*UnLockTableStmt) GetStatementType added in v0.7.0

func (node *UnLockTableStmt) GetStatementType() string

type UnaryExpr

type UnaryExpr struct {

	//operator
	Op UnaryOp

	//expression
	Expr Expr
	// contains filtered or unexported fields
}

unary expression

func NewUnaryExpr

func NewUnaryExpr(op UnaryOp, expr Expr) *UnaryExpr

func (*UnaryExpr) Accept added in v0.8.0

func (e *UnaryExpr) Accept(v Visitor) (Expr, bool)

func (*UnaryExpr) Format

func (e *UnaryExpr) Format(ctx *FmtCtx)

func (*UnaryExpr) String

func (e *UnaryExpr) String() string

type UnaryOp

type UnaryOp int

unary expression

const (
	//-
	UNARY_MINUS UnaryOp = iota
	//+
	UNARY_PLUS
	//~
	UNARY_TILDE
	//!
	UNARY_MARK
)

func (UnaryOp) ToString

func (op UnaryOp) ToString() string

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 UnionType

type UnionType int

UnionType set operations

const (
	UNION UnionType = iota
	INTERSECT
	EXCEPT
	UT_MINUS
)

func (UnionType) String

func (i UnionType) String() string

type UnionTypeRecord

type UnionTypeRecord struct {
	Type     UnionType
	All      bool
	Distinct bool
}

type UniqueIndex

type UniqueIndex struct {
	KeyParts         []*KeyPart
	Name             string
	ConstraintSymbol 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)

func (*UniqueIndex) GetIndexName added in v0.8.0

func (node *UniqueIndex) GetIndexName() string

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(ctx context.Context, parts ...string) (*UnresolvedName, error)

func NewUnresolvedNameWithStar

func NewUnresolvedNameWithStar(ctx context.Context, parts ...string) (*UnresolvedName, error)

func SetUnresolvedName

func SetUnresolvedName(parts ...string) *UnresolvedName

func SetUnresolvedNameWithStar

func SetUnresolvedNameWithStar(parts ...string) *UnresolvedName

func (*UnresolvedName) Accept added in v0.8.0

func (node *UnresolvedName) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker Accept interface.

func (*UnresolvedName) Format

func (node *UnresolvedName) Format(ctx *FmtCtx)

func (*UnresolvedName) GetNames added in v0.6.0

func (node *UnresolvedName) GetNames() (string, string, string)

GetNames dbName, tableName, colName

func (*UnresolvedName) String

func (node *UnresolvedName) String() string

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(ctx context.Context, 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

func (*Update) Format

func (node *Update) Format(ctx *FmtCtx)

func (*Update) GetQueryType added in v0.7.0

func (node *Update) GetQueryType() string

func (*Update) GetStatementType added in v0.7.0

func (node *Update) GetStatementType() string

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 UpdateVal added in v0.6.0

type UpdateVal struct {
	// contains filtered or unexported fields
}

func (*UpdateVal) Accept added in v0.8.0

func (node *UpdateVal) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker interface

func (*UpdateVal) Format added in v0.6.0

func (node *UpdateVal) Format(ctx *FmtCtx)

func (*UpdateVal) String added in v0.6.0

func (node *UpdateVal) String() string

type Use

type Use struct {
	Name              *CStr
	SecondaryRole     bool
	SecondaryRoleType SecondaryRoleType
	Role              *Role
	// contains filtered or unexported fields
}

Use statement

func (*Use) Format

func (node *Use) Format(ctx *FmtCtx)

func (*Use) GetQueryType added in v0.7.0

func (node *Use) GetQueryType() string

func (*Use) GetStatementType added in v0.7.0

func (node *Use) GetStatementType() string

func (*Use) IsUseRole added in v0.6.0

func (node *Use) IsUseRole() bool

IsUseRole checks the statement is:

USE SECONDARY ROLE { ALL | NONE };
USE ROLE role;

type User

type User struct {
	NodeFormatter
	Username   string
	Hostname   string
	AuthOption *AccountIdentified
}

func NewUser

func NewUser(u, h string) *User

func (*User) Format

func (node *User) Format(ctx *FmtCtx)

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

type UserMiscOptionPasswordRequireCurrentDefault

type UserMiscOptionPasswordRequireCurrentDefault struct {
	// contains filtered or unexported fields
}

func (*UserMiscOptionPasswordRequireCurrentDefault) Format added in v0.6.0

type UserMiscOptionPasswordRequireCurrentNone added in v0.6.0

type UserMiscOptionPasswordRequireCurrentNone struct {
	// contains filtered or unexported fields
}

func (*UserMiscOptionPasswordRequireCurrentNone) Format added in v0.6.0

type UserMiscOptionPasswordRequireCurrentOptional

type UserMiscOptionPasswordRequireCurrentOptional struct {
	// contains filtered or unexported fields
}

func (*UserMiscOptionPasswordRequireCurrentOptional) Format added in v0.6.0

type UserMiscOptionPasswordReuseIntervalCount

type UserMiscOptionPasswordReuseIntervalCount struct {
	Value int64
	// contains filtered or unexported fields
}

func (*UserMiscOptionPasswordReuseIntervalCount) Format added in v0.6.0

type UserMiscOptionPasswordReuseIntervalDefault

type UserMiscOptionPasswordReuseIntervalDefault struct {
	// contains filtered or unexported fields
}

func (*UserMiscOptionPasswordReuseIntervalDefault) Format added in v0.6.0

type UsernameRecord

type UsernameRecord struct {
	Username string
	Hostname string
}

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
	RowWord bool
	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

func NewValuesIn(vl Exprs) *ValuesIn

func (*ValuesIn) Format added in v0.6.0

func (node *ValuesIn) Format(ctx *FmtCtx)

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)

func (*ValuesStatement) GetQueryType added in v0.7.0

func (node *ValuesStatement) GetQueryType() string

func (*ValuesStatement) GetStatementType added in v0.7.0

func (node *ValuesStatement) GetStatementType() string

type VarAssignmentExpr

type VarAssignmentExpr struct {
	NodeFormatter
	System   bool
	Global   bool
	Name     string
	Value    Expr
	Reserved Expr
}

for variable = expr

func NewVarAssignmentExpr

func NewVarAssignmentExpr(s bool, g bool, n string, v Expr, r Expr) *VarAssignmentExpr

func (*VarAssignmentExpr) Format

func (node *VarAssignmentExpr) Format(ctx *FmtCtx)

type VarExpr

type VarExpr struct {
	Name   string
	System bool
	Global bool
	Expr   Expr
	// contains filtered or unexported fields
}

func NewVarExpr

func NewVarExpr(n string, s bool, g bool, e Expr) *VarExpr

func (*VarExpr) Accept added in v0.8.0

func (node *VarExpr) Accept(v Visitor) (Expr, bool)

Accept implements NodeChecker Accept interface.

func (*VarExpr) Format

func (node *VarExpr) Format(ctx *FmtCtx)

incomplete

func (*VarExpr) String

func (node *VarExpr) String() string

type VarName

type VarName interface {
	Expr
}

variable in the scalar expression

func StarExpr

func StarExpr() VarName

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

type Visitor

type Visitor interface {
	// Call the 'Enter' method before visiting the children nodes.
	// The node type returned by the `Enter` method must be the same as the input node type
	// SkipChildren returning true means that access to child nodes should be skipped.
	Enter(n Expr) (node Expr, skipChildren bool)

	//`Exit` is called after all children nodes are visited.
	//The returned node of the `Exit` method is `Expr`, which is of the same type as the input node.
	//if `Exit` method returns OK as false ,means stop visiting.
	Exit(n Expr) (node Expr, ok bool)
}

Visitor Design Pattern Visitor visits the ast node or sub ast nodes

type When

type When struct {
	Cond Expr
	Val  Expr
}

When sub-expression.

func NewWhen

func NewWhen(c, v Expr) *When

func (*When) Format

func (node *When) Format(ctx *FmtCtx)

type WhenStmt added in v0.8.0

type WhenStmt struct {
	Cond Expr
	Body []Statement
	// contains filtered or unexported fields
}

func (*WhenStmt) Format added in v0.8.0

func (node *WhenStmt) Format(ctx *FmtCtx)

func (*WhenStmt) GetQueryType added in v0.8.0

func (node *WhenStmt) GetQueryType() string

func (*WhenStmt) GetStatementType added in v0.8.0

func (node *WhenStmt) GetStatementType() string

type Where

type Where struct {
	Type string
	Expr Expr
}

WHERE or HAVING clause.

func NewWhere

func NewWhere(e Expr) *Where

func (*Where) Format

func (node *Where) Format(ctx *FmtCtx)

type WhileStmt added in v0.8.0

type WhileStmt struct {
	Name Identifier
	Cond Expr
	Body []Statement
	// contains filtered or unexported fields
}

func (*WhileStmt) Format added in v0.8.0

func (node *WhileStmt) Format(ctx *FmtCtx)

func (*WhileStmt) GetQueryType added in v0.8.0

func (node *WhileStmt) GetQueryType() string

func (*WhileStmt) GetStatementType added in v0.8.0

func (node *WhileStmt) GetStatementType() string

type WindowSpec added in v0.7.0

type WindowSpec struct {
	PartitionBy Exprs
	OrderBy     OrderBy
	HasFrame    bool
	Frame       *FrameClause
}

func (*WindowSpec) Format added in v0.8.0

func (node *WindowSpec) Format(ctx *FmtCtx)

type With

type With struct {
	IsRecursive bool
	CTEs        []*CTE
	// contains filtered or unexported fields
}

func (*With) Format

func (node *With) Format(ctx *FmtCtx)

func (*With) GetQueryType added in v0.7.0

func (node *With) GetQueryType() string

func (*With) GetStatementType added in v0.7.0

func (node *With) GetStatementType() string

type XorExpr

type XorExpr struct {
	Left, Right Expr
	// contains filtered or unexported fields
}

xor expression

func NewXorExpr

func NewXorExpr(l, r Expr) *XorExpr

func (*XorExpr) Accept added in v0.8.0

func (node *XorExpr) Accept(v Visitor) (Expr, bool)

func (*XorExpr) Format

func (node *XorExpr) Format(ctx *FmtCtx)

func (*XorExpr) String

func (node *XorExpr) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL