Documentation ¶
Index ¶
- Constants
- Variables
- func Dispose(e sql.Expression)
- func ExpressionsResolved(exprs ...sql.Expression) bool
- func GetConvertToType(l, r sql.Type) string
- func GetDecimalPrecisionAndScale(val string) (uint8, uint8)
- func GetPrecisionAndScale(val interface{}) (uint8, uint8)
- func IsBinary(e sql.Expression) bool
- func IsBindVar(e sql.Expression) bool
- func IsUnary(e sql.Expression) bool
- func JoinAnd(exprs ...sql.Expression) sql.Expression
- func JoinOr(exprs ...sql.Expression) sql.Expression
- func LiteralToInt(e sql.Expression) (int, error)
- func NewAnd(left, right sql.Expression) sql.Expression
- func NewBinary(e sql.Expression) sql.Expression
- func NewLike(left, right, escape sql.Expression) sql.Expression
- func NewNotInTuple(left sql.Expression, right sql.Expression) sql.Expression
- func NewOr(left, right sql.Expression) sql.Expression
- func NewRangeFilterExpr(exprs []sql.Expression, ranges []sql.Range) (sql.Expression, error)
- func NewSetField(left, expr sql.Expression) sql.Expression
- func NewXor(left, right sql.Expression) sql.Expression
- func PreciseComparison(e sql.Expression) bool
- func SchemaToGetFields(s sql.Schema, columns sql.ColSet) []sql.Expression
- func SplitConjunction(expr sql.Expression) []sql.Expression
- func SplitDisjunction(expr sql.Expression) []sql.Expression
- func WrapExpressions(exprs ...sql.Expression) []sql.Expression
- type Alias
- func (e *Alias) AsUnreferencable() *Alias
- func (e *Alias) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (e *Alias) DebugString() string
- func (e *Alias) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (e *Alias) Id() sql.ColumnId
- func (e *Alias) Name() string
- func (e *Alias) String() string
- func (e *Alias) Type() sql.Type
- func (e *Alias) Unreferencable() bool
- func (e *Alias) WithChildren(children ...sql.Expression) (sql.Expression, error)
- func (e *Alias) WithId(id sql.ColumnId) sql.IdExpression
- type AliasReference
- func (a AliasReference) Children() []sql.Expression
- func (AliasReference) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (a AliasReference) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (a AliasReference) IsNullable() bool
- func (a AliasReference) Name() string
- func (a AliasReference) Resolved() bool
- func (a AliasReference) String() string
- func (a AliasReference) Table() string
- func (a AliasReference) Type() sql.Type
- func (a AliasReference) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type And
- func (*And) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (a *And) DebugString() string
- func (a *And) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (a *And) String() string
- func (*And) Type() sql.Type
- func (a *And) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Arithmetic
- func (*Arithmetic) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (a *Arithmetic) DebugString() string
- func (a *Arithmetic) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (a *Arithmetic) IsNullable() bool
- func (a *Arithmetic) Operator() string
- func (a *Arithmetic) SetOpCount(i int32)
- func (a *Arithmetic) String() string
- func (a *Arithmetic) Type() sql.Type
- func (a *Arithmetic) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type ArithmeticOp
- type AutoIncrement
- func (i *AutoIncrement) Children() []sql.Expression
- func (i *AutoIncrement) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (i *AutoIncrement) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (i *AutoIncrement) IsNullable() bool
- func (i *AutoIncrement) String() string
- func (i *AutoIncrement) Type() sql.Type
- func (i *AutoIncrement) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Between
- func (b *Between) Children() []sql.Expression
- func (b *Between) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (b *Between) DebugString() string
- func (b *Between) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (b *Between) IsNullable() bool
- func (b *Between) Resolved() bool
- func (b *Between) String() string
- func (*Between) Type() sql.Type
- func (b *Between) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Binary
- func (*Binary) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (b *Binary) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (b *Binary) String() string
- func (b *Binary) Type() sql.Type
- func (b *Binary) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type BinaryExpression
- type BinaryExpressionStub
- type BindVar
- func (bv *BindVar) Children() []sql.Expression
- func (bv *BindVar) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (bv *BindVar) Eval(*sql.Context, sql.Row) (interface{}, error)
- func (bv *BindVar) IsNullable() bool
- func (bv *BindVar) Resolved() bool
- func (bv *BindVar) String() string
- func (bv *BindVar) Type() sql.Type
- func (bv *BindVar) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type BitOp
- func NewBitAnd(left, right sql.Expression) *BitOp
- func NewBitOp(left, right sql.Expression, op string) *BitOp
- func NewBitOr(left, right sql.Expression) *BitOp
- func NewBitXor(left, right sql.Expression) *BitOp
- func NewShiftLeft(left, right sql.Expression) *BitOp
- func NewShiftRight(left, right sql.Expression) *BitOp
- func (*BitOp) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (b *BitOp) DebugString() string
- func (b *BitOp) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (b *BitOp) IsNullable() bool
- func (b *BitOp) String() string
- func (b *BitOp) Type() sql.Type
- func (b *BitOp) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Case
- func (c *Case) Children() []sql.Expression
- func (c *Case) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (c *Case) DebugString() string
- func (c *Case) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (c *Case) IsNullable() bool
- func (c *Case) Resolved() bool
- func (c *Case) String() string
- func (c *Case) Type() sql.Type
- func (c *Case) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type CaseBranch
- type CollatedExpression
- func (ce *CollatedExpression) Child() sql.Expression
- func (ce *CollatedExpression) Children() []sql.Expression
- func (ce *CollatedExpression) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (ce *CollatedExpression) DebugString() string
- func (ce *CollatedExpression) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (ce *CollatedExpression) IsNullable() bool
- func (ce *CollatedExpression) Resolved() bool
- func (ce *CollatedExpression) String() string
- func (ce *CollatedExpression) Type() sql.Type
- func (ce *CollatedExpression) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Comparer
- type Convert
- func (c *Convert) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (c *Convert) DebugString() string
- func (c *Convert) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (c *Convert) IsNullable() bool
- func (c *Convert) String() string
- func (c *Convert) Type() sql.Type
- func (c *Convert) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type ConvertUsing
- func (c *ConvertUsing) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (c *ConvertUsing) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (c *ConvertUsing) String() string
- func (c *ConvertUsing) Type() sql.Type
- func (c *ConvertUsing) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type DeclareHandlerAction
- type DefaultColumn
- func (*DefaultColumn) Children() []sql.Expression
- func (*DefaultColumn) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (*DefaultColumn) Eval(ctx *sql.Context, r sql.Row) (interface{}, error)
- func (*DefaultColumn) IsNullable() bool
- func (c *DefaultColumn) Name() string
- func (*DefaultColumn) Resolved() bool
- func (c *DefaultColumn) String() string
- func (*DefaultColumn) Type() sql.Type
- func (c *DefaultColumn) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type DistinctExpression
- func (de *DistinctExpression) Children() []sql.Expression
- func (de *DistinctExpression) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (de *DistinctExpression) Dispose()
- func (de *DistinctExpression) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (de *DistinctExpression) IsNullable() bool
- func (de *DistinctExpression) Resolved() bool
- func (de *DistinctExpression) String() string
- func (de *DistinctExpression) Type() sql.Type
- func (de *DistinctExpression) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Div
- func (*Div) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (d *Div) DebugString() string
- func (d *Div) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (d *Div) IsNullable() bool
- func (d *Div) Operator() string
- func (d *Div) SetOpCount(i int32)
- func (d *Div) String() string
- func (d *Div) Type() sql.Type
- func (d *Div) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Equals
- func (e *Equals) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (c *Equals) Compare(ctx *sql.Context, row sql.Row) (int, error)
- func (e *Equals) DebugString() string
- func (e *Equals) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (c *Equals) Left() sql.Expression
- func (c *Equals) Right() sql.Expression
- func (e *Equals) String() string
- func (*Equals) Type() sql.Type
- func (e *Equals) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type GetField
- func (*GetField) Children() []sql.Expression
- func (p *GetField) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (p *GetField) Database() string
- func (p *GetField) DebugString() string
- func (p *GetField) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (p *GetField) Eval2(ctx *sql.Context, row sql.Row2) (sql.Value, error)
- func (p *GetField) Id() sql.ColumnId
- func (p *GetField) Index() int
- func (p *GetField) IsBackTickNames() bool
- func (p *GetField) IsNullable() bool
- func (p *GetField) Name() string
- func (p *GetField) Resolved() bool
- func (p *GetField) String() string
- func (p *GetField) Table() string
- func (p *GetField) TableID() sql.TableId
- func (p *GetField) TableId() sql.TableId
- func (p *GetField) Type() sql.Type
- func (p *GetField) Type2() sql.Type2
- func (p *GetField) WithBackTickNames(backtick bool) *GetField
- func (p *GetField) WithChildren(children ...sql.Expression) (sql.Expression, error)
- func (p *GetField) WithId(id sql.ColumnId) sql.IdExpression
- func (p *GetField) WithIndex(n int) sql.Expression
- func (p *GetField) WithName(name string) *GetField
- func (p *GetField) WithTable(table string) *GetField
- type GreaterThan
- func (gt *GreaterThan) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (c *GreaterThan) Compare(ctx *sql.Context, row sql.Row) (int, error)
- func (gt *GreaterThan) DebugString() string
- func (gt *GreaterThan) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (c *GreaterThan) Left() sql.Expression
- func (c *GreaterThan) Right() sql.Expression
- func (gt *GreaterThan) String() string
- func (*GreaterThan) Type() sql.Type
- func (gt *GreaterThan) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type GreaterThanOrEqual
- func (gte *GreaterThanOrEqual) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (c *GreaterThanOrEqual) Compare(ctx *sql.Context, row sql.Row) (int, error)
- func (gte *GreaterThanOrEqual) DebugString() string
- func (gte *GreaterThanOrEqual) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (c *GreaterThanOrEqual) Left() sql.Expression
- func (c *GreaterThanOrEqual) Right() sql.Expression
- func (gte *GreaterThanOrEqual) String() string
- func (*GreaterThanOrEqual) Type() sql.Type
- func (gte *GreaterThanOrEqual) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type HandlerCondition
- type HandlerConditionType
- type HashInTuple
- func (hit *HashInTuple) Children() []sql.Expression
- func (hit *HashInTuple) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (hit *HashInTuple) Compare(ctx *sql.Context, row sql.Row) (int, error)
- func (hit *HashInTuple) DebugString() string
- func (hit *HashInTuple) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (hit *HashInTuple) IsNullable() bool
- func (hit *HashInTuple) Left() sql.Expression
- func (hit *HashInTuple) Resolved() bool
- func (hit *HashInTuple) Right() sql.Expression
- func (hit *HashInTuple) String() string
- func (hit *HashInTuple) Type() sql.Type
- func (hit *HashInTuple) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type InTuple
- func (in *InTuple) Children() []sql.Expression
- func (*InTuple) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (in *InTuple) Compare(ctx *sql.Context, row sql.Row) (int, error)
- func (in *InTuple) DebugString() string
- func (in *InTuple) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (in *InTuple) Left() sql.Expression
- func (in *InTuple) Right() sql.Expression
- func (in *InTuple) String() string
- func (in *InTuple) Type() sql.Type
- func (in *InTuple) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type IntDiv
- func (*IntDiv) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (i *IntDiv) DebugString() string
- func (i *IntDiv) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (i *IntDiv) IsNullable() bool
- func (i *IntDiv) Operator() string
- func (i *IntDiv) SetOpCount(i2 int32)
- func (i *IntDiv) String() string
- func (i *IntDiv) Type() sql.Type
- func (i *IntDiv) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Interval
- func (*Interval) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (i *Interval) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (i *Interval) EvalDelta(ctx *sql.Context, row sql.Row) (*TimeDelta, error)
- func (i *Interval) IsNullable() bool
- func (i *Interval) String() string
- func (i *Interval) Type() sql.Type
- func (i *Interval) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type IsNull
- func (*IsNull) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (e IsNull) DebugString() string
- func (e *IsNull) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (e *IsNull) IsNullable() bool
- func (e IsNull) String() string
- func (e *IsNull) Type() sql.Type
- func (e *IsNull) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type IsTrue
- func (*IsTrue) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (e *IsTrue) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (*IsTrue) IsNullable() bool
- func (e *IsTrue) String() string
- func (*IsTrue) Type() sql.Type
- func (e *IsTrue) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type LessThan
- func (lt *LessThan) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (c *LessThan) Compare(ctx *sql.Context, row sql.Row) (int, error)
- func (lt *LessThan) DebugString() string
- func (lt *LessThan) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (c *LessThan) Left() sql.Expression
- func (c *LessThan) Right() sql.Expression
- func (lt *LessThan) String() string
- func (*LessThan) Type() sql.Type
- func (lt *LessThan) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type LessThanOrEqual
- func (lte *LessThanOrEqual) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (c *LessThanOrEqual) Compare(ctx *sql.Context, row sql.Row) (int, error)
- func (lte *LessThanOrEqual) DebugString() string
- func (lte *LessThanOrEqual) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (c *LessThanOrEqual) Left() sql.Expression
- func (c *LessThanOrEqual) Right() sql.Expression
- func (lte *LessThanOrEqual) String() string
- func (*LessThanOrEqual) Type() sql.Type
- func (lte *LessThanOrEqual) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Like
- func (l *Like) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (l *Like) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (l *Like) String() string
- func (l *Like) Type() sql.Type
- func (l *Like) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type LikeMatcher
- type Literal
- func (*Literal) Children() []sql.Expression
- func (lit *Literal) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (lit *Literal) DebugString() string
- func (lit *Literal) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (lit *Literal) Eval2(ctx *sql.Context, row sql.Row2) (sql.Value, error)
- func (lit *Literal) IsNullable() bool
- func (lit *Literal) Resolved() bool
- func (lit *Literal) String() string
- func (lit *Literal) Type() sql.Type
- func (lit *Literal) Type2() sql.Type2
- func (p *Literal) Value() interface{}
- func (lit *Literal) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type MatchAgainst
- func (expr *MatchAgainst) Children() []sql.Expression
- func (expr *MatchAgainst) ColumnsAsGetFields() []*GetField
- func (expr *MatchAgainst) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (expr *MatchAgainst) GetIndex() fulltext.Index
- func (expr *MatchAgainst) IsNullable() bool
- func (expr *MatchAgainst) Resolved() bool
- func (expr *MatchAgainst) SetIndex(fulltextIndex fulltext.Index)
- func (expr *MatchAgainst) String() string
- func (expr *MatchAgainst) Type() sql.Type
- func (expr *MatchAgainst) WithChildren(children ...sql.Expression) (sql.Expression, error)
- func (expr *MatchAgainst) WithInfo(...) *MatchAgainst
- type Mod
- func (*Mod) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (m *Mod) DebugString() string
- func (m *Mod) Description() string
- func (m *Mod) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (m *Mod) FunctionName() string
- func (m *Mod) IsNullable() bool
- func (m *Mod) Operator() string
- func (m *Mod) SetOpCount(i int32)
- func (m *Mod) String() string
- func (m *Mod) Type() sql.Type
- func (m *Mod) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type NamedLiteral
- type NaryExpression
- type Not
- func (*Not) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (e *Not) DebugString() string
- func (e *Not) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (e *Not) String() string
- func (e *Not) Type() sql.Type
- func (e *Not) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type NullSafeEquals
- func (e *NullSafeEquals) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (e *NullSafeEquals) Compare(ctx *sql.Context, row sql.Row) (int, error)
- func (e *NullSafeEquals) DebugString() string
- func (e *NullSafeEquals) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (c *NullSafeEquals) Left() sql.Expression
- func (c *NullSafeEquals) Right() sql.Expression
- func (e *NullSafeEquals) String() string
- func (e *NullSafeEquals) Type() sql.Type
- func (e *NullSafeEquals) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Or
- func (*Or) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (o *Or) DebugString() string
- func (o *Or) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (o *Or) String() string
- func (*Or) Type() sql.Type
- func (o *Or) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type ProcedureParam
- func (*ProcedureParam) Children() []sql.Expression
- func (pp *ProcedureParam) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (pp *ProcedureParam) Eval(ctx *sql.Context, r sql.Row) (interface{}, error)
- func (*ProcedureParam) IsNullable() bool
- func (pp *ProcedureParam) Name() string
- func (*ProcedureParam) Resolved() bool
- func (pp *ProcedureParam) Set(val interface{}, valType sql.Type) error
- func (pp *ProcedureParam) String() string
- func (pp *ProcedureParam) Type() sql.Type
- func (pp *ProcedureParam) WithChildren(children ...sql.Expression) (sql.Expression, error)
- func (pp *ProcedureParam) WithParamReference(pRef *ProcedureReference) *ProcedureParam
- type ProcedureReferencable
- type ProcedureReference
- func (ppr *ProcedureReference) CloseAllCursors(ctx *sql.Context) error
- func (ppr *ProcedureReference) CloseCursor(ctx *sql.Context, name string) error
- func (ppr *ProcedureReference) CurrentHeight() int
- func (ppr *ProcedureReference) FetchCursor(ctx *sql.Context, name string) (sql.Row, sql.Schema, error)
- func (ppr *ProcedureReference) GetVariableType(name string) sql.Type
- func (ppr *ProcedureReference) GetVariableValue(name string) (interface{}, error)
- func (ppr *ProcedureReference) InitializeCursor(name string, selectStmt sql.Node)
- func (ppr *ProcedureReference) InitializeHandler(stmt sql.Node, action DeclareHandlerAction, cond HandlerCondition)
- func (ppr *ProcedureReference) InitializeVariable(name string, sqlType sql.Type, val interface{}) error
- func (ppr *ProcedureReference) PopScope(ctx *sql.Context) error
- func (ppr *ProcedureReference) PushScope()
- func (ppr *ProcedureReference) SetVariable(name string, val interface{}, valType sql.Type) error
- func (ppr *ProcedureReference) VariableHasBeenSet(name string) bool
- type Regexp
- func (c *Regexp) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (c *Regexp) Compare(ctx *sql.Context, row sql.Row) (int, error)
- func (re *Regexp) DebugString() string
- func (re *Regexp) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (c *Regexp) Left() sql.Expression
- func (c *Regexp) Right() sql.Expression
- func (re *Regexp) String() string
- func (*Regexp) Type() sql.Type
- func (re *Regexp) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type SetField
- func (s *SetField) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (s *SetField) DebugString() string
- func (s *SetField) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (s *SetField) String() string
- func (s *SetField) Type() sql.Type
- func (s *SetField) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Sorter
- type Sorter2
- type Star
- func (*Star) Children() []sql.Expression
- func (*Star) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (*Star) Eval(ctx *sql.Context, r sql.Row) (interface{}, error)
- func (*Star) IsNullable() bool
- func (*Star) Resolved() bool
- func (s *Star) String() string
- func (*Star) Type() sql.Type
- func (s *Star) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type SystemVar
- func (v *SystemVar) Children() []sql.Expression
- func (v *SystemVar) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (v *SystemVar) Eval(ctx *sql.Context, _ sql.Row) (interface{}, error)
- func (v *SystemVar) IsNullable() bool
- func (v *SystemVar) Resolved() bool
- func (v *SystemVar) String() string
- func (v *SystemVar) Type() sql.Type
- func (v *SystemVar) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type TimeDelta
- type TopRowsHeap
- type Tuple
- func (t Tuple) Children() []sql.Expression
- func (t Tuple) DebugString() string
- func (t Tuple) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (t Tuple) IsNullable() bool
- func (t Tuple) Resolved() bool
- func (t Tuple) String() string
- func (t Tuple) Type() sql.Type
- func (t Tuple) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type UnaryExpression
- type UnaryMinus
- func (*UnaryMinus) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (e *UnaryMinus) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (e *UnaryMinus) String() string
- func (e *UnaryMinus) Type() sql.Type
- func (e *UnaryMinus) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type UnresolvedColumn
- func (*UnresolvedColumn) Children() []sql.Expression
- func (*UnresolvedColumn) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (*UnresolvedColumn) Eval(ctx *sql.Context, r sql.Row) (interface{}, error)
- func (uc *UnresolvedColumn) Eval2(ctx *sql.Context, row sql.Row2) (sql.Value, error)
- func (*UnresolvedColumn) IsNullable() bool
- func (uc *UnresolvedColumn) Name() string
- func (*UnresolvedColumn) Resolved() bool
- func (uc *UnresolvedColumn) String() string
- func (uc *UnresolvedColumn) Table() string
- func (*UnresolvedColumn) Type() sql.Type
- func (uc *UnresolvedColumn) Type2() sql.Type2
- func (uc *UnresolvedColumn) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type UnresolvedFunction
- func (uf *UnresolvedFunction) Children() []sql.Expression
- func (*UnresolvedFunction) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (uf *UnresolvedFunction) DebugString() string
- func (*UnresolvedFunction) Eval(ctx *sql.Context, r sql.Row) (interface{}, error)
- func (*UnresolvedFunction) IsNullable() bool
- func (uf *UnresolvedFunction) Name() string
- func (*UnresolvedFunction) Resolved() bool
- func (uf *UnresolvedFunction) String() string
- func (*UnresolvedFunction) Type() sql.Type
- func (uf *UnresolvedFunction) WithChildren(children ...sql.Expression) (sql.Expression, error)
- func (uf *UnresolvedFunction) WithWindow(def *sql.WindowDefinition) *UnresolvedFunction
- type UnresolvedProcedureParam
- func (*UnresolvedProcedureParam) Children() []sql.Expression
- func (*UnresolvedProcedureParam) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (upp *UnresolvedProcedureParam) Eval(ctx *sql.Context, r sql.Row) (interface{}, error)
- func (*UnresolvedProcedureParam) IsNullable() bool
- func (upp *UnresolvedProcedureParam) Name() string
- func (*UnresolvedProcedureParam) Resolved() bool
- func (upp *UnresolvedProcedureParam) String() string
- func (*UnresolvedProcedureParam) Type() sql.Type
- func (upp *UnresolvedProcedureParam) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type UnresolvedTableFunction
- func (utf UnresolvedTableFunction) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool
- func (utf *UnresolvedTableFunction) Children() []sql.Node
- func (UnresolvedTableFunction) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (utf *UnresolvedTableFunction) Database() sql.Database
- func (utf *UnresolvedTableFunction) Expressions() []sql.Expression
- func (utf *UnresolvedTableFunction) IsReadOnly() bool
- func (utf *UnresolvedTableFunction) Name() string
- func (utf *UnresolvedTableFunction) NewInstance(_ *sql.Context, _ sql.Database, _ []sql.Expression) (sql.Node, error)
- func (utf *UnresolvedTableFunction) Resolved() bool
- func (utf *UnresolvedTableFunction) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error)
- func (utf *UnresolvedTableFunction) Schema() sql.Schema
- func (utf *UnresolvedTableFunction) String() string
- func (utf *UnresolvedTableFunction) WithChildren(node ...sql.Node) (sql.Node, error)
- func (utf *UnresolvedTableFunction) WithDatabase(database sql.Database) (sql.Node, error)
- func (utf *UnresolvedTableFunction) WithExpressions(expression ...sql.Expression) (sql.Node, error)
- func (utf *UnresolvedTableFunction) WithName(s string) sql.Node
- type UserVar
- func (v *UserVar) Children() []sql.Expression
- func (v *UserVar) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (v *UserVar) Eval(ctx *sql.Context, _ sql.Row) (interface{}, error)
- func (v *UserVar) IsNullable() bool
- func (v *UserVar) Resolved() bool
- func (v *UserVar) String() string
- func (v *UserVar) Type() sql.Type
- func (v *UserVar) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Wrapper
- func (w *Wrapper) Children() []sql.Expression
- func (w *Wrapper) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (w *Wrapper) DebugString() string
- func (w *Wrapper) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (w *Wrapper) IsNullable() bool
- func (w *Wrapper) Resolved() bool
- func (w *Wrapper) String() string
- func (w *Wrapper) Type() sql.Type
- func (w *Wrapper) Unwrap() sql.Expression
- func (w *Wrapper) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type Xor
- func (*Xor) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
- func (x *Xor) DebugString() string
- func (x *Xor) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (x *Xor) String() string
- func (*Xor) Type() sql.Type
- func (x *Xor) WithChildren(children ...sql.Expression) (sql.Expression, error)
Constants ¶
const ( // ConvertToBinary is a conversion to binary. ConvertToBinary = "binary" // ConvertToChar is a conversion to char. ConvertToChar = "char" // ConvertToNChar is a conversion to nchar. ConvertToNChar = "nchar" // ConvertToDate is a conversion to date. ConvertToDate = "date" // ConvertToDatetime is a conversion to datetime. ConvertToDatetime = "datetime" // ConvertToDecimal is a conversion to decimal. ConvertToDecimal = "decimal" // ConvertToFloat is a conversion to float. ConvertToFloat = "float" // ConvertToDouble is a conversion to double. ConvertToDouble = "double" // ConvertToJSON is a conversion to json. ConvertToJSON = "json" // ConvertToReal is a conversion to double. ConvertToReal = "real" // ConvertToSigned is a conversion to signed. ConvertToSigned = "signed" // ConvertToTime is a conversion to time. ConvertToTime = "time" // ConvertToUnsigned is a conversion to unsigned. ConvertToUnsigned = "unsigned" )
const ERDivisionByZero = 1365
const IsFalseStr = "IS FALSE"
const IsTrueStr = "IS TRUE"
Variables ¶
var ( // ErrAutoIncrementUnsupported is returned when table does not support AUTO_INCREMENT. ErrAutoIncrementUnsupported = errors.NewKind("table %s does not support AUTO_INCREMENT columns") // ErrNoAutoIncrementCols is returned when table has no AUTO_INCREMENT columns. ErrNoAutoIncrementCols = errors.NewKind("table %s has no AUTO_INCREMENT columns") )
var ErrConvertExpression = errors.NewKind("expression '%v': couldn't convert to %v")
ErrConvertExpression is returned when a conversion is not possible.
var ErrIndexOutOfBounds = errors.NewKind("unable to find field with index %d in row of %d columns")
ErrIndexOutOfBounds is returned when the field index is out of the bounds.
var ErrIntDivDataOutOfRange = errors.NewKind("BIGINT value is out of range (%s DIV %s)")
var ErrInvalidOffset = errors.NewKind("offset must be a non-negative integer; found: %v")
var ErrInvalidRegexp = errors.NewKind("Invalid regular expression: %s")
var ErrNilOperand = errors.NewKind("nil operand found in comparison")
ErrNilOperand ir returned if some or both of the comparison's operands is nil.
var ErrUnresolvedTableFunction = errors.NewKind("unresolved table function")
ErrUnresolvedTableFunction is thrown when a table function cannot be resolved
var ( // ErrUnsupportedInOperand is returned when there is an invalid righthand // operand in an IN operator. ErrUnsupportedInOperand = errors.NewKind("right operand in IN operation must be tuple, but is %T") )
var FetchEOF = errors.New("exhausted fetch iterator")
FetchEOF is a special EOF error that lets the loop implementation differentiate between this io.EOF
Functions ¶
func Dispose ¶ added in v0.11.0
func Dispose(e sql.Expression)
func ExpressionsResolved ¶ added in v0.9.0
func ExpressionsResolved(exprs ...sql.Expression) bool
ExpressionsResolved returns whether all the expressions in the slice given are resolved
func GetConvertToType ¶ added in v0.18.0
GetConvertToType returns which type the both left and right values should be converted to. If neither sql.Type represent number, then converted to string. Otherwise, we try to get the appropriate type to avoid any precision loss.
func GetDecimalPrecisionAndScale ¶ added in v0.14.0
GetDecimalPrecisionAndScale returns precision and scale for given string formatted float/double number.
func GetPrecisionAndScale ¶ added in v0.15.0
GetPrecisionAndScale converts the value to string format and parses it to get the precision and scale.
func IsBinary ¶
func IsBinary(e sql.Expression) bool
IsBinary returns whether the expression is binary or not.
func IsBindVar ¶ added in v0.12.0
func IsBindVar(e sql.Expression) bool
func IsUnary ¶
func IsUnary(e sql.Expression) bool
IsUnary returns whether the expression is unary or not.
func JoinAnd ¶
func JoinAnd(exprs ...sql.Expression) sql.Expression
JoinAnd joins several expressions with And.
func JoinOr ¶ added in v0.16.0
func JoinOr(exprs ...sql.Expression) sql.Expression
JoinOr joins several expressions with Or.
func LiteralToInt ¶ added in v0.12.0
func LiteralToInt(e sql.Expression) (int, error)
LiteralToInt extracts a non-negative integer from an expression.Literal, or errors
func NewAnd ¶
func NewAnd(left, right sql.Expression) sql.Expression
NewAnd creates a new And expression.
func NewBinary ¶ added in v0.9.0
func NewBinary(e sql.Expression) sql.Expression
func NewLike ¶
func NewLike(left, right, escape sql.Expression) sql.Expression
NewLike creates a new LIKE expression.
func NewNotInTuple ¶
func NewNotInTuple(left sql.Expression, right sql.Expression) sql.Expression
NewNotInTuple creates a new NotInTuple expression.
func NewOr ¶
func NewOr(left, right sql.Expression) sql.Expression
NewOr creates a new Or expression.
func NewRangeFilterExpr ¶ added in v0.16.0
func NewRangeFilterExpr(exprs []sql.Expression, ranges []sql.Range) (sql.Expression, error)
NewRangeFilterExpr builds an expression that filters with the list of sql ranges and exprs.
Exprs is the list of expressions to filter by. Ranges is the list of ranges to check against each expr.
The length of each range must match the length of the exprs slice.
func NewSetField ¶
func NewSetField(left, expr sql.Expression) sql.Expression
NewSetField creates a new SetField expression.
func NewXor ¶ added in v0.12.0
func NewXor(left, right sql.Expression) sql.Expression
NewXor creates a new Xor expression.
func PreciseComparison ¶ added in v0.18.0
func PreciseComparison(e sql.Expression) bool
PreciseComparison searches an expression tree for comparison expressions that require a conversion or type promotion. This utility helps determine if filter predicates can be pushed down.
func SchemaToGetFields ¶ added in v0.12.0
SchemaToGetFields takes a schema and returns an expression array of GetFields. If |columns| is provided, each get field will get the appropriate expression id.
func SplitConjunction ¶ added in v0.15.0
func SplitConjunction(expr sql.Expression) []sql.Expression
SplitConjunction breaks AND expressions into their left and right parts, recursively
func SplitDisjunction ¶ added in v0.18.0
func SplitDisjunction(expr sql.Expression) []sql.Expression
SplitDisjunction breaks OR expressions into their left and right parts, recursively
func WrapExpressions ¶
func WrapExpressions(exprs ...sql.Expression) []sql.Expression
WrapExpressions takes in a number of expressions and wraps each one, returning the resulting slice. Useful for when an expression in a slice may be nil.
Types ¶
type Alias ¶
type Alias struct { UnaryExpression // contains filtered or unexported fields }
Alias is a node that gives a name to an expression.
func NewAlias ¶
func NewAlias(name string, expr sql.Expression) *Alias
NewAlias returns a new Alias node.
func (*Alias) AsUnreferencable ¶ added in v0.16.0
AsUnreferencable marks the alias outside of scope referencing
func (*Alias) CollationCoercibility ¶ added in v0.15.0
func (e *Alias) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Alias) DebugString ¶
func (*Alias) Unreferencable ¶ added in v0.16.0
func (*Alias) WithChildren ¶
func (e *Alias) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type AliasReference ¶ added in v0.14.0
type AliasReference struct {
// contains filtered or unexported fields
}
AliasReference is a named reference to an aliased expression.
func NewAliasReference ¶ added in v0.14.0
func NewAliasReference(name string) *AliasReference
NewAliasReference creates a new AliasReference from the specified alias name.
func (AliasReference) Children ¶ added in v0.14.0
func (a AliasReference) Children() []sql.Expression
func (AliasReference) CollationCoercibility ¶ added in v0.15.0
func (AliasReference) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (AliasReference) IsNullable ¶ added in v0.14.0
func (a AliasReference) IsNullable() bool
func (AliasReference) Name ¶ added in v0.14.0
func (a AliasReference) Name() string
func (AliasReference) Resolved ¶ added in v0.14.0
func (a AliasReference) Resolved() bool
func (AliasReference) String ¶ added in v0.14.0
func (a AliasReference) String() string
func (AliasReference) Table ¶ added in v0.14.0
func (a AliasReference) Table() string
func (AliasReference) Type ¶ added in v0.14.0
func (a AliasReference) Type() sql.Type
func (AliasReference) WithChildren ¶ added in v0.14.0
func (a AliasReference) WithChildren(children ...sql.Expression) (sql.Expression, error)
type And ¶
type And struct {
BinaryExpressionStub
}
And checks whether two expressions are true.
func (*And) CollationCoercibility ¶ added in v0.15.0
CollationCoercibility implements the interface sql.CollationCoercible.
func (*And) DebugString ¶
func (*And) WithChildren ¶
func (a *And) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Arithmetic ¶
type Arithmetic struct { BinaryExpressionStub Op string // contains filtered or unexported fields }
Arithmetic expressions include plus, minus and multiplication (+, -, *) operations.
func NewArithmetic ¶
func NewArithmetic(left, right sql.Expression, op string) *Arithmetic
NewArithmetic creates a new Arithmetic sql.Expression.
func NewMinus ¶
func NewMinus(left, right sql.Expression) *Arithmetic
NewMinus creates a new Arithmetic - sql.Expression.
func NewMult ¶
func NewMult(left, right sql.Expression) *Arithmetic
NewMult creates a new Arithmetic * sql.Expression.
func NewPlus ¶
func NewPlus(left, right sql.Expression) *Arithmetic
NewPlus creates a new Arithmetic + sql.Expression.
func (*Arithmetic) CollationCoercibility ¶ added in v0.15.0
func (*Arithmetic) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Arithmetic) DebugString ¶
func (a *Arithmetic) DebugString() string
func (*Arithmetic) IsNullable ¶
func (a *Arithmetic) IsNullable() bool
IsNullable implements the sql.Expression interface.
func (*Arithmetic) Operator ¶ added in v0.15.0
func (a *Arithmetic) Operator() string
func (*Arithmetic) SetOpCount ¶ added in v0.15.0
func (a *Arithmetic) SetOpCount(i int32)
func (*Arithmetic) String ¶
func (a *Arithmetic) String() string
func (*Arithmetic) Type ¶
func (a *Arithmetic) Type() sql.Type
Type returns the greatest type for given operation.
func (*Arithmetic) WithChildren ¶
func (a *Arithmetic) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type ArithmeticOp ¶ added in v0.15.0
type ArithmeticOp interface { sql.Expression BinaryExpression SetOpCount(int32) Operator() string }
ArithmeticOp implements an arithmetic expression. Since we had separate expressions for division and mod operation, we need to group all arithmetic together. Use this expression to define any arithmetic operation that is separately implemented from Arithmetic expression in the future.
type AutoIncrement ¶
type AutoIncrement struct { UnaryExpression // contains filtered or unexported fields }
AutoIncrement implements AUTO_INCREMENT
func NewAutoIncrement ¶
func NewAutoIncrement(ctx *sql.Context, table sql.Table, given sql.Expression) (*AutoIncrement, error)
NewAutoIncrement creates a new AutoIncrement expression.
func NewAutoIncrementForColumn ¶ added in v0.12.0
func NewAutoIncrementForColumn(ctx *sql.Context, table sql.Table, autoCol *sql.Column, given sql.Expression) (*AutoIncrement, error)
NewAutoIncrementForColumn creates a new AutoIncrement expression for the column given.
func (*AutoIncrement) Children ¶
func (i *AutoIncrement) Children() []sql.Expression
Children implements the Expression interface.
func (*AutoIncrement) CollationCoercibility ¶ added in v0.15.0
func (i *AutoIncrement) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*AutoIncrement) IsNullable ¶
func (i *AutoIncrement) IsNullable() bool
IsNullable implements the Expression interface.
func (*AutoIncrement) String ¶
func (i *AutoIncrement) String() string
func (*AutoIncrement) Type ¶
func (i *AutoIncrement) Type() sql.Type
Type implements the Expression interface.
func (*AutoIncrement) WithChildren ¶
func (i *AutoIncrement) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Between ¶
type Between struct { Val sql.Expression Lower sql.Expression Upper sql.Expression }
Between checks a value is between two given values.
func NewBetween ¶
func NewBetween(val, lower, upper sql.Expression) *Between
NewBetween creates a new Between expression.
func (*Between) Children ¶
func (b *Between) Children() []sql.Expression
Children implements the Expression interface.
func (*Between) CollationCoercibility ¶ added in v0.15.0
func (b *Between) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Between) DebugString ¶ added in v0.10.0
func (*Between) IsNullable ¶
IsNullable implements the Expression interface.
func (*Between) WithChildren ¶
func (b *Between) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Binary ¶ added in v0.9.0
type Binary struct {
UnaryExpression
}
The BINARY operator converts the expression to a binary string (a string that has the binary character set and binary collation). A common use for BINARY is to force a character string comparison to be done byte by byte using numeric byte values rather than character by character. The BINARY operator also causes trailing spaces in comparisons to be significant.
cc: https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html#operator_binary
func (*Binary) CollationCoercibility ¶ added in v0.15.0
func (*Binary) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Binary) WithChildren ¶ added in v0.9.0
func (b *Binary) WithChildren(children ...sql.Expression) (sql.Expression, error)
type BinaryExpression ¶
type BinaryExpression interface { sql.Expression Left() sql.Expression Right() sql.Expression }
BinaryExpression is an expression that has two children
type BinaryExpressionStub ¶ added in v0.18.0
type BinaryExpressionStub struct { LeftChild sql.Expression RightChild sql.Expression }
BinaryExpressionStub is an expression that has two children.
func (*BinaryExpressionStub) Children ¶ added in v0.18.0
func (p *BinaryExpressionStub) Children() []sql.Expression
Children implements the Expression interface.
func (*BinaryExpressionStub) IsNullable ¶ added in v0.18.0
func (p *BinaryExpressionStub) IsNullable() bool
IsNullable returns whether the expression can be null.
func (*BinaryExpressionStub) Left ¶ added in v0.18.0
func (p *BinaryExpressionStub) Left() sql.Expression
func (*BinaryExpressionStub) Resolved ¶ added in v0.18.0
func (p *BinaryExpressionStub) Resolved() bool
Resolved implements the Expression interface.
func (*BinaryExpressionStub) Right ¶ added in v0.18.0
func (p *BinaryExpressionStub) Right() sql.Expression
type BindVar ¶
func NewBindVar ¶
func (*BindVar) Children ¶
func (bv *BindVar) Children() []sql.Expression
func (*BindVar) CollationCoercibility ¶ added in v0.15.0
func (bv *BindVar) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*BindVar) IsNullable ¶
func (*BindVar) WithChildren ¶
func (bv *BindVar) WithChildren(children ...sql.Expression) (sql.Expression, error)
type BitOp ¶ added in v0.15.0
type BitOp struct { BinaryExpressionStub Op string }
BitOp expressions include BIT -AND, -OR and -XOR (&, | and ^) operations https://dev.mysql.com/doc/refman/8.0/en/bit-functions.html
func NewBitAnd ¶
func NewBitAnd(left, right sql.Expression) *BitOp
NewBitAnd creates a new BitOp & sql.Expression.
func NewBitOp ¶ added in v0.15.0
func NewBitOp(left, right sql.Expression, op string) *BitOp
NewBitOp creates a new BitOp sql.Expression.
func NewBitOr ¶
func NewBitOr(left, right sql.Expression) *BitOp
NewBitOr creates a new BitOp | sql.Expression.
func NewBitXor ¶
func NewBitXor(left, right sql.Expression) *BitOp
NewBitXor creates a new BitOp ^ sql.Expression.
func NewShiftLeft ¶
func NewShiftLeft(left, right sql.Expression) *BitOp
NewShiftLeft creates a new BitOp << sql.Expression.
func NewShiftRight ¶
func NewShiftRight(left, right sql.Expression) *BitOp
NewShiftRight creates a new BitOp >> sql.Expression.
func (*BitOp) CollationCoercibility ¶ added in v0.15.0
func (*BitOp) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*BitOp) DebugString ¶ added in v0.15.0
func (*BitOp) IsNullable ¶ added in v0.15.0
IsNullable implements the sql.Expression interface.
func (*BitOp) WithChildren ¶ added in v0.15.0
func (b *BitOp) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Case ¶
type Case struct { Expr sql.Expression Branches []CaseBranch Else sql.Expression }
Case is an expression that returns the value of one of its branches when a condition is met.
func NewCase ¶
func NewCase(expr sql.Expression, branches []CaseBranch, elseExpr sql.Expression) *Case
NewCase returns an new Case expression.
func (*Case) Children ¶
func (c *Case) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*Case) CollationCoercibility ¶ added in v0.15.0
func (c *Case) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Case) DebugString ¶ added in v0.10.0
func (*Case) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (*Case) WithChildren ¶
func (c *Case) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type CaseBranch ¶
type CaseBranch struct { Cond sql.Expression Value sql.Expression }
CaseBranch is a single branch of a case expression.
type CollatedExpression ¶ added in v0.14.0
type CollatedExpression struct {
// contains filtered or unexported fields
}
CollatedExpression represents an expression (returning a string or byte slice) that carries a collation (which implicitly also carries a character set). This does not handle any encoding or decoding of the character set, as this is strictly for collations.
func NewCollatedExpression ¶ added in v0.14.0
func NewCollatedExpression(expr sql.Expression, collation sql.CollationID) *CollatedExpression
NewCollatedExpression creates a new CollatedExpression expression. If the given expression is already a CollatedExpression, then the previous collation is overriden with the given one.
func (*CollatedExpression) Child ¶ added in v0.14.0
func (ce *CollatedExpression) Child() sql.Expression
Child returns the inner expression.
func (*CollatedExpression) Children ¶ added in v0.14.0
func (ce *CollatedExpression) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*CollatedExpression) CollationCoercibility ¶ added in v0.15.0
func (ce *CollatedExpression) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*CollatedExpression) DebugString ¶ added in v0.14.0
func (ce *CollatedExpression) DebugString() string
DebugString implements the sql.DebugStringer interface.
func (*CollatedExpression) IsNullable ¶ added in v0.14.0
func (ce *CollatedExpression) IsNullable() bool
IsNullable implements the sql.Expression interface.
func (*CollatedExpression) Resolved ¶ added in v0.14.0
func (ce *CollatedExpression) Resolved() bool
Resolved implements the sql.Expression interface.
func (*CollatedExpression) String ¶ added in v0.14.0
func (ce *CollatedExpression) String() string
func (*CollatedExpression) Type ¶ added in v0.14.0
func (ce *CollatedExpression) Type() sql.Type
Type implements the sql.Expression interface.
func (*CollatedExpression) WithChildren ¶ added in v0.14.0
func (ce *CollatedExpression) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the sql.Expression interface.
type Comparer ¶
type Comparer interface { sql.Expression Compare(ctx *sql.Context, row sql.Row) (int, error) Left() sql.Expression Right() sql.Expression }
Comparer implements a comparison expression.
type Convert ¶
type Convert struct { UnaryExpression // contains filtered or unexported fields }
Convert represent a CAST(x AS T) or CONVERT(x, T) operation that casts x expression to type T.
func NewConvert ¶
func NewConvert(expr sql.Expression, castToType string) *Convert
NewConvert creates a new Convert expression that will attempt to convert the specified expression |expr| into the |castToType| type. All optional parameters (i.e. typeLength, typeScale, and charset) are omitted and initialized to their zero values.
func NewConvertWithLengthAndScale ¶ added in v0.16.0
func NewConvertWithLengthAndScale(expr sql.Expression, castToType string, typeLength, typeScale int) *Convert
NewConvertWithLengthAndScale creates a new Convert expression that will attempt to convert |expr| into the |castToType| type, with |typeLength| specifying a length constraint of the converted type, and |typeScale| specifying a scale constraint of the converted type.
func (*Convert) CollationCoercibility ¶ added in v0.15.0
func (c *Convert) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Convert) DebugString ¶ added in v0.15.0
DebugString implements the Expression interface.
func (*Convert) IsNullable ¶
IsNullable implements the Expression interface.
func (*Convert) WithChildren ¶
func (c *Convert) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type ConvertUsing ¶ added in v0.18.0
type ConvertUsing struct { UnaryExpression TargetCharSet sql.CharacterSetID }
ConvertUsing represents a CONVERT(X USING T) operation that casts the expression X to the character set T.
func NewConvertUsing ¶ added in v0.18.0
func NewConvertUsing(expr sql.Expression, targetCharSet sql.CharacterSetID) *ConvertUsing
func (*ConvertUsing) CollationCoercibility ¶ added in v0.18.0
func (c *ConvertUsing) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*ConvertUsing) String ¶ added in v0.18.0
func (c *ConvertUsing) String() string
String implements the interface sql.Expression.
func (*ConvertUsing) Type ¶ added in v0.18.0
func (c *ConvertUsing) Type() sql.Type
Type implements the interface sql.Expression.
func (*ConvertUsing) WithChildren ¶ added in v0.18.0
func (c *ConvertUsing) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the interface sql.Expression.
type DeclareHandlerAction ¶ added in v0.18.0
type DeclareHandlerAction byte
const ( DeclareHandlerAction_Continue DeclareHandlerAction = iota DeclareHandlerAction_Exit DeclareHandlerAction_Undo )
type DefaultColumn ¶
type DefaultColumn struct {
// contains filtered or unexported fields
}
DefaultColumn is a default expression of a column that is not yet resolved.
func NewDefaultColumn ¶
func NewDefaultColumn(name string) *DefaultColumn
NewDefaultColumn creates a new NewDefaultColumn expression.
func (*DefaultColumn) Children ¶
func (*DefaultColumn) Children() []sql.Expression
Children implements the sql.Expression interface. The function returns always nil
func (*DefaultColumn) CollationCoercibility ¶ added in v0.15.0
func (*DefaultColumn) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*DefaultColumn) Eval ¶
Eval implements the sql.Expression interface. The function always panics!
func (*DefaultColumn) IsNullable ¶
func (*DefaultColumn) IsNullable() bool
IsNullable implements the sql.Expression interface. The function always panics!
func (*DefaultColumn) Name ¶
func (c *DefaultColumn) Name() string
Name implements the sql.Nameable interface.
func (*DefaultColumn) Resolved ¶
func (*DefaultColumn) Resolved() bool
Resolved implements the sql.Expression interface. The function returns always false
func (*DefaultColumn) String ¶
func (c *DefaultColumn) String() string
String implements the Stringer The function returns column's name (can be an empty string)
func (*DefaultColumn) Type ¶
func (*DefaultColumn) Type() sql.Type
Type implements the sql.Expression interface. The function always panics!
func (*DefaultColumn) WithChildren ¶
func (c *DefaultColumn) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type DistinctExpression ¶ added in v0.10.0
type DistinctExpression struct { Child sql.Expression // contains filtered or unexported fields }
func NewDistinctExpression ¶ added in v0.10.0
func NewDistinctExpression(e sql.Expression) *DistinctExpression
func (*DistinctExpression) Children ¶ added in v0.10.0
func (de *DistinctExpression) Children() []sql.Expression
func (*DistinctExpression) CollationCoercibility ¶ added in v0.15.0
func (de *DistinctExpression) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*DistinctExpression) Dispose ¶ added in v0.10.0
func (de *DistinctExpression) Dispose()
func (*DistinctExpression) Eval ¶ added in v0.10.0
Returns the child value if the cache hasn't seen the value before otherwise returns nil. Since NULLs are ignored in aggregate expressions that use DISTINCT this is a valid return scheme.
func (*DistinctExpression) IsNullable ¶ added in v0.10.0
func (de *DistinctExpression) IsNullable() bool
func (*DistinctExpression) Resolved ¶ added in v0.10.0
func (de *DistinctExpression) Resolved() bool
func (*DistinctExpression) String ¶ added in v0.10.0
func (de *DistinctExpression) String() string
func (*DistinctExpression) Type ¶ added in v0.10.0
func (de *DistinctExpression) Type() sql.Type
func (*DistinctExpression) WithChildren ¶ added in v0.10.0
func (de *DistinctExpression) WithChildren(children ...sql.Expression) (sql.Expression, error)
type Div ¶ added in v0.15.0
type Div struct { BinaryExpressionStub // contains filtered or unexported fields }
Div expression represents "/" arithmetic operation
func NewDiv ¶
func NewDiv(left, right sql.Expression) *Div
NewDiv creates a new Div / sql.Expression.
func (*Div) CollationCoercibility ¶ added in v0.15.0
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Div) DebugString ¶ added in v0.15.0
func (*Div) IsNullable ¶ added in v0.15.0
IsNullable implements the sql.Expression interface.
func (*Div) SetOpCount ¶ added in v0.15.0
func (*Div) Type ¶ added in v0.15.0
Type returns the result type for this division expression. For nested division expressions, we prefer sending the result back as a float when possible, since division with floats is more efficient than division with Decimals. However, if this is the outermost division expression in an expression tree, we must return the result as a Decimal type in order to match MySQL's results exactly.
func (*Div) WithChildren ¶ added in v0.15.0
func (d *Div) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Equals ¶
type Equals struct {
// contains filtered or unexported fields
}
Equals is a comparison that checks an expression is equal to another.
func NewEquals ¶
func NewEquals(left sql.Expression, right sql.Expression) *Equals
NewEquals returns a new Equals expression.
func (*Equals) CollationCoercibility ¶ added in v0.15.0
func (e *Equals) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Equals) Compare ¶
Compare the two given values using the types of the expressions in the comparison. Since both types should be equal, it does not matter which type is used, but for reference, the left type is always used.
func (*Equals) DebugString ¶
func (*Equals) WithChildren ¶
func (e *Equals) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type GetField ¶
type GetField struct {
// contains filtered or unexported fields
}
GetField is an expression to get the field of a table.
func ExtractGetField ¶ added in v0.12.0
func ExtractGetField(e sql.Expression) *GetField
ExtractGetField returns the inner GetField expression from another expression. If there are multiple GetField expressions that are not the same, then none of the GetField expressions are returned.
func NewGetField ¶
NewGetField creates a GetField expression.
func NewGetFieldWithTable ¶
func NewGetFieldWithTable(index, tableId int, fieldType sql.Type, db, table, fieldName string, nullable bool) *GetField
NewGetFieldWithTable creates a GetField expression with table name. The table name may be an alias.
func (*GetField) Children ¶
func (*GetField) Children() []sql.Expression
Children implements the Expression interface.
func (*GetField) CollationCoercibility ¶ added in v0.15.0
func (p *GetField) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*GetField) DebugString ¶
func (*GetField) Index ¶
Index returns the index where the GetField will look for the value from a sql.Row.
func (*GetField) IsBackTickNames ¶ added in v0.18.0
IsBackTickNames returns whether the field name should be quoted with backticks.
func (*GetField) IsNullable ¶
IsNullable returns whether the field is nullable or not.
func (*GetField) Type2 ¶ added in v0.12.0
Type2 returns the type of the field, if this field has a sql.Type2.
func (*GetField) WithBackTickNames ¶ added in v0.18.0
WithBackTickNames returns a copy of this expression with the backtick names flag set to the given value.
func (*GetField) WithChildren ¶
func (p *GetField) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
func (*GetField) WithId ¶ added in v0.18.0
func (p *GetField) WithId(id sql.ColumnId) sql.IdExpression
func (*GetField) WithIndex ¶
func (p *GetField) WithIndex(n int) sql.Expression
WithIndex returns this same GetField with a new index.
type GreaterThan ¶
type GreaterThan struct {
// contains filtered or unexported fields
}
GreaterThan is a comparison that checks an expression is greater than another.
func NewGreaterThan ¶
func NewGreaterThan(left sql.Expression, right sql.Expression) *GreaterThan
NewGreaterThan creates a new GreaterThan expression.
func (*GreaterThan) CollationCoercibility ¶ added in v0.15.0
func (gt *GreaterThan) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*GreaterThan) Compare ¶
Compare the two given values using the types of the expressions in the comparison. Since both types should be equal, it does not matter which type is used, but for reference, the left type is always used.
func (*GreaterThan) DebugString ¶
func (gt *GreaterThan) DebugString() string
func (*GreaterThan) Left ¶
func (c *GreaterThan) Left() sql.Expression
Left implements Comparer interface
func (*GreaterThan) Right ¶
func (c *GreaterThan) Right() sql.Expression
Right implements Comparer interface
func (*GreaterThan) String ¶
func (gt *GreaterThan) String() string
func (*GreaterThan) WithChildren ¶
func (gt *GreaterThan) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type GreaterThanOrEqual ¶
type GreaterThanOrEqual struct {
// contains filtered or unexported fields
}
GreaterThanOrEqual is a comparison that checks an expression is greater or equal to another.
func NewGreaterThanOrEqual ¶
func NewGreaterThanOrEqual(left sql.Expression, right sql.Expression) *GreaterThanOrEqual
NewGreaterThanOrEqual creates a new GreaterThanOrEqual
func (*GreaterThanOrEqual) CollationCoercibility ¶ added in v0.15.0
func (gte *GreaterThanOrEqual) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*GreaterThanOrEqual) Compare ¶
Compare the two given values using the types of the expressions in the comparison. Since both types should be equal, it does not matter which type is used, but for reference, the left type is always used.
func (*GreaterThanOrEqual) DebugString ¶
func (gte *GreaterThanOrEqual) DebugString() string
func (*GreaterThanOrEqual) Left ¶
func (c *GreaterThanOrEqual) Left() sql.Expression
Left implements Comparer interface
func (*GreaterThanOrEqual) Right ¶
func (c *GreaterThanOrEqual) Right() sql.Expression
Right implements Comparer interface
func (*GreaterThanOrEqual) String ¶
func (gte *GreaterThanOrEqual) String() string
func (*GreaterThanOrEqual) WithChildren ¶
func (gte *GreaterThanOrEqual) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type HandlerCondition ¶ added in v0.18.0
type HandlerCondition struct { SqlStatePrefix string Type HandlerConditionType }
func (*HandlerCondition) Matches ¶ added in v0.18.0
func (c *HandlerCondition) Matches(err error) bool
type HandlerConditionType ¶ added in v0.18.0
type HandlerConditionType uint8
const ( HandlerConditionUnknown HandlerConditionType = iota HandlerConditionNotFound HandlerConditionSqlException )
type HashInTuple ¶ added in v0.12.0
type HashInTuple struct {
// contains filtered or unexported fields
}
HashInTuple is an expression that checks an expression is inside a list of expressions using a hashmap.
func NewHashInTuple ¶ added in v0.12.0
func NewHashInTuple(ctx *sql.Context, left, right sql.Expression) (*HashInTuple, error)
NewHashInTuple creates an InTuple expression.
func (*HashInTuple) Children ¶ added in v0.18.0
func (hit *HashInTuple) Children() []sql.Expression
func (*HashInTuple) CollationCoercibility ¶ added in v0.18.0
func (hit *HashInTuple) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
func (*HashInTuple) DebugString ¶ added in v0.12.0
func (hit *HashInTuple) DebugString() string
func (*HashInTuple) IsNullable ¶ added in v0.18.0
func (hit *HashInTuple) IsNullable() bool
func (*HashInTuple) Left ¶ added in v0.18.0
func (hit *HashInTuple) Left() sql.Expression
func (*HashInTuple) Resolved ¶ added in v0.18.0
func (hit *HashInTuple) Resolved() bool
func (*HashInTuple) Right ¶ added in v0.18.0
func (hit *HashInTuple) Right() sql.Expression
func (*HashInTuple) String ¶ added in v0.12.0
func (hit *HashInTuple) String() string
func (*HashInTuple) Type ¶ added in v0.18.0
func (hit *HashInTuple) Type() sql.Type
func (*HashInTuple) WithChildren ¶ added in v0.18.0
func (hit *HashInTuple) WithChildren(children ...sql.Expression) (sql.Expression, error)
type InTuple ¶
type InTuple struct {
BinaryExpressionStub
}
InTuple is an expression that checks an expression is inside a list of expressions.
func NewInTuple ¶
func NewInTuple(left sql.Expression, right sql.Expression) *InTuple
NewInTuple creates an InTuple expression.
func (*InTuple) Children ¶
func (in *InTuple) Children() []sql.Expression
Children implements the Expression interface.
func (*InTuple) CollationCoercibility ¶ added in v0.15.0
func (*InTuple) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*InTuple) DebugString ¶
func (*InTuple) Left ¶
func (in *InTuple) Left() sql.Expression
func (*InTuple) Right ¶
func (in *InTuple) Right() sql.Expression
func (*InTuple) WithChildren ¶
func (in *InTuple) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type IntDiv ¶ added in v0.15.0
type IntDiv struct { BinaryExpressionStub // contains filtered or unexported fields }
IntDiv expression represents integer "div" arithmetic operation
func NewIntDiv ¶
func NewIntDiv(left, right sql.Expression) *IntDiv
NewIntDiv creates a new IntDiv 'div' sql.Expression.
func (*IntDiv) CollationCoercibility ¶ added in v0.15.0
func (*IntDiv) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*IntDiv) DebugString ¶ added in v0.15.0
func (*IntDiv) IsNullable ¶ added in v0.15.0
IsNullable implements the sql.Expression interface.
func (*IntDiv) SetOpCount ¶ added in v0.15.0
func (*IntDiv) WithChildren ¶ added in v0.15.0
func (i *IntDiv) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Interval ¶
type Interval struct { UnaryExpression Unit string }
Interval defines a time duration.
func NewInterval ¶
func NewInterval(child sql.Expression, unit string) *Interval
NewInterval creates a new interval expression.
func (*Interval) CollationCoercibility ¶ added in v0.15.0
func (*Interval) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Interval) EvalDelta ¶
EvalDelta evaluates the expression returning a TimeDelta. This method should be used instead of Eval, as this expression returns a TimeDelta, which is not a valid value that can be returned in Eval.
func (*Interval) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (*Interval) WithChildren ¶
func (i *Interval) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type IsNull ¶
type IsNull struct {
UnaryExpression
}
IsNull is an expression that checks if an expression is null.
func NewIsNull ¶
func NewIsNull(child sql.Expression) *IsNull
NewIsNull creates a new IsNull expression.
func (*IsNull) CollationCoercibility ¶ added in v0.15.0
func (*IsNull) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (IsNull) DebugString ¶
func (*IsNull) IsNullable ¶
IsNullable implements the Expression interface.
func (*IsNull) WithChildren ¶
func (e *IsNull) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type IsTrue ¶
type IsTrue struct { UnaryExpression // contains filtered or unexported fields }
IsTrue is an expression that checks if an expression is true.
func NewIsFalse ¶
func NewIsFalse(child sql.Expression) *IsTrue
NewIsFalse creates a new IsTrue expression with its boolean sense inverted (IsFalse, effectively).
func NewIsTrue ¶
func NewIsTrue(child sql.Expression) *IsTrue
NewIsTrue creates a new IsTrue expression.
func (*IsTrue) CollationCoercibility ¶ added in v0.15.0
func (*IsTrue) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*IsTrue) IsNullable ¶
IsNullable implements the Expression interface.
func (*IsTrue) WithChildren ¶
func (e *IsTrue) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type LessThan ¶
type LessThan struct {
// contains filtered or unexported fields
}
LessThan is a comparison that checks an expression is less than another.
func NewLessThan ¶
func NewLessThan(left sql.Expression, right sql.Expression) *LessThan
NewLessThan creates a new LessThan expression.
func (*LessThan) CollationCoercibility ¶ added in v0.15.0
func (lt *LessThan) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*LessThan) Compare ¶
Compare the two given values using the types of the expressions in the comparison. Since both types should be equal, it does not matter which type is used, but for reference, the left type is always used.
func (*LessThan) DebugString ¶
func (*LessThan) Right ¶
func (c *LessThan) Right() sql.Expression
Right implements Comparer interface
func (*LessThan) WithChildren ¶
func (lt *LessThan) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type LessThanOrEqual ¶
type LessThanOrEqual struct {
// contains filtered or unexported fields
}
LessThanOrEqual is a comparison that checks an expression is equal or lower than another.
func NewLessThanOrEqual ¶
func NewLessThanOrEqual(left sql.Expression, right sql.Expression) *LessThanOrEqual
NewLessThanOrEqual creates a LessThanOrEqual expression.
func (*LessThanOrEqual) CollationCoercibility ¶ added in v0.15.0
func (lte *LessThanOrEqual) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*LessThanOrEqual) Compare ¶
Compare the two given values using the types of the expressions in the comparison. Since both types should be equal, it does not matter which type is used, but for reference, the left type is always used.
func (*LessThanOrEqual) DebugString ¶
func (lte *LessThanOrEqual) DebugString() string
func (*LessThanOrEqual) Left ¶
func (c *LessThanOrEqual) Left() sql.Expression
Left implements Comparer interface
func (*LessThanOrEqual) Right ¶
func (c *LessThanOrEqual) Right() sql.Expression
Right implements Comparer interface
func (*LessThanOrEqual) String ¶
func (lte *LessThanOrEqual) String() string
func (*LessThanOrEqual) WithChildren ¶
func (lte *LessThanOrEqual) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Like ¶
type Like struct { BinaryExpressionStub Escape sql.Expression // contains filtered or unexported fields }
Like performs pattern matching against two strings.
func (*Like) CollationCoercibility ¶ added in v0.15.0
func (l *Like) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Like) WithChildren ¶
func (l *Like) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type LikeMatcher ¶ added in v0.14.0
type LikeMatcher struct {
// contains filtered or unexported fields
}
LikeMatcher is a collation-supported matcher for LIKE expressions.
func ConstructLikeMatcher ¶ added in v0.14.0
func ConstructLikeMatcher(collation sql.CollationID, pattern string, escape rune) (LikeMatcher, error)
ConstructLikeMatcher returns a new LikeMatcher.
func (LikeMatcher) Match ¶ added in v0.14.0
func (l LikeMatcher) Match(s string) bool
Match returns whether the given string conforms to the nodes contained in this matcher.
func (LikeMatcher) String ¶ added in v0.14.0
func (l LikeMatcher) String() string
String returns the string form of this LIKE expression. If an Escape character was provided, it is used instead of the default.
type Literal ¶
type Literal struct {
// contains filtered or unexported fields
}
Literal represents a literal expression (string, number, bool, ...).
func NewLiteral ¶
NewLiteral creates a new Literal expression.
func (*Literal) Children ¶
func (*Literal) Children() []sql.Expression
Children implements the Expression interface.
func (*Literal) CollationCoercibility ¶ added in v0.15.0
func (lit *Literal) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Literal) DebugString ¶
func (*Literal) IsNullable ¶
IsNullable implements the Expression interface.
func (*Literal) WithChildren ¶
func (lit *Literal) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type MatchAgainst ¶ added in v0.17.0
type MatchAgainst struct { Columns []sql.Expression Expr sql.Expression SearchModifier fulltext.SearchModifier KeyCols fulltext.KeyColumns ParentTable sql.IndexAddressableTable ConfigTable sql.IndexAddressableTable PositionTable sql.IndexAddressableTable DocCountTable sql.IndexAddressableTable GlobalCountTable sql.IndexAddressableTable RowCountTable sql.IndexAddressableTable // contains filtered or unexported fields }
MatchAgainst reads from the tables that create a Full-Text index, and returns a relevancy for each row that is passed into it. Within the context of a filter, these relevancy values will be used to filter out rows, as a relevancy > 0 is a match. Within the context of a SELECT expression, the relevancy value is returned as-is. An index may use the tables provided by the expression to reduce the searchable set of tables, however this is performed as a separate step that is not directly tied to this expression. This expression's purpose is solely to calculate relevancy values.
func NewMatchAgainst ¶ added in v0.17.0
func NewMatchAgainst(columns []sql.Expression, expr sql.Expression, searchModifier fulltext.SearchModifier) *MatchAgainst
NewMatchAgainst creates a new *MatchAgainst expression.
func (*MatchAgainst) Children ¶ added in v0.17.0
func (expr *MatchAgainst) Children() []sql.Expression
Children implements sql.Expression
func (*MatchAgainst) ColumnsAsGetFields ¶ added in v0.17.0
func (expr *MatchAgainst) ColumnsAsGetFields() []*GetField
ColumnsAsGetFields returns the columns as *GetField expressions. If the columns have not yet been resolved, then this returns a nil (empty) slice.
func (*MatchAgainst) GetIndex ¶ added in v0.17.0
func (expr *MatchAgainst) GetIndex() fulltext.Index
GetIndex returns the relevant Full-Text index for this expression, or nil if it has not yet been set.
func (*MatchAgainst) IsNullable ¶ added in v0.17.0
func (expr *MatchAgainst) IsNullable() bool
IsNullable implements sql.Expression
func (*MatchAgainst) Resolved ¶ added in v0.17.0
func (expr *MatchAgainst) Resolved() bool
Resolved implements sql.Expression
func (*MatchAgainst) SetIndex ¶ added in v0.17.0
func (expr *MatchAgainst) SetIndex(fulltextIndex fulltext.Index)
SetIndex sets the index for this expression. This does not create and return a new expression, which differs from the "With" functions.
func (*MatchAgainst) String ¶ added in v0.17.0
func (expr *MatchAgainst) String() string
String implements sql.Expression
func (*MatchAgainst) Type ¶ added in v0.17.0
func (expr *MatchAgainst) Type() sql.Type
Type implements sql.Expression
func (*MatchAgainst) WithChildren ¶ added in v0.17.0
func (expr *MatchAgainst) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements sql.Expression
func (*MatchAgainst) WithInfo ¶ added in v0.17.0
func (expr *MatchAgainst) WithInfo(parent, config, position, docCount, globalCount, rowCount sql.IndexAddressableTable, keyCols fulltext.KeyColumns) *MatchAgainst
WithInfo returns a new *MatchAgainst with the given tables and other needed information to perform matching.
type Mod ¶ added in v0.15.0
type Mod struct { BinaryExpressionStub // contains filtered or unexported fields }
Mod expression represents "%" arithmetic operation
func (*Mod) CollationCoercibility ¶ added in v0.15.0
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Mod) DebugString ¶ added in v0.15.0
func (*Mod) Description ¶ added in v0.18.0
func (*Mod) FunctionName ¶ added in v0.18.0
func (*Mod) IsNullable ¶ added in v0.15.0
IsNullable implements the sql.Expression interface.
func (*Mod) SetOpCount ¶ added in v0.15.0
func (*Mod) WithChildren ¶ added in v0.15.0
func (m *Mod) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type NamedLiteral ¶ added in v0.14.0
NamedLiteral represents a literal value, but returns the name field rather than the value for String.
func NewNamedLiteral ¶ added in v0.14.0
func NewNamedLiteral(name string, value interface{}, fieldType sql.Type) NamedLiteral
NewNamedLiteral returns a new NamedLiteral.
func (NamedLiteral) String ¶ added in v0.14.0
func (lit NamedLiteral) String() string
String implements the interface sql.Expression.
type NaryExpression ¶
type NaryExpression struct {
ChildExpressions []sql.Expression
}
func (*NaryExpression) Children ¶
func (n *NaryExpression) Children() []sql.Expression
Children implements the Expression interface.
func (*NaryExpression) IsNullable ¶
func (n *NaryExpression) IsNullable() bool
IsNullable returns whether the expression can be null.
func (*NaryExpression) Resolved ¶
func (n *NaryExpression) Resolved() bool
Resolved implements the Expression interface.
type Not ¶
type Not struct {
UnaryExpression
}
Not is a node that negates an expression.
func (*Not) CollationCoercibility ¶ added in v0.15.0
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Not) DebugString ¶
func (*Not) WithChildren ¶
func (e *Not) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type NullSafeEquals ¶ added in v0.9.0
type NullSafeEquals struct {
// contains filtered or unexported fields
}
NullSafeEquals is a comparison that checks an expression is equal to another, where NULLs do not coalesce to NULL and two NULLs compare equal to each other.
func NewNullSafeEquals ¶ added in v0.9.0
func NewNullSafeEquals(left sql.Expression, right sql.Expression) *NullSafeEquals
NewNullSafeEquals returns a new NullSafeEquals expression.
func (*NullSafeEquals) CollationCoercibility ¶ added in v0.15.0
func (e *NullSafeEquals) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*NullSafeEquals) DebugString ¶ added in v0.9.0
func (e *NullSafeEquals) DebugString() string
func (*NullSafeEquals) Left ¶ added in v0.9.0
func (c *NullSafeEquals) Left() sql.Expression
Left implements Comparer interface
func (*NullSafeEquals) Right ¶ added in v0.9.0
func (c *NullSafeEquals) Right() sql.Expression
Right implements Comparer interface
func (*NullSafeEquals) String ¶ added in v0.9.0
func (e *NullSafeEquals) String() string
func (*NullSafeEquals) Type ¶ added in v0.9.0
func (e *NullSafeEquals) Type() sql.Type
Type implements the Expression interface.
func (*NullSafeEquals) WithChildren ¶ added in v0.9.0
func (e *NullSafeEquals) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Or ¶
type Or struct {
BinaryExpressionStub
}
Or checks whether one of the two given expressions is true.
func (*Or) CollationCoercibility ¶ added in v0.15.0
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Or) DebugString ¶ added in v0.10.0
func (*Or) WithChildren ¶
func (o *Or) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type ProcedureParam ¶ added in v0.9.0
type ProcedureParam struct {
// contains filtered or unexported fields
}
ProcedureParam represents the parameter of a stored procedure or stored function.
func NewProcedureParam ¶ added in v0.9.0
func NewProcedureParam(name string, typ sql.Type) *ProcedureParam
NewProcedureParam creates a new ProcedureParam expression.
func (*ProcedureParam) Children ¶ added in v0.9.0
func (*ProcedureParam) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*ProcedureParam) CollationCoercibility ¶ added in v0.15.0
func (pp *ProcedureParam) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the sql.CollationCoercible interface.
func (*ProcedureParam) IsNullable ¶ added in v0.9.0
func (*ProcedureParam) IsNullable() bool
IsNullable implements the sql.Expression interface.
func (*ProcedureParam) Name ¶ added in v0.9.0
func (pp *ProcedureParam) Name() string
Name implements the Nameable interface.
func (*ProcedureParam) Resolved ¶ added in v0.9.0
func (*ProcedureParam) Resolved() bool
Resolved implements the sql.Expression interface.
func (*ProcedureParam) Set ¶ added in v0.9.0
func (pp *ProcedureParam) Set(val interface{}, valType sql.Type) error
Set sets the value of this procedure parameter to the given value.
func (*ProcedureParam) String ¶ added in v0.9.0
func (pp *ProcedureParam) String() string
String implements the sql.Expression interface.
func (*ProcedureParam) Type ¶ added in v0.9.0
func (pp *ProcedureParam) Type() sql.Type
Type implements the sql.Expression interface.
func (*ProcedureParam) WithChildren ¶ added in v0.9.0
func (pp *ProcedureParam) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the sql.Expression interface.
func (*ProcedureParam) WithParamReference ¶ added in v0.9.0
func (pp *ProcedureParam) WithParamReference(pRef *ProcedureReference) *ProcedureParam
WithParamReference returns a new *ProcedureParam containing the given *ProcedureReference.
type ProcedureReferencable ¶ added in v0.15.0
type ProcedureReferencable interface {
WithParamReference(pRef *ProcedureReference) sql.Node
}
ProcedureReferencable indicates that a sql.Node takes a *ProcedureReference returns a new copy with the reference set.
type ProcedureReference ¶ added in v0.15.0
type ProcedureReference struct { InnermostScope *procedureScope // contains filtered or unexported fields }
ProcedureReference contains the state for a single CALL statement of a stored procedure.
func NewProcedureReference ¶ added in v0.15.0
func NewProcedureReference() *ProcedureReference
func (*ProcedureReference) CloseAllCursors ¶ added in v0.15.0
func (ppr *ProcedureReference) CloseAllCursors(ctx *sql.Context) error
CloseAllCursors closes all cursors that are still open.
func (*ProcedureReference) CloseCursor ¶ added in v0.15.0
func (ppr *ProcedureReference) CloseCursor(ctx *sql.Context, name string) error
CloseCursor closes the designated cursor.
func (*ProcedureReference) CurrentHeight ¶ added in v0.15.0
func (ppr *ProcedureReference) CurrentHeight() int
CurrentHeight returns the current height of the scope stack.
func (*ProcedureReference) FetchCursor ¶ added in v0.15.0
func (ppr *ProcedureReference) FetchCursor(ctx *sql.Context, name string) (sql.Row, sql.Schema, error)
FetchCursor returns the next row from the designated cursor.
func (*ProcedureReference) GetVariableType ¶ added in v0.15.0
func (ppr *ProcedureReference) GetVariableType(name string) sql.Type
GetVariableType returns the type of the given parameter. Returns the NULL type if the type cannot be found.
func (*ProcedureReference) GetVariableValue ¶ added in v0.15.0
func (ppr *ProcedureReference) GetVariableValue(name string) (interface{}, error)
GetVariableValue returns the value of the given parameter.
func (*ProcedureReference) InitializeCursor ¶ added in v0.15.0
func (ppr *ProcedureReference) InitializeCursor(name string, selectStmt sql.Node)
InitializeCursor sets the initial state for the cursor.
func (*ProcedureReference) InitializeHandler ¶ added in v0.15.0
func (ppr *ProcedureReference) InitializeHandler(stmt sql.Node, action DeclareHandlerAction, cond HandlerCondition)
InitializeHandler sets the given handler's statement.
func (*ProcedureReference) InitializeVariable ¶ added in v0.15.0
func (ppr *ProcedureReference) InitializeVariable(name string, sqlType sql.Type, val interface{}) error
InitializeVariable sets the initial value for the variable.
func (*ProcedureReference) PopScope ¶ added in v0.15.0
func (ppr *ProcedureReference) PopScope(ctx *sql.Context) error
PopScope removes the innermost scope, returning to its parent. Also closes all open cursors.
func (*ProcedureReference) PushScope ¶ added in v0.15.0
func (ppr *ProcedureReference) PushScope()
PushScope creates a new scope inside the current one.
func (*ProcedureReference) SetVariable ¶ added in v0.15.0
func (ppr *ProcedureReference) SetVariable(name string, val interface{}, valType sql.Type) error
SetVariable updates the value of the given parameter.
func (*ProcedureReference) VariableHasBeenSet ¶ added in v0.15.0
func (ppr *ProcedureReference) VariableHasBeenSet(name string) bool
VariableHasBeenSet returns whether the parameter has had its value altered from the initial value.
type Regexp ¶
type Regexp struct {
// contains filtered or unexported fields
}
Regexp is a comparison that checks an expression matches a regexp.
func NewRegexp ¶
func NewRegexp(left sql.Expression, right sql.Expression) *Regexp
NewRegexp creates a new Regexp expression.
func (*Regexp) CollationCoercibility ¶ added in v0.15.0
func (c *Regexp) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Regexp) Compare ¶
Compare the two given values using the types of the expressions in the comparison. Since both types should be equal, it does not matter which type is used, but for reference, the left type is always used.
func (*Regexp) DebugString ¶
func (*Regexp) WithChildren ¶
func (re *Regexp) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type SetField ¶
type SetField struct {
BinaryExpressionStub
}
SetField updates the value of a field or a system variable
func (*SetField) CollationCoercibility ¶ added in v0.15.0
func (s *SetField) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*SetField) DebugString ¶
func (*SetField) Eval ¶
Eval implements the Expression interface. Returns a copy of the given row with an updated value.
func (*SetField) WithChildren ¶
func (s *SetField) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Sorter ¶ added in v0.9.0
Sorter is a sorter implementation for Row slices using SortFields for the comparison
type Star ¶
type Star struct {
Table string
}
Star represents the selection of all available fields. This is just a placeholder node, it will not actually be evaluated but converted to a series of GetFields when the query is analyzed.
func NewQualifiedStar ¶
NewQualifiedStar returns a new star expression only for a specific table.
func (*Star) Children ¶
func (*Star) Children() []sql.Expression
Children implements the Expression interface.
func (*Star) CollationCoercibility ¶ added in v0.15.0
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Star) IsNullable ¶
IsNullable implements the Expression interface.
func (*Star) WithChildren ¶
func (s *Star) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type SystemVar ¶
type SystemVar struct { Name string Collation sql.CollationID Scope sql.SystemVariableScope SpecifiedScope string }
SystemVar is an expression that returns the value of a system variable. It's also used as the expression on the left hand side of a SET statement for a system variable.
func NewSystemVar ¶
func NewSystemVar(name string, scope sql.SystemVariableScope, specifiedScope string) *SystemVar
NewSystemVar creates a new SystemVar expression for the system variable named |name| with the specified |scope|. The |specifiedScope| parameter indicates the exact scope that was specified in the original reference to this system variable, and is used to ensure we output a column name in a result set that exactly matches how the system variable was originally referenced. If the |specifiedScope| parameter is empty, then the scope was not originally specified and any scope has been inferred.
func (*SystemVar) Children ¶
func (v *SystemVar) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*SystemVar) CollationCoercibility ¶ added in v0.15.0
func (v *SystemVar) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*SystemVar) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (*SystemVar) WithChildren ¶
func (v *SystemVar) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type TimeDelta ¶
type TimeDelta struct { Years int64 Months int64 Days int64 Hours int64 Minutes int64 Seconds int64 Microseconds int64 }
TimeDelta is the difference between a time and another time.
type TopRowsHeap ¶ added in v0.12.0
type TopRowsHeap struct {
Sorter
}
TopRowsHeap implements heap.Interface based on Sorter. It inverts the Less() function so that it can be used to implement TopN. heap.Push() rows into it, and if Len() > MAX; heap.Pop() the current min row. Then, at the end of seeing all the rows, call Rows(). Rows() will return the rows which come back from heap.Pop() in reverse order, correctly restoring the order for the TopN elements.
func (*TopRowsHeap) Less ¶ added in v0.12.0
func (h *TopRowsHeap) Less(i, j int) bool
func (*TopRowsHeap) Pop ¶ added in v0.12.0
func (h *TopRowsHeap) Pop() interface{}
func (*TopRowsHeap) Push ¶ added in v0.12.0
func (h *TopRowsHeap) Push(x interface{})
type Tuple ¶
type Tuple []sql.Expression
Tuple is a fixed-size collection of expressions. A tuple of size 1 is treated as the expression itself.
func NewTuple ¶
func NewTuple(exprs ...sql.Expression) Tuple
NewTuple creates a new Tuple expression.
func (Tuple) Children ¶
func (t Tuple) Children() []sql.Expression
Children implements the Expression interface.
func (Tuple) DebugString ¶ added in v0.11.0
func (Tuple) IsNullable ¶
IsNullable implements the Expression interface.
func (Tuple) WithChildren ¶
func (t Tuple) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type UnaryExpression ¶
type UnaryExpression struct {
Child sql.Expression
}
UnaryExpression is an expression that has only one child.
func (*UnaryExpression) Children ¶
func (p *UnaryExpression) Children() []sql.Expression
Children implements the Expression interface.
func (*UnaryExpression) IsNullable ¶
func (p *UnaryExpression) IsNullable() bool
IsNullable returns whether the expression can be null.
func (*UnaryExpression) Resolved ¶
func (p *UnaryExpression) Resolved() bool
Resolved implements the Expression interface.
type UnaryMinus ¶
type UnaryMinus struct {
UnaryExpression
}
UnaryMinus is an unary minus operator.
func NewUnaryMinus ¶
func NewUnaryMinus(child sql.Expression) *UnaryMinus
NewUnaryMinus creates a new UnaryMinus expression node.
func (*UnaryMinus) CollationCoercibility ¶ added in v0.15.0
func (*UnaryMinus) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*UnaryMinus) String ¶
func (e *UnaryMinus) String() string
func (*UnaryMinus) Type ¶
func (e *UnaryMinus) Type() sql.Type
Type implements the sql.Expression interface.
func (*UnaryMinus) WithChildren ¶
func (e *UnaryMinus) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type UnresolvedColumn ¶
type UnresolvedColumn struct {
// contains filtered or unexported fields
}
UnresolvedColumn is an expression of a column that is not yet resolved. This is a placeholder node, so its methods Type, IsNullable and Eval are not supposed to be called.
func NewUnresolvedColumn ¶
func NewUnresolvedColumn(name string) *UnresolvedColumn
NewUnresolvedColumn creates a new UnresolvedColumn expression.
func NewUnresolvedQualifiedColumn ¶
func NewUnresolvedQualifiedColumn(table, name string) *UnresolvedColumn
NewUnresolvedQualifiedColumn creates a new UnresolvedColumn expression with a table qualifier.
func (*UnresolvedColumn) Children ¶
func (*UnresolvedColumn) Children() []sql.Expression
Children implements the Expression interface.
func (*UnresolvedColumn) CollationCoercibility ¶ added in v0.15.0
func (*UnresolvedColumn) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*UnresolvedColumn) IsNullable ¶
func (*UnresolvedColumn) IsNullable() bool
IsNullable implements the Expression interface.
func (*UnresolvedColumn) Name ¶
func (uc *UnresolvedColumn) Name() string
Name implements the Nameable interface.
func (*UnresolvedColumn) Resolved ¶
func (*UnresolvedColumn) Resolved() bool
Resolved implements the Expression interface.
func (*UnresolvedColumn) String ¶
func (uc *UnresolvedColumn) String() string
func (*UnresolvedColumn) Table ¶
func (uc *UnresolvedColumn) Table() string
Table returns the table name.
func (*UnresolvedColumn) Type ¶
func (*UnresolvedColumn) Type() sql.Type
Type implements the Expression interface.
func (*UnresolvedColumn) Type2 ¶ added in v0.12.0
func (uc *UnresolvedColumn) Type2() sql.Type2
func (*UnresolvedColumn) WithChildren ¶
func (uc *UnresolvedColumn) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type UnresolvedFunction ¶
type UnresolvedFunction struct { // IsAggregate or not. IsAggregate bool // Window is the window for this function, if present Window *sql.WindowDefinition // Children of the expression. Arguments []sql.Expression // contains filtered or unexported fields }
UnresolvedFunction represents a function that is not yet resolved. This is a placeholder node, so its methods Type, IsNullable and Eval are not supposed to be called.
func NewUnresolvedFunction ¶
func NewUnresolvedFunction( name string, agg bool, window *sql.WindowDefinition, arguments ...sql.Expression, ) *UnresolvedFunction
NewUnresolvedFunction creates a new UnresolvedFunction expression.
func (*UnresolvedFunction) Children ¶
func (uf *UnresolvedFunction) Children() []sql.Expression
Children implements the Expression interface.
func (*UnresolvedFunction) CollationCoercibility ¶ added in v0.15.0
func (*UnresolvedFunction) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*UnresolvedFunction) DebugString ¶ added in v0.9.0
func (uf *UnresolvedFunction) DebugString() string
func (*UnresolvedFunction) IsNullable ¶
func (*UnresolvedFunction) IsNullable() bool
IsNullable implements the Expression interface.
func (*UnresolvedFunction) Name ¶
func (uf *UnresolvedFunction) Name() string
Name implements the Nameable interface.
func (*UnresolvedFunction) Resolved ¶
func (*UnresolvedFunction) Resolved() bool
Resolved implements the Expression interface.
func (*UnresolvedFunction) String ¶
func (uf *UnresolvedFunction) String() string
func (*UnresolvedFunction) Type ¶
func (*UnresolvedFunction) Type() sql.Type
Type implements the Expression interface.
func (*UnresolvedFunction) WithChildren ¶
func (uf *UnresolvedFunction) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
func (*UnresolvedFunction) WithWindow ¶ added in v0.12.0
func (uf *UnresolvedFunction) WithWindow(def *sql.WindowDefinition) *UnresolvedFunction
WithWindow implements the Expression interface.
type UnresolvedProcedureParam ¶ added in v0.15.0
type UnresolvedProcedureParam struct {
// contains filtered or unexported fields
}
UnresolvedProcedureParam represents an unresolved parameter of a stored procedure or stored function.
func NewUnresolvedProcedureParam ¶ added in v0.15.0
func NewUnresolvedProcedureParam(name string) *UnresolvedProcedureParam
NewUnresolvedProcedureParam creates a new UnresolvedProcedureParam expression.
func (*UnresolvedProcedureParam) Children ¶ added in v0.15.0
func (*UnresolvedProcedureParam) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*UnresolvedProcedureParam) CollationCoercibility ¶ added in v0.15.0
func (*UnresolvedProcedureParam) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*UnresolvedProcedureParam) Eval ¶ added in v0.15.0
Eval implements the sql.Expression interface.
func (*UnresolvedProcedureParam) IsNullable ¶ added in v0.15.0
func (*UnresolvedProcedureParam) IsNullable() bool
IsNullable implements the sql.Expression interface.
func (*UnresolvedProcedureParam) Name ¶ added in v0.15.0
func (upp *UnresolvedProcedureParam) Name() string
Name implements the Nameable interface.
func (*UnresolvedProcedureParam) Resolved ¶ added in v0.15.0
func (*UnresolvedProcedureParam) Resolved() bool
Resolved implements the sql.Expression interface.
func (*UnresolvedProcedureParam) String ¶ added in v0.15.0
func (upp *UnresolvedProcedureParam) String() string
String implements the sql.Expression interface.
func (*UnresolvedProcedureParam) Type ¶ added in v0.15.0
func (*UnresolvedProcedureParam) Type() sql.Type
Type implements the sql.Expression interface.
func (*UnresolvedProcedureParam) WithChildren ¶ added in v0.15.0
func (upp *UnresolvedProcedureParam) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the sql.Expression interface.
type UnresolvedTableFunction ¶ added in v0.12.0
type UnresolvedTableFunction struct { Alias string Arguments []sql.Expression // contains filtered or unexported fields }
UnresolvedTableFunction represents a table function that is not yet resolved. This is a placeholder node, so methods such as Schema, RowIter, etc, are not intended to be used.
func NewUnresolvedTableFunction ¶ added in v0.12.0
func NewUnresolvedTableFunction(name string, arguments []sql.Expression) *UnresolvedTableFunction
NewUnresolvedTableFunction creates a new UnresolvedTableFunction node for a sql plan.
func (UnresolvedTableFunction) CheckPrivileges ¶ added in v0.12.0
func (utf UnresolvedTableFunction) CheckPrivileges(ctx *sql.Context, opChecker sql.PrivilegedOperationChecker) bool
CheckPrivileges implements the Node interface
func (*UnresolvedTableFunction) Children ¶ added in v0.12.0
func (utf *UnresolvedTableFunction) Children() []sql.Node
Children implements the Node interface
func (UnresolvedTableFunction) CollationCoercibility ¶ added in v0.15.0
func (UnresolvedTableFunction) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*UnresolvedTableFunction) Database ¶ added in v0.12.0
func (utf *UnresolvedTableFunction) Database() sql.Database
Database implements the Databaser interface
func (*UnresolvedTableFunction) Expressions ¶ added in v0.12.0
func (utf *UnresolvedTableFunction) Expressions() []sql.Expression
Expressions implements the Expressioner interface
func (*UnresolvedTableFunction) IsReadOnly ¶ added in v0.18.0
func (utf *UnresolvedTableFunction) IsReadOnly() bool
func (*UnresolvedTableFunction) Name ¶ added in v0.15.0
func (utf *UnresolvedTableFunction) Name() string
Name implements the TableFunction interface
func (*UnresolvedTableFunction) NewInstance ¶ added in v0.12.0
func (utf *UnresolvedTableFunction) NewInstance(_ *sql.Context, _ sql.Database, _ []sql.Expression) (sql.Node, error)
NewInstance implements the TableFunction interface
func (*UnresolvedTableFunction) Resolved ¶ added in v0.12.0
func (utf *UnresolvedTableFunction) Resolved() bool
Resolved implements the Resolvable interface
func (*UnresolvedTableFunction) Schema ¶ added in v0.12.0
func (utf *UnresolvedTableFunction) Schema() sql.Schema
Schema implements the Node interface
func (*UnresolvedTableFunction) String ¶ added in v0.12.0
func (utf *UnresolvedTableFunction) String() string
String implements the Stringer interface
func (*UnresolvedTableFunction) WithChildren ¶ added in v0.12.0
WithChildren implements the Node interface
func (*UnresolvedTableFunction) WithDatabase ¶ added in v0.12.0
WithDatabase implements the Databaser interface
func (*UnresolvedTableFunction) WithExpressions ¶ added in v0.12.0
func (utf *UnresolvedTableFunction) WithExpressions(expression ...sql.Expression) (sql.Node, error)
WithExpressions implements the Expressioner interface
type UserVar ¶
type UserVar struct { Name string // contains filtered or unexported fields }
UserVar is an expression that returns the value of a user variable. It's also used as the expression on the left hand side of a SET statement for a user var.
func NewUserVar ¶
NewUserVar creates a UserVar with a name, but no type information, for use as the left-hand value in a SetField assignment Expression. This method should not be used when the user variable is being used as a value, since the correct type information will not be available.
func NewUserVarWithType ¶ added in v0.12.0
NewUserVarWithType creates a UserVar with its type resolved, so that it can be used as a value in other expressions.
func (*UserVar) Children ¶
func (v *UserVar) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*UserVar) CollationCoercibility ¶ added in v0.15.0
func (v *UserVar) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*UserVar) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (*UserVar) WithChildren ¶
func (v *UserVar) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper simply acts as a wrapper for another expression. If a nil expression is wrapped, then the wrapper functions as a guard against functions that expect non-nil expressions.
func WrapExpression ¶
func WrapExpression(expr sql.Expression) *Wrapper
WrapExpression takes in an expression and wraps it, returning the resulting Wrapper expression. Useful for when an expression is nil.
func (*Wrapper) Children ¶
func (w *Wrapper) Children() []sql.Expression
Children implements sql.Expression
func (*Wrapper) CollationCoercibility ¶ added in v0.15.0
func (w *Wrapper) CollationCoercibility(ctx *sql.Context) (collation sql.CollationID, coercibility byte)
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Wrapper) DebugString ¶ added in v0.18.0
DebugString implements sql.DebugStringer
func (*Wrapper) IsNullable ¶
IsNullable implements sql.Expression
func (*Wrapper) Unwrap ¶
func (w *Wrapper) Unwrap() sql.Expression
Unwrap returns the wrapped expression, or nil if no expression was wrapped.
func (*Wrapper) WithChildren ¶
func (w *Wrapper) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements sql.Expression
type Xor ¶ added in v0.12.0
type Xor struct {
BinaryExpressionStub
}
Xor checks whether only one of the two given expressions is true.
func (*Xor) CollationCoercibility ¶ added in v0.15.0
CollationCoercibility implements the interface sql.CollationCoercible.
func (*Xor) DebugString ¶ added in v0.12.0
func (*Xor) WithChildren ¶ added in v0.12.0
func (x *Xor) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
Source Files ¶
- alias.go
- arithmetic.go
- auto_increment.go
- between.go
- binary.go
- bindvar.go
- bit_ops.go
- boolean.go
- case.go
- collatedexpr.go
- common.go
- comparison.go
- convert.go
- convertusing.go
- default.go
- distinct.go
- div.go
- filter-range.go
- format.go
- get_field.go
- in.go
- interval.go
- isnull.go
- istrue.go
- like.go
- literal.go
- logic.go
- matchagainst.go
- mod.go
- namedliteral.go
- procedurereference.go
- set.go
- sort.go
- star.go
- tuple.go
- unresolved.go
- variables.go
- wrapper.go