tree

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 8 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 (
	DefaultDisplayWidth   = -1
	NotDefineDisplayWidth = 0
	NotDefineDec          = -1
)

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,
		Precision:          0,
		TimePrecisionIsSet: false,
		Locale:             &emptyLocale,
		Oid:                uint32(defines.MYSQL_TYPE_TIMESTAMP),
	}}

	TYPE_LONGLONG = &T{InternalType: InternalType{
		Family: IntFamily,
		Width:  64,
		Locale: &emptyLocale,
		Oid:    uint32(defines.MYSQL_TYPE_LONGLONG),
	}}

	TYPE_INT24 = &T{InternalType: InternalType{
		Family: IntFamily,
		Width:  24,
		Locale: &emptyLocale,
		Oid:    uint32(defines.MYSQL_TYPE_INT24),
	}}

	TYPE_DATE = &T{InternalType: InternalType{
		Family: DateFamily,
		Locale: &emptyLocale,
		Oid:    uint32(defines.MYSQL_TYPE_DATE),
	}}

	TYPE_DURATION = &T{InternalType: InternalType{
		Family:                IntervalFamily,
		Precision:             0,
		TimePrecisionIsSet:    false,
		Locale:                &emptyLocale,
		Oid:                   uint32(defines.MYSQL_TYPE_TIME),
		IntervalDurationField: &IntervalDurationField{},
	}}

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

	TYPE_DATETIME = &T{InternalType: InternalType{
		Family:             TimestampFamily,
		Precision:          0,
		TimePrecisionIsSet: false,
		Locale:             &emptyLocale,
		Oid:                uint32(defines.MYSQL_TYPE_DATETIME),
	}}

	TYPE_YEAR = &T{InternalType: InternalType{
		Family: IntFamily,
		Width:  16,
		Locale: &emptyLocale,
		Oid:    uint32(defines.MYSQL_TYPE_YEAR),
	}}

	TYPE_NEWDATE = &T{InternalType: InternalType{
		Family: DateFamily,
		Locale: &emptyLocale,
		Oid:    uint32(defines.MYSQL_TYPE_NEWDATE),
	}}

	TYPE_VARCHAR = &T{InternalType: InternalType{
		Family: StringFamily,
		Locale: &emptyLocale,
		Oid:    uint32(defines.MYSQL_TYPE_VARCHAR),
	}}

	TYPE_BIT = &T{InternalType: InternalType{
		Family: BitFamily,
		Locale: &emptyLocale,
		Oid:    uint32(defines.MYSQL_TYPE_BIT),
	}}

	TYPE_BOOL = &T{InternalType: InternalType{
		Family: BoolFamily,
		Locale: &emptyLocale,
		Oid:    uint32(defines.MYSQL_TYPE_BOOL),
	}}

	TYPE_JSON = &T{InternalType: InternalType{
		Family: JsonFamily,
		Locale: &emptyLocale,
		Oid:    uint32(defines.MYSQL_TYPE_JSON)}}

	TYPE_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_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 GetDisplayWith

func GetDisplayWith(val int32) int32

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

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 AlterUser

type AlterUser struct {
	IfExists   bool
	IsUserFunc bool
	UserFunc   *User
	Users      []*User
	Roles      []*Role
	TlsOpts    []TlsOption
	ResOpts    []ResourceOption
	MiscOpts   []UserMiscOption
	// contains filtered or unexported fields
}

func NewAlterUser

func NewAlterUser(ife bool, iuf bool, uf *User, u []*User, r []*Role, t []TlsOption, res []ResourceOption, m []UserMiscOption) *AlterUser

func (*AlterUser) Format

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

type AnalyzeStmt

type AnalyzeStmt struct {
	Table *TableName
	Cols  IdentifierList
	// contains filtered or unexported fields
}

Use statement

func NewAnalyzeStmt

func NewAnalyzeStmt(tbl *TableName, cols IdentifierList) *AnalyzeStmt

func (*AnalyzeStmt) Format

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

type AndExpr

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

and expression

func NewAndExpr

func NewAndExpr(l, r Expr) *AndExpr

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 AttributeKey

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

func NewAttributeKey

func NewAttributeKey() *AttributeKey

func (*AttributeKey) Format

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

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 AuthRecord

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

type BeginTransaction

type BeginTransaction struct {
	Modes TransactionModes
	// contains filtered or unexported fields
}

Begin statement

func NewBeginTransaction

func NewBeginTransaction(m TransactionModes) *BeginTransaction

func (*BeginTransaction) Format

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

type BinaryExpr

type BinaryExpr struct {

	//operator
	Op BinaryOp

	//left expression
	Left Expr

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

binary expression

func NewBinaryExpr

func NewBinaryExpr(op BinaryOp, left Expr, right Expr) *BinaryExpr

func (*BinaryExpr) Format

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

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 CTE

type CTE struct {
	Name *AliasClause
	Stmt Statement
}

func (*CTE) Format

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

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

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

func (*CaseExpr) String

func (node *CaseExpr) String() 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) 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 ColumnAttribute

