Documentation ¶
Index ¶
- Constants
- Variables
- func Clone(expr sql.Expression) (sql.Expression, error)
- func Dispose(e sql.Expression)
- func ExpressionToColumn(e sql.Expression) *sql.Column
- func ExpressionsResolved(exprs ...sql.Expression) bool
- func IsBinary(e sql.Expression) bool
- func IsUnary(e sql.Expression) bool
- func JoinAnd(exprs ...sql.Expression) sql.Expression
- func NewAnd(left, right sql.Expression) sql.Expression
- func NewBinary(e sql.Expression) sql.Expression
- func NewBindVar(name string) sql.Expression
- func NewLike(left, right sql.Expression) sql.Expression
- func NewNotInTuple(left sql.Expression, right sql.Expression) sql.Expression
- func NewOr(left, right sql.Expression) sql.Expression
- func NewSetField(left, expr sql.Expression) sql.Expression
- func TransformUp(e sql.Expression, f sql.TransformExprFunc) (sql.Expression, error)
- func TransformUpWithNode(n sql.Node, e sql.Expression, f TransformExprWithNodeFunc) (sql.Expression, error)
- func WrapExpressions(exprs ...sql.Expression) []sql.Expression
- type Alias
- type And
- type Arithmetic
- func NewArithmetic(left, right sql.Expression, op string) *Arithmetic
- func NewBitAnd(left, right sql.Expression) *Arithmetic
- func NewBitOr(left, right sql.Expression) *Arithmetic
- func NewBitXor(left, right sql.Expression) *Arithmetic
- func NewDiv(left, right sql.Expression) *Arithmetic
- func NewIncrement(left sql.Expression) *Arithmetic
- func NewIntDiv(left, right sql.Expression) *Arithmetic
- func NewMinus(left, right sql.Expression) *Arithmetic
- func NewMod(left, right sql.Expression) *Arithmetic
- func NewMult(left, right sql.Expression) *Arithmetic
- func NewPlus(left, right sql.Expression) *Arithmetic
- func NewShiftLeft(left, right sql.Expression) *Arithmetic
- func NewShiftRight(left, right sql.Expression) *Arithmetic
- 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) String() string
- func (a *Arithmetic) Type() sql.Type
- func (a *Arithmetic) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type AutoIncrement
- func (i *AutoIncrement) Children() []sql.Expression
- 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) 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
- type BinaryExpression
- type BindVar
- func (bv *BindVar) Children() []sql.Expression
- 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 Case
- func (c *Case) Children() []sql.Expression
- 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 Comparer
- type Convert
- type DefaultColumn
- func (*DefaultColumn) Children() []sql.Expression
- 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) 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 Equals
- 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) DebugString() string
- func (p *GetField) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (p *GetField) Index() int
- 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) Type() sql.Type
- func (p *GetField) WithChildren(children ...sql.Expression) (sql.Expression, error)
- 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 (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 (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 InTuple
- func (in *InTuple) Children() []sql.Expression
- 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 Interval
- 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
- type IsTrue
- type LessThan
- 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 (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
- type Literal
- func (*Literal) Children() []sql.Expression
- func (p *Literal) DebugString() string
- func (p *Literal) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)
- func (p *Literal) IsNullable() bool
- func (p *Literal) Resolved() bool
- func (p *Literal) String() string
- func (p *Literal) Type() sql.Type
- func (p *Literal) Value() interface{}
- func (p *Literal) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type NaryExpression
- type Not
- type NullSafeEquals
- 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
- type ProcedureParam
- func (*ProcedureParam) Children() []sql.Expression
- 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 *ProcedureParamReference) *ProcedureParam
- type ProcedureParamReference
- func (ppr *ProcedureParamReference) Get(name string) (interface{}, error)
- func (ppr *ProcedureParamReference) GetType(name string) sql.Type
- func (ppr *ProcedureParamReference) HasBeenSet(name string) bool
- func (ppr *ProcedureParamReference) Initialize(name string, sqlType sql.Type, val interface{}) error
- func (ppr *ProcedureParamReference) Set(name string, val interface{}, valType sql.Type) error
- type Regexp
- 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
- type Sorter
- type Star
- func (*Star) Children() []sql.Expression
- 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) 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 TransformExprWithNodeFunc
- 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
- type UnresolvedColumn
- func (*UnresolvedColumn) Children() []sql.Expression
- func (*UnresolvedColumn) Eval(ctx *sql.Context, r sql.Row) (interface{}, 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) WithChildren(children ...sql.Expression) (sql.Expression, error)
- type UnresolvedFunction
- func (uf *UnresolvedFunction) Children() []sql.Expression
- 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)
- type UserVar
- func (v *UserVar) Children() []sql.Expression
- 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) 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)
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" // 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 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 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 ( // 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") )
Functions ¶
func Clone ¶
func Clone(expr sql.Expression) (sql.Expression, error)
Clone duplicates an existing sql.Expression, returning new nodes with the same structure and internal values. It can be useful when dealing with stateful expression nodes where an evaluation needs to create multiple independent histories of the internal state of the expression nodes.
func Dispose ¶
func Dispose(e sql.Expression)
func ExpressionToColumn ¶
func ExpressionToColumn(e sql.Expression) *sql.Column
ExpressionToColumn converts the expression to the form that should be used in a Schema. Expressions that have Name() and Table() methods will use these; otherwise, String() and "" are used, respectively. The type and nullability are taken from the expression directly.
func ExpressionsResolved ¶
func ExpressionsResolved(exprs ...sql.Expression) bool
ExpressionsResolve returns whether all the expressions in the slice given are resolved
func IsBinary ¶
func IsBinary(e sql.Expression) bool
IsBinary returns whether the expression is binary or not.
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 NewAnd ¶
func NewAnd(left, right sql.Expression) sql.Expression
NewAnd creates a new And expression.
func NewBinary ¶
func NewBinary(e sql.Expression) sql.Expression
func NewBindVar ¶
func NewBindVar(name string) sql.Expression
func NewLike ¶
func NewLike(left, right 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 NewSetField ¶
func NewSetField(left, expr sql.Expression) sql.Expression
NewSetField creates a new SetField expression.
func TransformUp ¶
func TransformUp(e sql.Expression, f sql.TransformExprFunc) (sql.Expression, error)
TransformUp applies a transformation function to the given expression from the bottom up.
func TransformUpWithNode ¶
func TransformUpWithNode(n sql.Node, e sql.Expression, f TransformExprWithNodeFunc) (sql.Expression, error)
TransformUpWithNode applies a transformation function to the given expression from the bottom up.
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) DebugString ¶
func (*Alias) WithChildren ¶
func (e *Alias) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type And ¶
type And struct {
BinaryExpression
}
And checks whether two expressions are true.
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 { BinaryExpression Op string }
Arithmetic expressions (+, -, *, /, ...)
func NewArithmetic ¶
func NewArithmetic(left, right sql.Expression, op string) *Arithmetic
NewArithmetic creates a new Arithmetic sql.Expression.
func NewBitAnd ¶
func NewBitAnd(left, right sql.Expression) *Arithmetic
NewBitAnd creates a new Arithmetic & sql.Expression.
func NewBitOr ¶
func NewBitOr(left, right sql.Expression) *Arithmetic
NewBitOr creates a new Arithmetic | sql.Expression.
func NewBitXor ¶
func NewBitXor(left, right sql.Expression) *Arithmetic
NewBitXor creates a new Arithmetic ^ sql.Expression.
func NewDiv ¶
func NewDiv(left, right sql.Expression) *Arithmetic
NewDiv creates a new Arithmetic / sql.Expression.
func NewIncrement ¶
func NewIncrement(left sql.Expression) *Arithmetic
func NewIntDiv ¶
func NewIntDiv(left, right sql.Expression) *Arithmetic
NewIntDiv creates a new Arithmetic div sql.Expression.
func NewMinus ¶
func NewMinus(left, right sql.Expression) *Arithmetic
NewMinus creates a new Arithmetic - sql.Expression.
func NewMod ¶
func NewMod(left, right sql.Expression) *Arithmetic
NewMod 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 NewShiftLeft ¶
func NewShiftLeft(left, right sql.Expression) *Arithmetic
NewShiftLeft creates a new Arithmetic << sql.Expression.
func NewShiftRight ¶
func NewShiftRight(left, right sql.Expression) *Arithmetic
NewShiftRight creates a new Arithmetic >> sql.Expression.
func (*Arithmetic) DebugString ¶
func (a *Arithmetic) DebugString() string
func (*Arithmetic) IsNullable ¶
func (a *Arithmetic) IsNullable() bool
IsNullable implements the sql.Expression interface.
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 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 (*AutoIncrement) Children ¶
func (i *AutoIncrement) Children() []sql.Expression
Children implements the Expression interface.
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) DebugString ¶
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 ¶
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) WithChildren ¶
func (b *Binary) WithChildren(children ...sql.Expression) (sql.Expression, error)
type BinaryExpression ¶
type BinaryExpression struct { Left sql.Expression Right sql.Expression }
BinaryExpression is an expression that has two children.
func (*BinaryExpression) Children ¶
func (p *BinaryExpression) Children() []sql.Expression
Children implements the Expression interface.
func (*BinaryExpression) IsNullable ¶
func (p *BinaryExpression) IsNullable() bool
IsNullable returns whether the expression can be null.
func (*BinaryExpression) Resolved ¶
func (p *BinaryExpression) Resolved() bool
Resolved implements the Expression interface.
type BindVar ¶
type BindVar struct {
Name string
}
func (*BindVar) Children ¶
func (bv *BindVar) Children() []sql.Expression
func (*BindVar) IsNullable ¶
func (*BindVar) WithChildren ¶
func (bv *BindVar) WithChildren(children ...sql.Expression) (sql.Expression, error)
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) DebugString ¶
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 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.
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 DefaultColumn ¶
type DefaultColumn struct {
// contains filtered or unexported fields
}
DefaultColumn is an 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) 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 ¶
type DistinctExpression struct { Child sql.Expression // contains filtered or unexported fields }
func NewDistinctExpression ¶
func NewDistinctExpression(e sql.Expression) *DistinctExpression
func (*DistinctExpression) Children ¶
func (de *DistinctExpression) Children() []sql.Expression
func (*DistinctExpression) Dispose ¶
func (de *DistinctExpression) Dispose()
func (*DistinctExpression) Eval ¶
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 ¶
func (de *DistinctExpression) IsNullable() bool
func (*DistinctExpression) Resolved ¶
func (de *DistinctExpression) Resolved() bool
func (*DistinctExpression) String ¶
func (de *DistinctExpression) String() string
func (*DistinctExpression) Type ¶
func (de *DistinctExpression) Type() sql.Type
func (*DistinctExpression) WithChildren ¶
func (de *DistinctExpression) WithChildren(children ...sql.Expression) (sql.Expression, error)
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) 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 NewGetField ¶
NewGetField creates a GetField expression.
func NewGetFieldWithTable ¶
func NewGetFieldWithTable(index int, fieldType sql.Type, 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) DebugString ¶
func (*GetField) Index ¶
Index returns the index where the GetField will look for the value from a sql.Row.
func (*GetField) IsNullable ¶
IsNullable returns whether the field is nullable or not.
func (*GetField) WithChildren ¶
func (p *GetField) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
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) 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) 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 InTuple ¶
type InTuple struct {
BinaryExpression
}
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) 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 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) 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) 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) 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) 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) 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 { BinaryExpression // contains filtered or unexported fields }
Like performs pattern matching against two strings.
func (*Like) WithChildren ¶
func (l *Like) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
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) DebugString ¶
func (*Literal) IsNullable ¶
IsNullable implements the Expression interface.
func (*Literal) WithChildren ¶
func (p *Literal) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
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) DebugString ¶
func (*Not) WithChildren ¶
func (e *Not) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type NullSafeEquals ¶
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 ¶
func NewNullSafeEquals(left sql.Expression, right sql.Expression) *NullSafeEquals
NewNullSafeEquals returns a new NullSafeEquals expression.
func (*NullSafeEquals) DebugString ¶
func (e *NullSafeEquals) DebugString() string
func (*NullSafeEquals) Left ¶
func (c *NullSafeEquals) Left() sql.Expression
Left implements Comparer interface
func (*NullSafeEquals) Right ¶
func (c *NullSafeEquals) Right() sql.Expression
Right implements Comparer interface
func (*NullSafeEquals) String ¶
func (e *NullSafeEquals) String() string
func (*NullSafeEquals) Type ¶
func (e *NullSafeEquals) Type() sql.Type
Type implements the Expression interface.
func (*NullSafeEquals) WithChildren ¶
func (e *NullSafeEquals) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type Or ¶
type Or struct {
BinaryExpression
}
Or checks whether one of the two given expressions is true.
func (*Or) DebugString ¶
func (*Or) WithChildren ¶
func (o *Or) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the Expression interface.
type ProcedureParam ¶
type ProcedureParam struct {
// contains filtered or unexported fields
}
ProcedureParam represents the parameter of a stored procedure or stored function.
func NewProcedureParam ¶
func NewProcedureParam(name string) *ProcedureParam
NewProcedureParam creates a new ProcedureParam expression.
func (*ProcedureParam) Children ¶
func (*ProcedureParam) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*ProcedureParam) IsNullable ¶
func (*ProcedureParam) IsNullable() bool
IsNullable implements the sql.Expression interface.
func (*ProcedureParam) Name ¶
func (pp *ProcedureParam) Name() string
Name implements the Nameable interface.
func (*ProcedureParam) Resolved ¶
func (*ProcedureParam) Resolved() bool
Resolved implements the sql.Expression interface.
func (*ProcedureParam) Set ¶
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 ¶
func (pp *ProcedureParam) String() string
String implements the sql.Expression interface.
func (*ProcedureParam) Type ¶
func (pp *ProcedureParam) Type() sql.Type
Type implements the sql.Expression interface.
func (*ProcedureParam) WithChildren ¶
func (pp *ProcedureParam) WithChildren(children ...sql.Expression) (sql.Expression, error)
WithChildren implements the sql.Expression interface.
func (*ProcedureParam) WithParamReference ¶
func (pp *ProcedureParam) WithParamReference(pRef *ProcedureParamReference) *ProcedureParam
WithParamReference returns a new *ProcedureParam containing the given *ProcedureParamReference.
type ProcedureParamReference ¶
type ProcedureParamReference struct {
// contains filtered or unexported fields
}
ProcedureParamReference contains the references to the parameters for a single CALL statement.
func NewProcedureParamReference ¶
func NewProcedureParamReference() *ProcedureParamReference
func (*ProcedureParamReference) Get ¶
func (ppr *ProcedureParamReference) Get(name string) (interface{}, error)
Get returns the value of the given parameter. Name is case-insensitive.
func (*ProcedureParamReference) GetType ¶
func (ppr *ProcedureParamReference) GetType(name string) sql.Type
GetType returns the type of the given parameter. Name is case-insensitive. Returns the NULL type if the type cannot be found.
func (*ProcedureParamReference) HasBeenSet ¶
func (ppr *ProcedureParamReference) HasBeenSet(name string) bool
HasBeenSet returns whether the parameter has had its value altered from the initial value.
func (*ProcedureParamReference) Initialize ¶
func (ppr *ProcedureParamReference) Initialize(name string, sqlType sql.Type, val interface{}) error
Initialize sets the initial value for the parameter.
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) 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 {
BinaryExpression
}
SetField updates the value of a field or a system variable
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 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) 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 Scope sql.SystemVariableScope }
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) *SystemVar
NewSystemVar creates a new SystemVar expression.
func (*SystemVar) Children ¶
func (v *SystemVar) Children() []sql.Expression
Children implements the sql.Expression interface.
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 TransformExprWithNodeFunc ¶
type TransformExprWithNodeFunc func(sql.Node, sql.Expression) (sql.Expression, error)
TransformExprWithNodeFunc is a function that given an expression and the node that contains it, will return that expression as is or transformed along with an error, if any.
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 ¶
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 children.
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) 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) 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) 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.Window // 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.Window, 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) DebugString ¶
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.
type UserVar ¶
type UserVar struct {
Name string
}
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 new UserVar expression.
func (*UserVar) Children ¶
func (v *UserVar) Children() []sql.Expression
Children implements the sql.Expression interface.
func (*UserVar) IsNullable ¶
IsNullable implements the sql.Expression interface.
func (*UserVar) Type ¶
Type implements the sql.Expression interface. TODO: type checking based on type of user var
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) 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
Source Files ¶
- alias.go
- arithmetic.go
- auto_increment.go
- between.go
- binary.go
- bindvar.go
- boolean.go
- case.go
- common.go
- comparison.go
- convert.go
- default.go
- distinct.go
- get_field.go
- in.go
- interval.go
- isnull.go
- istrue.go
- like.go
- literal.go
- logic.go
- procedureparam.go
- set.go
- sort.go
- star.go
- transform.go
- tuple.go
- unresolved.go
- variables.go
- wrapper.go