Documentation ¶
Overview ¶
Package expreval provides go-mysql-server expression evaluation logic that works directly on noms types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LiteralToNomsValue ¶
LiteralToNomsValue converts a go-mysql-servel Literal into a noms value.
Types ¶
type CompareOp ¶
type CompareOp interface { // CompareLiterals compares two go-mysql-server literals CompareLiterals(l1, l2 *expression.Literal) (bool, error) // CompareNomsValues compares two noms values CompareNomsValues(v1, v2 types.Value) (bool, error) // CompareToNil compares a noms value to nil using sql logic rules CompareToNil(v2 types.Value) (bool, error) }
CompareOp is an interface for comparing values
type ComparisonType ¶
type ComparisonType int
const ( InvalidCompare ComparisonType = iota VariableConstCompare VariableVariableCompare VariableInLiteralList ConstConstCompare )
func GetComparisonType ¶
func GetComparisonType(be expression.BinaryExpression) ([]*expression.GetField, []*expression.Literal, ComparisonType, error)
GetComparisonType looks at a go-mysql-server BinaryExpression classifies the left and right arguments as variables or constants.
type EqualsOp ¶
type EqualsOp struct{}
EqualsOp implements the CompareOp interface implementing equality logic
func (EqualsOp) CompareLiterals ¶
func (op EqualsOp) CompareLiterals(l1, l2 *expression.Literal) (bool, error)
CompareLiterals compares two go-mysql-server literals for equality
func (EqualsOp) CompareNomsValues ¶
CompareNomsValues compares two noms values for equality
type ExpressionFunc ¶
ExpressionFunc is a function that takes a map of tag to value and returns whether some set of criteria are true for the set of values
func ExpressionFuncFromSQLExpressions ¶
func ExpressionFuncFromSQLExpressions(nbf *types.NomsBinFormat, sch schema.Schema, expressions []sql.Expression) (ExpressionFunc, error)
ExpressionFuncFromSQLExpressions returns an ExpressionFunc which represents the slice of sql.Expressions passed in
type GreaterEqualOp ¶
type GreaterEqualOp struct {
NBF *types.NomsBinFormat
}
GreaterEqualOp implements the CompareOp interface implementing greater than or equal to logic
func (GreaterEqualOp) CompareLiterals ¶
func (op GreaterEqualOp) CompareLiterals(l1, l2 *expression.Literal) (bool, error)
CompareLiterals compares two go-mysql-server literals returning true if the value of the first is greater than or equal to the second.
func (GreaterEqualOp) CompareNomsValues ¶
func (op GreaterEqualOp) CompareNomsValues(v1, v2 types.Value) (bool, error)
CompareNomsValues compares two noms values returning true if the of the first is greater or equal to than the second.
func (GreaterEqualOp) CompareToNil ¶
func (op GreaterEqualOp) CompareToNil(types.Value) (bool, error)
CompareToNil always returns false as values are neither greater than, less than, or equal to nil
type GreaterOp ¶
type GreaterOp struct {
NBF *types.NomsBinFormat
}
GreaterOp implements the CompareOp interface implementing greater than logic
func (GreaterOp) CompareLiterals ¶
func (op GreaterOp) CompareLiterals(l1, l2 *expression.Literal) (bool, error)
CompareLiterals compares two go-mysql-server literals returning true if the value of the first is greater than the second.
func (GreaterOp) CompareNomsValues ¶
CompareNomsValues compares two noms values returning true if the of the first is greater than the second.
type LessEqualOp ¶
type LessEqualOp struct {
NBF *types.NomsBinFormat
}
LessEqualOp implements the CompareOp interface implementing less than or equal to logic
func (LessEqualOp) CompareLiterals ¶
func (op LessEqualOp) CompareLiterals(l1, l2 *expression.Literal) (bool, error)
CompareLiterals compares two go-mysql-server literals returning true if the value of the first is less than or equal to the second.
func (LessEqualOp) CompareNomsValues ¶
func (op LessEqualOp) CompareNomsValues(v1, v2 types.Value) (bool, error)
CompareNomsValues compares two noms values returning true if the of the first is less than or equal to the second.
func (LessEqualOp) CompareToNil ¶
func (op LessEqualOp) CompareToNil(types.Value) (bool, error)
CompareToNil always returns false as values are neither greater than, less than, or equal to nil
type LessOp ¶
type LessOp struct {
NBF *types.NomsBinFormat
}
LessOp implements the CompareOp interface implementing less than logic
func (LessOp) CompareLiterals ¶
func (op LessOp) CompareLiterals(l1, l2 *expression.Literal) (bool, error)
CompareLiterals compares two go-mysql-server literals returning true if the value of the first is less than the second.
func (LessOp) CompareNomsValues ¶
CompareNomsValues compares two noms values returning true if the of the first is less than the second.