type ColumnAttribute interface {
	NodeFormatter
}

column attribute

type ColumnItem

type ColumnItem struct {
	IdentifierName

	//the name of the column
	ColumnName Identifier
}

type ColumnTableDef

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

func (*ColumnTableDef) Format

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

type CommitTransaction

type CommitTransaction struct {
	Type CompletionType
	// contains filtered or unexported fields
}

Commit statement

func NewCommitTransaction

func NewCommitTransaction(t CompletionType) *CommitTransaction

func (*CommitTransaction) Format

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

type ComparisonExpr

type ComparisonExpr struct {
	Op ComparisonOp

	//ANY SOME ALL with subquery
	SubOp  ComparisonOp
	Left   Expr
	Right  Expr
	Escape Expr
	// contains filtered or unexported fields
}

func NewComparisonExpr

func NewComparisonExpr(op ComparisonOp, l, r Expr) *ComparisonExpr

func NewComparisonExprWithEscape

func NewComparisonExprWithEscape(op ComparisonOp, l, r, e Expr) *ComparisonExpr

func NewComparisonExprWithSubop

func NewComparisonExprWithSubop(op, subop ComparisonOp, l, r Expr) *ComparisonExpr

func (*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
	REG_MATCH                            // REG_MATCH
	NOT_REG_MATCH                        // NOT REG_MATCH
	IS_DISTINCT_FROM
	IS_NOT_DISTINCT_FROM

	//reference: https://dev.mysql.com/doc/refman/8.0/en/all-subqueries.html
	//subquery with ANY,SOME,ALL
	//operand comparison_operator [ANY | SOME | ALL] (subquery)
	ANY
	SOME
	ALL
)

func (ComparisonOp) ToString

func (op ComparisonOp) ToString() string

type CompletionType

type CompletionType int
const (
	COMPLETION_TYPE_NO_CHAIN CompletionType = iota
	COMPLETION_TYPE_CHAIN
	COMPLETION_TYPE_RELEASE
)

type Constant

type Constant interface {
	Expr
}

the AST for literals like string,numeric,bool and etc.

type CreateDatabase

type CreateDatabase struct {
	IfNotExists   bool
	Name          Identifier
	CreateOptions []CreateOption
	// contains filtered or unexported fields
}

func NewCreateDatabase

func NewCreateDatabase(ine bool, name Identifier, opts []CreateOption) *CreateDatabase

func (*CreateDatabase) Format

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

type CreateIndex

type CreateIndex struct {
	Name        Identifier
	Table       TableName
	IndexCat    IndexCategory
	IfNotExists bool
	KeyParts    []*KeyPart
	IndexOption *IndexOption
	MiscOption  []MiscOption
	// contains filtered or unexported fields
}

func NewCreateIndex

func NewCreateIndex(n Identifier, t TableName, ife bool, it IndexCategory, k []*KeyPart, i *IndexOption, m []MiscOption) *CreateIndex

func (*CreateIndex) Format

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

type CreateOption

type CreateOption interface {
	NodeFormatter
}

type CreateOptionCharset

type CreateOptionCharset struct {
	IsDefault bool
	Charset   string
	// contains filtered or unexported fields
}

func NewCreateOptionCharset

func NewCreateOptionCharset(c string) *CreateOptionCharset

func (*CreateOptionCharset) Format

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

type CreateOptionCollate

type CreateOptionCollate struct {
	IsDefault bool
	Collate   string
	// contains filtered or unexported fields
}

func NewCreateOptionCollate

func NewCreateOptionCollate(c string) *CreateOptionCollate

func (*CreateOptionCollate) Format

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

type CreateOptionDefault

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

type CreateOptionEncryption

type CreateOptionEncryption struct {
	Encrypt string
	// contains filtered or unexported fields
}

func NewCreateOptionEncryption

func NewCreateOptionEncryption(e string) *CreateOptionEncryption

func (*CreateOptionEncryption) Format

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

type CreateRole

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)

type CreateTable

type CreateTable struct {
	Temporary       bool
	IfNotExists     bool
	Table           TableName
	Defs            TableDefs
	Options         []TableOption
	PartitionOption *PartitionOption
	// contains filtered or unexported fields
}

func (*CreateTable) Format

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

type CreateUser

type CreateUser struct {
	IfNotExists bool
	Users       []*User
	Roles       []*Role
	TlsOpts     []TlsOption
	ResOpts     []ResourceOption
	MiscOpts    []UserMiscOption
	// contains filtered or unexported fields
}

func NewCreateUser

func NewCreateUser(ife bool, u []*User, r []*Role, tls []TlsOption, res []ResourceOption, misc []UserMiscOption) *CreateUser

func (*CreateUser) Format

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

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

the DEFAULT expression.

func NewDefaultVal

func NewDefaultVal(e Expr) *DefaultVal

func (*DefaultVal) Format

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

func (*DefaultVal) String

func (node *DefaultVal) String() string

type Delete

