Documentation ¶
Index ¶
- func EncodeSQLValue(buf []byte, arg interface{}) ([]byte, error)
- type AliasedTableExpr
- type AndExpr
- type BinaryExpr
- type BoolExpr
- type BytesVal
- type CaseExpr
- type ColName
- type Columns
- type Comments
- type ComparisonExpr
- type DDL
- type Delete
- type ErrVal
- type ExistsExpr
- type Expr
- type FuncExpr
- type GroupBy
- type IndexHints
- type Insert
- type InsertRows
- type JoinCond
- type JoinTableExpr
- type Limit
- type NonStarExpr
- type NotExpr
- type NullCheck
- type NullVal
- type NumVal
- type OnDup
- type OnJoinCond
- type OrExpr
- type Order
- type OrderBy
- type ParenBoolExpr
- type ParenTableExpr
- type RangeCond
- type Select
- type SelectExpr
- type SelectExprs
- type SelectStatement
- type Set
- type SimpleTableExpr
- type StarExpr
- type Statement
- type StrVal
- type Subquery
- type TableExpr
- type TableExprs
- type TableName
- type Tokenizer
- type Tuple
- type UnaryExpr
- type Union
- type Update
- type UpdateExpr
- type UpdateExprs
- type Use
- type UsingJoinCond
- type ValArg
- type ValExpr
- type ValExprs
- type ValTuple
- type Values
- type When
- type Where
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeSQLValue ¶
EncodeSQLValue ...
Types ¶
type AliasedTableExpr ¶
type AliasedTableExpr struct { Expr SimpleTableExpr As string Hints *IndexHints }
AliasedTableExpr represents a table expression coupled with an optional alias or index hint.
func (*AliasedTableExpr) String ¶
func (node *AliasedTableExpr) String() string
type BinaryExpr ¶
BinaryExpr represents a binary value expression.
func (*BinaryExpr) String ¶
func (node *BinaryExpr) String() string
type BoolExpr ¶
type BoolExpr interface { Expr // contains filtered or unexported methods }
BoolExpr represents a boolean expression.
type Columns ¶
type Columns []SelectExpr
Columns represents an insert column list. The syntax for Columns is a subset of SelectExprs. So, it's castable to a SelectExprs and can be analyzed as such.
type ComparisonExpr ¶
ComparisonExpr represents a two-value comparison expression.
func (*ComparisonExpr) String ¶
func (node *ComparisonExpr) String() string
type DDL ¶
DDL represents a CREATE, ALTER, DROP or RENAME statement. Table is set for astAlter, astDrop, astRename. NewName is set for astAlter, astCreate, astRename.
type ErrVal ¶
type ErrVal struct {
Err error
}
ErrVal represents an error condition that occurred while constructing a tree.
type ExistsExpr ¶
type ExistsExpr struct {
Subquery *Subquery
}
ExistsExpr represents an EXISTS expression.
func (*ExistsExpr) String ¶
func (node *ExistsExpr) String() string
type Expr ¶
type Expr interface {
// contains filtered or unexported methods
}
Expr represents an expression.
type FuncExpr ¶
type FuncExpr struct { Name string Distinct bool Exprs SelectExprs }
FuncExpr represents a function call.
type IndexHints ¶
IndexHints represents a list of index hints.
func (*IndexHints) String ¶
func (node *IndexHints) String() string
type Insert ¶
type Insert struct { Comments Comments Table *TableName Columns Columns Rows InsertRows OnDup OnDup }
Insert represents an INSERT statement.
type InsertRows ¶
type InsertRows interface {
// contains filtered or unexported methods
}
InsertRows represents the rows for an INSERT statement.
type JoinCond ¶
type JoinCond interface {
// contains filtered or unexported methods
}
JoinCond represents a join condition.
type JoinTableExpr ¶
JoinTableExpr represents a TableExpr that's a JOIN operation.
func (*JoinTableExpr) String ¶
func (node *JoinTableExpr) String() string
type NonStarExpr ¶
NonStarExpr defines a non-'*' select expr.
func (*NonStarExpr) String ¶
func (node *NonStarExpr) String() string
type OnJoinCond ¶
type OnJoinCond struct {
Expr BoolExpr
}
OnJoinCond represents an ON join condition.
func (*OnJoinCond) String ¶
func (node *OnJoinCond) String() string
type ParenBoolExpr ¶
type ParenBoolExpr struct {
Expr BoolExpr
}
ParenBoolExpr represents a parenthesized boolean expression.
func (*ParenBoolExpr) String ¶
func (node *ParenBoolExpr) String() string
type ParenTableExpr ¶
type ParenTableExpr struct {
Expr TableExpr
}
ParenTableExpr represents a parenthesized TableExpr.
func (*ParenTableExpr) String ¶
func (node *ParenTableExpr) String() string
type Select ¶
type Select struct { Comments Comments Distinct string Exprs SelectExprs From TableExprs Where *Where GroupBy GroupBy Having *Where OrderBy OrderBy Limit *Limit Lock string }
Select represents a SELECT statement.
type SelectExpr ¶
type SelectExpr interface {
// contains filtered or unexported methods
}
SelectExpr represents a SELECT expression.
type SelectExprs ¶
type SelectExprs []SelectExpr
SelectExprs represents SELECT expressions.
func (SelectExprs) String ¶
func (node SelectExprs) String() string
type SelectStatement ¶
SelectStatement any SELECT statement.
type SimpleTableExpr ¶
type SimpleTableExpr interface {
// contains filtered or unexported methods
}
SimpleTableExpr represents a simple table expression.
type StarExpr ¶
type StarExpr struct {
TableName string
}
StarExpr defines a '*' or 'table.*' expression.
type TableExpr ¶
type TableExpr interface {
// contains filtered or unexported methods
}
TableExpr represents a table expression.
type TableExprs ¶
type TableExprs []TableExpr
TableExprs represents a list of table expressions.
func (TableExprs) String ¶
func (node TableExprs) String() string
type TableName ¶
type TableName struct {
Name, Qualifier string
}
TableName represents a table name.
type Tokenizer ¶
type Tokenizer struct { InStream *strings.Reader AllowComments bool ForceEOF bool Position int LastError string ParseTree Statement // contains filtered or unexported fields }
Tokenizer is the struct used to generate SQL tokens for the parser.
func NewStringTokenizer ¶
NewStringTokenizer creates a new Tokenizer for the sql string.
type Tuple ¶
type Tuple interface { ValExpr // contains filtered or unexported methods }
Tuple represents a tuple. It can be ValTuple, Subquery.
type Union ¶
type Union struct { Type string Left, Right SelectStatement }
Union represents a UNION statement.
type Update ¶
type Update struct { Comments Comments Table *TableName Exprs UpdateExprs Where *Where OrderBy OrderBy Limit *Limit }
Update represents an UPDATE statement.
type UpdateExpr ¶
UpdateExpr represents an update expression.
func (*UpdateExpr) String ¶
func (node *UpdateExpr) String() string
type UpdateExprs ¶
type UpdateExprs []*UpdateExpr
UpdateExprs represents a list of update expressions.
func (UpdateExprs) String ¶
func (node UpdateExprs) String() string
type UsingJoinCond ¶
type UsingJoinCond struct {
Cols Columns
}
UsingJoinCond represents a USING join condition.
func (*UsingJoinCond) String ¶
func (node *UsingJoinCond) String() string
type ValExpr ¶
type ValExpr interface { Expr // contains filtered or unexported methods }
ValExpr represents a value expression.
type ValExprs ¶
type ValExprs []ValExpr
ValExprs represents a list of value expressions. It's not a valid expression because it's not parenthesized.