Documentation ¶
Index ¶
- func Evaluate(predicate Predicate, data schema.Schema, bind ParamBinds) bool
- func EvaluateEqual(record schema.Schema, location string, value any) bool
- func GetValue(x Bindable, params ParamBinds, data schema.Schema) (schema.Schema, bool)
- type And
- type BindName
- type BindValue
- type Comparable
- type Compare
- type Condition
- type Expression
- type Literal
- type Locatable
- type Not
- type Or
- type OrCondition
- type ParamBinds
- type Value
- type WherePredicates
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Comparable ¶
type Comparable struct { Location string `( @Location` Operator string ` @( "<>" | "<=" | ">=" | "=" | "<" | ">" | "!=" )` BindName Value ` @@)` }
func (Comparable) ToPredicate ¶
func (a Comparable) ToPredicate() (Predicate, error)
type Condition ¶
type Condition struct { Operand *Comparable ` @@` Not *Condition `| "NOT" @@` }
func (*Condition) ToPredicate ¶
type Expression ¶
type Expression struct {
Or []*OrCondition `@@ ( "OR" @@ )*`
}
func (Expression) ToPredicate ¶
func (e Expression) ToPredicate() (Predicate, error)
type OrCondition ¶
type OrCondition struct {
And []*Condition `@@ ( "AND" @@ )*`
}
func (*OrCondition) ToPredicate ¶
func (c *OrCondition) ToPredicate() (Predicate, error)
type ParamBinds ¶
type Value ¶
type Value struct { BindName *string `( @Bind` Number *float64 `| @Number` String *string `| @String` Bool *string `| @("TRUE" | "FALSE" | "true" | "false") ` Location *string `| @Location )` }
func (Value) ToBindable ¶
func (v Value) ToBindable() Bindable
type WherePredicates ¶
type WherePredicates struct { Predicate Predicate Params ParamBinds }
func MustWhere ¶
func MustWhere(query string, params ParamBinds) *WherePredicates
func Where ¶
func Where(query string, params ParamBinds) (*WherePredicates, error)
Click to show internal directories.
Click to hide internal directories.