type Delete struct {
	Table   TableExpr
	Where   *Where
	OrderBy OrderBy
	Limit   *Limit
	// contains filtered or unexported fields
}

Delete statement

func NewDelete

func NewDelete(t TableExpr, w *Where, o OrderBy, l *Limit) *Delete

func (*Delete) Format

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

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 DropDatabase

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

DROP Database statement

func NewDropDatabase

func NewDropDatabase(n Identifier, i bool) *DropDatabase

func (*DropDatabase) Format

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

type DropIndex

type DropIndex struct {
	Name       Identifier
	TableName  TableName
	IfExists   bool
	MiscOption []MiscOption
	// contains filtered or unexported fields
}

func NewDropIndex

func NewDropIndex(i Identifier, t TableName, ife bool, m []MiscOption) *DropIndex

func (*DropIndex) Format

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

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)

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)

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)

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

type ExplainFor

type ExplainFor struct {
	ID uint64
	// contains filtered or unexported fields
}

EXPLAIN FOR CONNECTION statement

func NewExplainFor

func NewExplainFor(f string, id uint64) *ExplainFor

func (*ExplainFor) Format

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

type ExplainStmt

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

EXPLAIN stmt statement

func NewExplainStmt

func NewExplainStmt(stmt Statement, f string) *ExplainStmt

func (*ExplainStmt) Format

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

type ExportParam

type ExportParam struct {
	// file handler
	File *os.File
	// bufio.writer
	Writer *bufio.Writer
	// outfile flag
	Outfile bool
	// filename path
	FilePath string
	// Fields
	Fields *Fields
	// Lines
	Lines *Lines
	// fileSize
	MaxFileSize uint64
	// curFileSize
	CurFileSize uint64
	Rows        uint64
	FileCnt     uint
	// header flag
	Header     bool
	ForceQuote []string
	ColumnFlag []bool
	Symbol     []string

	// default flush size
	DefaultBufSize int64
	OutputStr      []byte
	LineSize       uint64
}

func (*ExportParam) Format

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

type Expr

type Expr interface {
	fmt.Stringer
	NodeFormatter
}

AST for the expression

type ExprList

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

ast fir the list of expression

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 Family

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

	//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) *FmtCtx

func (*FmtCtx) PrintExpr

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

type ForeignKey

type ForeignKey struct {
	IfNotExists bool
	KeyParts    []*KeyPart
	Name        string
	Refer       *AttributeReference
	Empty       bool
	// contains filtered or unexported fields
}

func NewForeignKey

func NewForeignKey(ine bool, k []*KeyPart, n string, r *AttributeReference, e bool) *ForeignKey

func (*ForeignKey) Format

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

type From

type From struct {
	Tables TableExprs
}

the FROM clause.

func NewFrom

func NewFrom(t TableExprs) *From

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

	//aggregations which specify an order.
	OrderBy OrderBy
	// contains filtered or unexported fields
}

function call expression

func NewFuncExpr

func NewFuncExpr(ft FuncType, name *UnresolvedName, e Exprs, order OrderBy) *FuncExpr

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 (*FuncType) ToString

func (node *FuncType) ToString() string

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 {
	Privileges []*Privilege

	IsGrantRole      bool
	RolesInGrantRole []*Role

	IsProxy   bool
	ProxyUser *User

	ObjType     ObjectType
	Level       *PrivilegeLevel
	Users       []*User
	Roles       []*Role
	GrantOption bool
	// contains filtered or unexported fields
}

func NewGrant

func NewGrant(igr bool, ip bool, rigr []*Role, p []*Privilege, t ObjectType, l *PrivilegeLevel, pu *User, u []*User, r []*Role, gopt bool) *Grant

func (*Grant) Format

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

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 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 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
	PartitionNames IdentifierList
	Columns        IdentifierList
	Rows           *Select
	// 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)

type InternalType

type InternalType struct {
	//the group of types that are compatible with each other
	Family       Family
	FamilyString string
	/*
		From: https://dev.mysql.com/doc/refman/8.0/en/numeric-type-syntax.html

		For integer data types, M indicates the maximum display width.
		The maximum display width is 255. Display width is unrelated to the range of values a type can store.
		For floating-point and fixed-point data types, M is the total number of digits that can be stored.

		M is the total number of digits (the precision) and D is the number of digits after the decimal point (the scale).
	*/
	//the size or scale of the data type, such as number of bits or characters.
	Width int32

	/*
		From: https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html
		display width
	*/
	DisplayWith int32

	//the accuracy of the data type.
	Precision int32

	//Unsigned or not
	Unsigned bool

	//binary or not
	Binary bool

	Zerofill bool

	Locale *string

	//The slice containing the type of each tuple field.
	TupleContents []*T

	//the slice containing the labels of each tuple field.
	TupleLabels []string

	//type id
	Oid uint32

	EnumValues []string

	//the type of array elements.
	ArrayContents *T

	//indicates whether the precision was explicitly set.
	//From https://dev.mysql.com/doc/refman/8.0/en/date-and-time-type-syntax.html
	//In mysql 8.0. Precision must be in the range 0 to 6.
	//A value of 0 signifies that there is no fractional part.
	//If omitted, the default precision is 0. (This differs from the standard SQL default of 6, for compatibility with previous MySQL versions.)
	// if Precision > 0, the precision
	// if TimePrecisionIsSet = true and precision = 0, then the precision = 0
	// if TimePrecisionIsSet = false and precision = 0, then the precision has not been indicated,
	//	so the default value is 0.
	TimePrecisionIsSet bool

	//interval type
	IntervalDurationField *IntervalDurationField

	//geospatial types.
	GeoMetadata *GeoMetadata

	//user defined types that are not arrays.
	UDTMetadata *PersistentUserDefinedTypeMetadata
}

