Versions in this module Expand all Collapse all v0 v0.6.2 Apr 24, 2020 v0.6.1 Apr 24, 2020 Changes in this version + const ConvertToBinary + const ConvertToChar + const ConvertToDate + const ConvertToDatetime + const ConvertToDecimal + const ConvertToJSON + const ConvertToNChar + const ConvertToSigned + const ConvertToTimestamp + const ConvertToUnsigned + const IsFalseStr + const IsTrueStr + var ErrConvertExpression = errors.NewKind("expression '%v': couldn't convert to %v") + var ErrIndexOutOfBounds = errors.NewKind("unable to find field with index %d in row of %d columns") + var ErrInvalidOperandColumns = errors.NewKind("operand should have %d columns, but has %d") + var ErrNilOperand = errors.NewKind("nil operand found in comparison") + var ErrUnsupportedInOperand = errors.NewKind("right operand in IN operation must be tuple, but is %T") + func Inspect(expr sql.Expression, f func(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 NewLike(left, right sql.Expression) sql.Expression + func NewOr(left, right sql.Expression) sql.Expression + func NewSetField(colName, expr sql.Expression) sql.Expression + func TransformUp(e sql.Expression, f sql.TransformExprFunc) (sql.Expression, error) + func Walk(v Visitor, expr sql.Expression) + type Alias struct + func NewAlias(child sql.Expression, name string) *Alias + func (e *Alias) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (e *Alias) Name() string + func (e *Alias) String() string + func (e *Alias) Type() sql.Type + func (e *Alias) WithChildren(children ...sql.Expression) (sql.Expression, error) + type And struct + func (*And) Type() sql.Type + func (a *And) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (a *And) String() string + func (a *And) WithChildren(children ...sql.Expression) (sql.Expression, error) + type Arithmetic struct + Op string + 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 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) 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 Between struct + Lower sql.Expression + Upper sql.Expression + Val sql.Expression + func NewBetween(val, lower, upper sql.Expression) *Between + func (*Between) Type() sql.Type + func (b *Between) Children() []sql.Expression + 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 (b *Between) WithChildren(children ...sql.Expression) (sql.Expression, error) + type BinaryExpression struct + Left sql.Expression + Right sql.Expression + func (p *BinaryExpression) Children() []sql.Expression + func (p *BinaryExpression) IsNullable() bool + func (p *BinaryExpression) Resolved() bool + type Case struct + Branches []CaseBranch + Else sql.Expression + Expr sql.Expression + func NewCase(expr sql.Expression, branches []CaseBranch, elseExpr sql.Expression) *Case + func (c *Case) Children() []sql.Expression + 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 struct + Cond sql.Expression + Value sql.Expression + type Comparer interface + Compare func(ctx *sql.Context, row sql.Row) (int, error) + Left func() sql.Expression + Right func() sql.Expression + type Convert struct + func NewConvert(expr sql.Expression, castToType string) *Convert + 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 DefaultColumn struct + func NewDefaultColumn(name string) *DefaultColumn + func (*DefaultColumn) Children() []sql.Expression + func (*DefaultColumn) Eval(ctx *sql.Context, r sql.Row) (interface{}, error) + func (*DefaultColumn) IsNullable() bool + func (*DefaultColumn) Resolved() bool + func (*DefaultColumn) Type() sql.Type + func (c *DefaultColumn) Name() string + func (c *DefaultColumn) String() string + func (c *DefaultColumn) WithChildren(children ...sql.Expression) (sql.Expression, error) + type Equals struct + func NewEquals(left sql.Expression, right sql.Expression) *Equals + func (*Equals) Type() sql.Type + func (c *Equals) Compare(ctx *sql.Context, row sql.Row) (int, error) + func (c *Equals) Left() sql.Expression + func (c *Equals) Right() sql.Expression + func (e *Equals) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (e *Equals) String() string + func (e *Equals) WithChildren(children ...sql.Expression) (sql.Expression, error) + type GetField struct + func NewGetField(index int, fieldType sql.Type, fieldName string, nullable bool) *GetField + func NewGetFieldWithTable(index int, fieldType sql.Type, table, fieldName string, nullable bool) *GetField + func (*GetField) Children() []sql.Expression + 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 + type GetSessionField struct + func NewGetSessionField(name string, typ sql.Type, value interface{}) *GetSessionField + func (f *GetSessionField) Children() []sql.Expression + func (f *GetSessionField) Eval(*sql.Context, sql.Row) (interface{}, error) + func (f *GetSessionField) IsNullable() bool + func (f *GetSessionField) Resolved() bool + func (f *GetSessionField) String() string + func (f *GetSessionField) Type() sql.Type + func (f *GetSessionField) WithChildren(children ...sql.Expression) (sql.Expression, error) + type GreaterThan struct + func NewGreaterThan(left sql.Expression, right sql.Expression) *GreaterThan + func (*GreaterThan) Type() sql.Type + func (c *GreaterThan) Compare(ctx *sql.Context, row sql.Row) (int, error) + func (c *GreaterThan) Left() sql.Expression + func (c *GreaterThan) Right() sql.Expression + func (gt *GreaterThan) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (gt *GreaterThan) String() string + func (gt *GreaterThan) WithChildren(children ...sql.Expression) (sql.Expression, error) + type GreaterThanOrEqual struct + func NewGreaterThanOrEqual(left sql.Expression, right sql.Expression) *GreaterThanOrEqual + func (*GreaterThanOrEqual) Type() sql.Type + func (c *GreaterThanOrEqual) Compare(ctx *sql.Context, row sql.Row) (int, error) + func (c *GreaterThanOrEqual) Left() sql.Expression + func (c *GreaterThanOrEqual) Right() sql.Expression + func (gte *GreaterThanOrEqual) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (gte *GreaterThanOrEqual) String() string + func (gte *GreaterThanOrEqual) WithChildren(children ...sql.Expression) (sql.Expression, error) + type In struct + func NewIn(left sql.Expression, right sql.Expression) *In + func (*In) Type() sql.Type + func (c *In) Compare(ctx *sql.Context, row sql.Row) (int, error) + func (c *In) Left() sql.Expression + func (c *In) Right() sql.Expression + func (in *In) Children() []sql.Expression + func (in *In) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (in *In) String() string + func (in *In) WithChildren(children ...sql.Expression) (sql.Expression, error) + type Interval struct + Unit string + func NewInterval(child sql.Expression, unit string) *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 struct + func NewIsNull(child sql.Expression) *IsNull + func (e *IsNull) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (e *IsNull) IsNullable() bool + func (e *IsNull) Type() sql.Type + func (e *IsNull) WithChildren(children ...sql.Expression) (sql.Expression, error) + func (e IsNull) String() string + type IsTrue struct + func NewIsFalse(child sql.Expression) *IsTrue + func NewIsTrue(child sql.Expression) *IsTrue + func (*IsTrue) IsNullable() bool + func (*IsTrue) Type() sql.Type + func (e *IsTrue) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (e *IsTrue) String() string + func (e *IsTrue) WithChildren(children ...sql.Expression) (sql.Expression, error) + type LessThan struct + func NewLessThan(left sql.Expression, right sql.Expression) *LessThan + func (*LessThan) Type() sql.Type + func (c *LessThan) Compare(ctx *sql.Context, row sql.Row) (int, error) + func (c *LessThan) Left() sql.Expression + func (c *LessThan) Right() sql.Expression + func (lt *LessThan) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (lt *LessThan) String() string + func (lt *LessThan) WithChildren(children ...sql.Expression) (sql.Expression, error) + type LessThanOrEqual struct + func NewLessThanOrEqual(left sql.Expression, right sql.Expression) *LessThanOrEqual + func (*LessThanOrEqual) Type() sql.Type + func (c *LessThanOrEqual) Compare(ctx *sql.Context, row sql.Row) (int, error) + func (c *LessThanOrEqual) Left() sql.Expression + func (c *LessThanOrEqual) Right() sql.Expression + func (lte *LessThanOrEqual) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (lte *LessThanOrEqual) String() string + func (lte *LessThanOrEqual) WithChildren(children ...sql.Expression) (sql.Expression, error) + type Like struct + 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 Literal struct + func NewLiteral(value interface{}, fieldType sql.Type) *Literal + func (*Literal) Children() []sql.Expression + 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 Not struct + func NewNot(child sql.Expression) *Not + 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 NotIn struct + func NewNotIn(left sql.Expression, right sql.Expression) *NotIn + func (*NotIn) Type() sql.Type + func (c *NotIn) Compare(ctx *sql.Context, row sql.Row) (int, error) + func (c *NotIn) Left() sql.Expression + func (c *NotIn) Right() sql.Expression + func (in *NotIn) Children() []sql.Expression + func (in *NotIn) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (in *NotIn) String() string + func (in *NotIn) WithChildren(children ...sql.Expression) (sql.Expression, error) + type Or struct + func (*Or) Type() sql.Type + func (o *Or) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (o *Or) String() string + func (o *Or) WithChildren(children ...sql.Expression) (sql.Expression, error) + type Regexp struct + func NewRegexp(left sql.Expression, right sql.Expression) *Regexp + func (*Regexp) Type() sql.Type + func (c *Regexp) Compare(ctx *sql.Context, row sql.Row) (int, error) + func (c *Regexp) Left() sql.Expression + func (c *Regexp) Right() sql.Expression + func (re *Regexp) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) + func (re *Regexp) String() string + func (re *Regexp) WithChildren(children ...sql.Expression) (sql.Expression, error) + type SetField struct + 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 Star struct + Table string + func NewQualifiedStar(table string) *Star + func NewStar() *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 (*Star) Type() sql.Type + func (s *Star) String() string + func (s *Star) WithChildren(children ...sql.Expression) (sql.Expression, error) + type Subquery struct + Query sql.Node + func NewSubquery(node sql.Node) *Subquery + func (s *Subquery) Children() []sql.Expression + func (s *Subquery) Eval(ctx *sql.Context, _ sql.Row) (interface{}, error) + func (s *Subquery) EvalMultiple(ctx *sql.Context) ([]interface{}, error) + func (s *Subquery) IsNullable() bool + func (s *Subquery) Resolved() bool + func (s *Subquery) String() string + func (s *Subquery) Type() sql.Type + func (s *Subquery) WithChildren(children ...sql.Expression) (sql.Expression, error) + func (s *Subquery) WithQuery(node sql.Node) *Subquery + type TimeDelta struct + Days int64 + Hours int64 + Microseconds int64 + Minutes int64 + Months int64 + Seconds int64 + Years int64 + func (td TimeDelta) Add(t time.Time) time.Time + func (td TimeDelta) Sub(t time.Time) time.Time + type Tuple []sql.Expression + func NewTuple(exprs ...sql.Expression) Tuple + func (t Tuple) Children() []sql.Expression + 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 struct + Child sql.Expression + func (p *UnaryExpression) Children() []sql.Expression + func (p *UnaryExpression) IsNullable() bool + func (p *UnaryExpression) Resolved() bool + type UnaryMinus struct + func NewUnaryMinus(child sql.Expression) *UnaryMinus + 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 struct + func NewUnresolvedColumn(name string) *UnresolvedColumn + func NewUnresolvedQualifiedColumn(table, name string) *UnresolvedColumn + func (*UnresolvedColumn) Children() []sql.Expression + func (*UnresolvedColumn) Eval(ctx *sql.Context, r sql.Row) (interface{}, error) + func (*UnresolvedColumn) IsNullable() bool + func (*UnresolvedColumn) Resolved() bool + func (*UnresolvedColumn) Type() sql.Type + func (uc *UnresolvedColumn) Name() string + func (uc *UnresolvedColumn) String() string + func (uc *UnresolvedColumn) Table() string + func (uc *UnresolvedColumn) WithChildren(children ...sql.Expression) (sql.Expression, error) + type UnresolvedFunction struct + Arguments []sql.Expression + IsAggregate bool + func NewUnresolvedFunction(name string, agg bool, arguments ...sql.Expression) *UnresolvedFunction + func (*UnresolvedFunction) Eval(ctx *sql.Context, r sql.Row) (interface{}, error) + func (*UnresolvedFunction) IsNullable() bool + func (*UnresolvedFunction) Resolved() bool + func (*UnresolvedFunction) Type() sql.Type + func (uf *UnresolvedFunction) Children() []sql.Expression + func (uf *UnresolvedFunction) Name() string + func (uf *UnresolvedFunction) String() string + func (uf *UnresolvedFunction) WithChildren(children ...sql.Expression) (sql.Expression, error) + type Visitor interface + Visit func(expr sql.Expression) Visitor