for sql type

func (*InternalType) Format

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

type IntervalDurationField

type IntervalDurationField struct {
}

type IntervalExpr

type IntervalExpr struct {
	Expr Expr
	Type IntervalType
	// contains filtered or unexported fields
}

INTERVAL / time unit

func NewIntervalExpr

func NewIntervalExpr(t IntervalType) *IntervalExpr

func (*IntervalExpr) Format

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

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 IsNotNullExpr

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

is not null expression

func NewIsNotNullExpr

func NewIsNotNullExpr(e Expr) *IsNotNullExpr

func (*IsNotNullExpr) Format

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

func (*IsNotNullExpr) String

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

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

func (*IsNullExpr) String

func (node *IsNullExpr) String() 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 LengthScaleOpt

type LengthScaleOpt struct {
	DisplayWith int32
	Precision   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
	File              string
	DuplicateHandling DuplicateKey
	Table             *TableName
	//Partition
	//Fields
	Fields *Fields
	//Lines
	Lines *Lines
	//Ignored lines
	IgnoredLines uint64
	//col_name_or_user_var
	ColumnList []LoadColumn
	//set col_name
	Assignments UpdateExprs
	// contains filtered or unexported fields
}

Load data statement

func NewLoad

func NewLoad(l bool, f string, d DuplicateKey, t *TableName,
	fie *Fields, li *Lines, il uint64, cl []LoadColumn,
	a UpdateExprs) *Load

func (*Load) Format

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

type LoadColumn

type LoadColumn interface {
	NodeFormatter
}

column element in load data column list

type LockDefault

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

type LockExclusive

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

type LockNone

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

type LockShared

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

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

func (node *MaxValue) String() string

type MiscOption

type MiscOption interface {
	NodeFormatter
}

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

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

func (*NotExpr) String

func (node *NotExpr) String() string

type NumVal

type NumVal struct {
	Constant
	Value constant.Value
	// 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 (*NumVal) Format

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

func (*NumVal) Negative

func (n *NumVal) Negative() bool

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_FUNCTION
	OBJECT_TYPE_PROCEDURE
)

func (*ObjectType) ToString

func (node *ObjectType) ToString() 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 OrExpr

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

or expression

func NewOrExpr

func NewOrExpr(l, r Expr) *OrExpr

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
	//without order
	NullOrder bool
}

the ordering expression.

func NewOrder

func NewOrder(e Expr, d Direction, 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 ParenExpr

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

the parenthesized expression.

func NewParenExpr

func NewParenExpr(e Expr) *ParenExpr

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 Precendence

type Precendence int
const (
	Syntactic Precendence = iota
	P1
	P2
	P3
	P4
	P5
	P6
	P7
	P8
	P9
	P10
	P11
	P12
	P13
	P14
	P15
	P16
	P17
)

type PrimaryKeyIndex

type PrimaryKeyIndex struct {
	KeyParts    []*KeyPart
	Name        string
	Empty       bool
	IndexOption *IndexOption
	// contains filtered or unexported fields
}

func NewPrimaryKeyIndex

func NewPrimaryKeyIndex(k []*KeyPart, n string, e bool, io *IndexOption) *PrimaryKeyIndex

func (*PrimaryKeyIndex) Format

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

type Privilege

type Privilege struct {
	NodeFormatter
	Type       PrivilegeType
	ColumnList []*UnresolvedName
}

func NewPrivilege

func NewPrivilege(t PrivilegeType, c []*UnresolvedName) *Privilege

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)

type PrivilegeLevelType

type PrivilegeLevelType int
const (
	PRIVILEGE_LEVEL_TYPE_GLOBAL         PrivilegeLevelType = iota //*.*
	PRIVILEGE_LEVEL_TYPE_DATABASE                                 //db_name.*
	PRIVILEGE_LEVEL_TYPE_TABLE                                    //db_name.tbl_name
	PRIVILEGE_LEVEL_TYPE_COLUMN                                   // (x,x)
	PRIVILEGE_LEVEL_TYPE_STORED_ROUTINE                           //procedure
	PRIVILEGE_LEVEL_TYPE_PROXY
)

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_ALTER                                        //Enable use of ALTER TABLE. Levels: Global, database, table.
	PRIVILEGE_TYPE_STATIC_ALTER_ROUTINE                                //Enable stored routines to be altered or dropped. Levels: Global, database, routine.
	PRIVILEGE_TYPE_STATIC_CREATE                                       //Enable database and table creation. Levels: Global, database, table.
	PRIVILEGE_TYPE_STATIC_CREATE_ROLE                                  //Enable role creation. Level: Global.
	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_USER                                  //Enable use of CREATE USER, DROP USER, RENAME USER, and REVOKE ALL PRIVILEGES. Level: Global.
	PRIVILEGE_TYPE_STATIC_CREATE_VIEW                                  //Enable views to be created or altered. Levels: Global, database, table.
	PRIVILEGE_TYPE_STATIC_DELETE                                       //Enable use of DELETE. Level: Global, database, table.
	PRIVILEGE_TYPE_STATIC_DROP                                         //Enable databases, tables, and views to be dropped. Levels: Global, database, table.
	PRIVILEGE_TYPE_STATIC_DROP_ROLE                                    //Enable roles to be dropped. Level: Global.
	PRIVILEGE_TYPE_STATIC_EVENT                                        //Enable use of events for the Event Scheduler. Levels: Global, database.
	PRIVILEGE_TYPE_STATIC_EXECUTE                                      //Enable the user to execute stored routines. Levels: Global, database, routine.
	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_INDEX                                        //Enable indexes to be created or dropped. Levels: Global, database, table.
	PRIVILEGE_TYPE_STATIC_INSERT                                       //Enable use of INSERT. Levels: Global, database, table, column.
	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_REFERENCES                                   //Enable foreign key creation. Levels: Global, database, table, column.
	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_SELECT                                       //Enable use of SELECT. Levels: Global, database, table, column.
	PRIVILEGE_TYPE_STATIC_SHOW_DATABASES                               //Enable SHOW DATABASES to show all databases. 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_UPDATE                                       //Enable use of UPDATE. Levels: Global, database, table, column.
	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 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) 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 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 Revoke

type Revoke struct {
	IsRevokeRole      bool
	RolesInRevokeRole []*Role

	Privileges []*Privilege
	ObjType    ObjectType
	Level      *PrivilegeLevel
	Users      []*User
	Roles      []*Role
	// contains filtered or unexported fields
}

func NewRevoke

func NewRevoke(irr bool, rirr []*Role, p []*Privilege, o ObjectType, l *PrivilegeLevel, u []*User, r []*Role) *Revoke

func (*Revoke) Format

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

type Role

type Role struct {
	NodeFormatter
	UserName string
	HostName string
}

func NewRole

func NewRole(u, h 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)

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 Select

type Select struct {
	Select  SelectStatement
	OrderBy OrderBy
	Limit   *Limit
	With    *With
	Ep      *ExportParam
	// contains filtered or unexported fields
}

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

func NewSelect

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

func (*Select) Format

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

type SelectClause

type SelectClause struct {
	SelectStatement
	Distinct bool
	Exprs    SelectExprs
	From     *From
	Where    *Where
	GroupBy  GroupBy
	Having   *Where
}

SelectClause represents a SELECT statement.

func (*SelectClause) Format

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

type SelectExpr

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

a SELECT expression.

func (*SelectExpr) Format

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

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 SelectStatement

type SelectStatement interface {
	Statement
}

type SetDefaultRole

type SetDefaultRole struct {
	Type  SetDefaultRoleType
	Roles []*Role
	Users []*User
	// contains filtered or unexported fields
}

func NewSetDefaultRole

func NewSetDefaultRole(t SetDefaultRoleType, r []*Role, u []*User) *SetDefaultRole

func (*SetDefaultRole) Format

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

type SetDefaultRoleType

type SetDefaultRoleType int
const (
	SET_DEFAULT_ROLE_TYPE_NONE SetDefaultRoleType = iota
	SET_DEFAULT_ROLE_TYPE_ALL
	SET_DEFAULT_ROLE_TYPE_NORMAL
)

type SetPassword

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)

type SetRole

type SetRole struct {
	Type  SetRoleType
	Roles []*Role
	// contains filtered or unexported fields
}

func NewSetRole

func NewSetRole(t SetRoleType, r []*Role) *SetRole

func (*SetRole) Format

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

type SetRoleType

type SetRoleType int
const (
	SET_ROLE_TYPE_NORMAL SetRoleType = iota
	SET_ROLE_TYPE_DEFAULT
	SET_ROLE_TYPE_NONE
	SET_ROLE_TYPE_ALL
	SET_ROLE_TYPE_ALL_EXCEPT
)

type SetVar

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

func NewSetVar

func NewSetVar(a []*VarAssignmentExpr) *SetVar

func (*SetVar) Format

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

type Show

type Show interface {
	Explain
}

type ShowColumns

type ShowColumns struct {
	Ext     bool
	Full    bool
	Table   *UnresolvedObjectName
	ColName *UnresolvedName
	DBName  string
	Like    *ComparisonExpr
	Where   *Where
	// contains filtered or unexported fields
}

SHOW COLUMNS statement.

func NewShowColumns

func NewShowColumns(e bool, f bool, t *UnresolvedObjectName, d string, l *ComparisonExpr, w *Where, cn *UnresolvedName) *ShowColumns

func (*ShowColumns) Format

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

type ShowCreateDatabase

type ShowCreateDatabase struct {
	IfNotExists bool
	Name        string
	// contains filtered or unexported fields
}

SHOW CREATE DATABASE statement

func NewShowCreateDatabase

func NewShowCreateDatabase(i bool, n string) *ShowCreateDatabase

func (*ShowCreateDatabase) Format

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

type ShowCreateTable

type ShowCreateTable struct {
	Name *UnresolvedObjectName
	// contains filtered or unexported fields
}

SHOW CREATE TABLE statement

func NewShowCreate

func NewShowCreate(n *UnresolvedObjectName) *ShowCreateTable

func (*ShowCreateTable) Format

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

type ShowDatabases

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

the SHOW DATABASES statement.

func NewShowDatabases

func NewShowDatabases(l *ComparisonExpr, w *Where) *ShowDatabases

func (*ShowDatabases) Format

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

type ShowErrors

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

func NewShowErrors

func NewShowErrors() *ShowErrors

func (*ShowErrors) Format

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

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

type ShowProcessList

type ShowProcessList struct {
	Full bool
	// contains filtered or unexported fields
}

SHOW PROCESSLIST

func NewShowProcessList

func NewShowProcessList(f bool) *ShowProcessList

func (*ShowProcessList) Format

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

type ShowStatus

type ShowStatus struct {
	Global bool
	Like   *ComparisonExpr
	Where  *Where
	// contains filtered or unexported fields
}

SHOW STATUS statement

func NewShowStatus

func NewShowStatus(g bool, l *ComparisonExpr, w *Where) *ShowStatus

func (*ShowStatus) Format

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

type ShowTables

type ShowTables struct {
	Ext    bool
	Open   bool
	Full   bool
	DBName string
	Like   *ComparisonExpr
	Where  *Where
	// contains filtered or unexported fields
}

SHOW TABLES statement.

func NewShowTables

func NewShowTables(e bool, f bool, n string, l *ComparisonExpr, w *Where) *ShowTables

func (*ShowTables) Format

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

type ShowVariables

type ShowVariables struct {
	Global bool
	Like   *ComparisonExpr
	Where  *Where
	// contains filtered or unexported fields
}

SHOW VARIABLES statement System Variables

func NewShowVariables

func NewShowVariables(g bool, l *ComparisonExpr, w *Where) *ShowVariables

func (*ShowVariables) Format

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

type ShowWarnings

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

func NewShowWarnings

func NewShowWarnings() *ShowWarnings

func (*ShowWarnings) Format

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

type Statement

type Statement interface {
	fmt.Stringer
	NodeFormatter
}

type StatementSource

type StatementSource struct {
	TableExpr
	Statement Statement
}

the statements as a data source includes the select statement.

func NewStatementSource

func NewStatementSource(s Statement) *StatementSource

type StrVal

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

StrVal represents a constant string value.

func NewStrVal

func NewStrVal(s string) *StrVal

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

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

type SubqueryExpr

type SubqueryExpr interface {
	Expr
}

subquery interface

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 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 (node 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 {
	NodeFormatter
}

type TableOptionAutoIncrement

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

func NewTableOptionAutoIncrement

func NewTableOptionAutoIncrement(v uint64) *TableOptionAutoIncrement

func (*TableOptionAutoIncrement) Format

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

type TableOptionAvgRowLength

type TableOptionAvgRowLength struct {
	Length uint64
	// contains filtered or unexported fields
}

func NewTableOptionAvgRowLength

func NewTableOptionAvgRowLength(l uint64) *TableOptionAvgRowLength

func (*TableOptionAvgRowLength) Format

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

type TableOptionCharset

type TableOptionCharset struct {
	Charset string
	// contains filtered or unexported fields
}

func NewTableOptionCharset

func NewTableOptionCharset(s string) *TableOptionCharset

func (*TableOptionCharset) Format

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

type TableOptionChecksum

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

func NewTableOptionChecksum

func NewTableOptionChecksum(v uint64) *TableOptionChecksum

func (*TableOptionChecksum) Format

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

type TableOptionCollate

type TableOptionCollate struct {
	Collate string
	// contains filtered or unexported fields
}

func NewTableOptionCollate

func NewTableOptionCollate(s string) *TableOptionCollate

func (*TableOptionCollate) Format

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

type TableOptionComment

type TableOptionComment struct {
	Comment string
	// contains filtered or unexported fields
}

func NewTableOptionComment

func NewTableOptionComment(c string) *TableOptionComment

func (*TableOptionComment) Format

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

type TableOptionCompression

type TableOptionCompression struct {
	Compression string
	// contains filtered or unexported fields
}

func NewTableOptionCompression

func NewTableOptionCompression(c string) *TableOptionCompression

func (*TableOptionCompression) Format

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

type TableOptionConnection

type TableOptionConnection struct {
	Connection string
	// contains filtered or unexported fields
}

func NewTableOptionConnection

func NewTableOptionConnection(c string) *TableOptionConnection

func (*TableOptionConnection) Format

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

type TableOptionDataDirectory

type TableOptionDataDirectory struct {
	Dir string
	// contains filtered or unexported fields
}

func NewTableOptionDataDirectory

func NewTableOptionDataDirectory(d string) *TableOptionDataDirectory

func (*TableOptionDataDirectory) Format

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

type TableOptionDelayKeyWrite

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

func NewTableOptionDelayKeyWrite

func NewTableOptionDelayKeyWrite(v uint64) *TableOptionDelayKeyWrite

func (*TableOptionDelayKeyWrite) Format

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

type TableOptionEncryption

type TableOptionEncryption struct {
	Encryption string
	// contains filtered or unexported fields
}

func NewTableOptionEncryption

func NewTableOptionEncryption(e string) *TableOptionEncryption

func (*TableOptionEncryption) Format

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

type TableOptionEngine

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

func NewTableOptionEngine

func NewTableOptionEngine(s string) *TableOptionEngine

func (*TableOptionEngine) Format

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

type TableOptionIndexDirectory

type TableOptionIndexDirectory struct {
	Dir string
	// contains filtered or unexported fields
}

func NewTableOptionIndexDirectory

func NewTableOptionIndexDirectory(d string) *TableOptionIndexDirectory

func (*TableOptionIndexDirectory) Format

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

type TableOptionKeyBlockSize

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

func NewTableOptionKeyBlockSize

func NewTableOptionKeyBlockSize(v uint64) *TableOptionKeyBlockSize

func (*TableOptionKeyBlockSize) Format

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

type TableOptionMaxRows

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

func NewTableOptionMaxRows

func NewTableOptionMaxRows(v uint64) *TableOptionMaxRows

func (*TableOptionMaxRows) Format

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

type TableOptionMinRows

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

func NewTableOptionMinRows

func NewTableOptionMinRows(v uint64) *TableOptionMinRows

func (*TableOptionMinRows) Format

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

type TableOptionPackKeys

type TableOptionPackKeys struct {
	Value   int64
	Default bool
	// contains filtered or unexported fields
}

func NewTableOptionPackKeys

func NewTableOptionPackKeys(value int64) *TableOptionPackKeys

func (*TableOptionPackKeys) Format

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

type TableOptionPassword

type TableOptionPassword struct {
	Password string
	// contains filtered or unexported fields
}

func NewTableOptionPassword

func NewTableOptionPassword(p string) *TableOptionPassword

func (*TableOptionPassword) Format

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

type TableOptionProperties

type TableOptionProperties struct {
	Preperties []Property
	// contains filtered or unexported fields
}

func (*TableOptionProperties) Format

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

type TableOptionRowFormat

type TableOptionRowFormat struct {
	Value RowFormatType
	// contains filtered or unexported fields
}

func NewTableOptionRowFormat

func NewTableOptionRowFormat(v RowFormatType) *TableOptionRowFormat

func (*TableOptionRowFormat) Format

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

type TableOptionSecondaryEngine

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

func NewTableOptionSecondaryEngine

func NewTableOptionSecondaryEngine(s string) *TableOptionSecondaryEngine

func (*TableOptionSecondaryEngine) Format

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

type TableOptionSecondaryEngineNull

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

func NewTableOptionSecondaryEngineNull

func NewTableOptionSecondaryEngineNull() *TableOptionSecondaryEngineNull

type TableOptionStatsAutoRecalc

type TableOptionStatsAutoRecalc struct {
	Value   uint64
	Default bool //false -- see Value; true -- Value is useless
	// contains filtered or unexported fields
}

func NewTableOptionStatsAutoRecalc

func NewTableOptionStatsAutoRecalc(v uint64, d bool) *TableOptionStatsAutoRecalc

func (*TableOptionStatsAutoRecalc) Format

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

type TableOptionStatsPersistent

type TableOptionStatsPersistent struct {
	Value   uint64
	Default bool
	// contains filtered or unexported fields
}

func NewTableOptionStatsPersistent

func NewTableOptionStatsPersistent() *TableOptionStatsPersistent

func (*TableOptionStatsPersistent) Format

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

type TableOptionStatsSamplePages

type TableOptionStatsSamplePages struct {
	Value   uint64
	Default bool //false -- see Value; true -- Value is useless
	// contains filtered or unexported fields
}

func NewTableOptionStatsSamplePages

func NewTableOptionStatsSamplePages(v uint64, d bool) *TableOptionStatsSamplePages

func (*TableOptionStatsSamplePages) Format

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

type TableOptionStorageMedia

type TableOptionStorageMedia struct {
	Media string
	// contains filtered or unexported fields
}

func NewTableOptionStorageMedia

func NewTableOptionStorageMedia(m string) *TableOptionStorageMedia

func (*TableOptionStorageMedia) Format

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

type TableOptionTablespace

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

func NewTableOptionTablespace

func NewTableOptionTablespace(n string, s string) *TableOptionTablespace

func (*TableOptionTablespace) Format

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

type TableOptionUnion

type TableOptionUnion struct {
	Names TableNames
	// contains filtered or unexported fields
}

func NewTableOptionUnion

func NewTableOptionUnion(n TableNames) *TableOptionUnion

func (*TableOptionUnion) Format

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

type TlsOption

type TlsOption interface {
	NodeFormatter
}

type TlsOptionCipher

type TlsOptionCipher struct {
	Cipher string
	// contains filtered or unexported fields
}

func (*TlsOptionCipher) Format

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

type TlsOptionIssuer

type TlsOptionIssuer struct {
	Issuer string
	// contains filtered or unexported fields
}

func (*TlsOptionIssuer) Format

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

type TlsOptionNone

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

func (*TlsOptionNone) Format

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

type TlsOptionSSL

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

func (*TlsOptionSSL) Format

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

type TlsOptionSan

type TlsOptionSan struct {
	San string
	// contains filtered or unexported fields
}

func (*TlsOptionSan) Format

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

type TlsOptionSubject

type TlsOptionSubject struct {
	Subject string
	// contains filtered or unexported fields
}

func (*TlsOptionSubject) Format

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

type TlsOptionX509

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

func (*TlsOptionX509) Format

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

type TransactionModes

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

modes for a transaction

func MakeTransactionModes

func MakeTransactionModes(rwm ReadWriteMode) TransactionModes

func (*TransactionModes) Format

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

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

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

func (*Tuple) String

func (node *Tuple) String() string

type TypeExpr

type TypeExpr interface {
	Expr
}

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

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

set operations

const (
	UNION UnionType = iota
	INTERSECT
	EXCEPT
)

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

func NewUniqueIndex

func NewUniqueIndex(k []*KeyPart, n string, e bool, io *IndexOption) *UniqueIndex

func (*UniqueIndex) Format

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

type UnqualifiedStar

type UnqualifiedStar struct {
	VarName
}

'*' in the scalar expression

func (UnqualifiedStar) Format

func (node UnqualifiedStar) Format(ctx *FmtCtx)

type UnresolvedName

type UnresolvedName struct {

	//the number of name parts specified, including the star. Always 1 or greater.
	NumParts int

	//the name ends with a star. then the first element is empty in the Parts
	Star bool

	// Parts are the name components (at most 4: column, table, db/schema, catalog.), in reverse order.
	Parts NameParts
	// contains filtered or unexported fields
}

the unresolved qualified name like column name.

func NewUnresolvedName

func NewUnresolvedName(parts ...string) (*UnresolvedName, error)

func NewUnresolvedNameWithStar

func NewUnresolvedNameWithStar(parts ...string) (*UnresolvedName, error)

func SetUnresolvedName

func SetUnresolvedName(parts ...string) *UnresolvedName

func SetUnresolvedNameWithStar

func SetUnresolvedNameWithStar(parts ...string) *UnresolvedName

func (*UnresolvedName) Format

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

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(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) ToTableName

func (u *UnresolvedObjectName) ToTableName() TableName

type UnrestrictedIdentifier

type UnrestrictedIdentifier string

type Update

type Update struct {
	Table   TableExpr
	Exprs   UpdateExprs
	From    TableExprs
	Where   *Where
	OrderBy OrderBy
	Limit   *Limit
	// contains filtered or unexported fields
}

update statement

func NewUpdate

func NewUpdate(t TableExpr, e UpdateExprs, f TableExprs, w *Where, o OrderBy, l *Limit) *Update

func (*Update) Format

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

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 Use

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

Use statement

func NewUse

func NewUse(n string) *Use

func (*Use) Format

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

type User

type User struct {
	NodeFormatter
	Username   string
	Hostname   string
	AuthPlugin string
	AuthString string
	HashString string
	ByAuth     bool
}

func NewUser

func NewUser(u, h, ap, as 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 int
	// contains filtered or unexported fields
}

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

type UserMiscOptionPasswordHistoryDefault

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

type UserMiscOptionPasswordLockTimeCount

type UserMiscOptionPasswordLockTimeCount struct {
	Value int
	// contains filtered or unexported fields
}

type UserMiscOptionPasswordLockTimeUnbounded

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

type UserMiscOptionPasswordRequireCurrentDefault

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

type UserMiscOptionPasswordRequireCurrentOptional

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

type UserMiscOptionPasswordReuseIntervalCount

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

type UserMiscOptionPasswordReuseIntervalDefault

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

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

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 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) 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 {
	Enter(Expr) (bool, Expr)
	Exit(Expr) Expr
}

Visitor Design Pattern Visitor visits the node or sub 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 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 With

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

func (*With) Format

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

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