Documentation ¶
Overview ¶
VM implements the virtual machine runtime/evaluator for the SQL, FilterQL, and Expression evalutors.
Index ¶
- Variables
- func Eval(ctx expr.EvalContext, arg expr.Node) (value.Value, bool)
- func EvalFilerSelect(sel *rel.FilterSelect, inc Includer, writeContext expr.ContextWriter, ...) (bool, error)
- func EvalSql(sel *rel.SqlSelect, writeContext expr.ContextWriter, ...) (bool, error)
- func LikeCompare(a, b string) (value.BoolValue, bool)
- func NewFilterVm(i Includer) *filterql
- type EvalBaseContext
- type EvaluatorFunc
- type ExprVm
- type Includer
- type NoSchema
- type State
- type Vm
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func EvalFilerSelect ¶
func EvalFilerSelect(sel *rel.FilterSelect, inc Includer, writeContext expr.ContextWriter, readContext expr.ContextReader) (bool, error)
EvalFilerSelect applies a FilterSelect statement to the specified contexts
@writeContext = Write results of projection @readContext = Message input, ie evaluate for Where/Filter clause
func EvalSql ¶
func EvalSql(sel *rel.SqlSelect, writeContext expr.ContextWriter, readContext expr.ContextReader) (bool, error)
Eval applies a sql statement to the specified context
@writeContext = Write out results of projection @readContext = Message to evaluate does it match where clause? if so proceed to projection
func NewFilterVm ¶
func NewFilterVm(i Includer) *filterql
Types ¶
type EvalBaseContext ¶
type EvalBaseContext struct {
expr.ContextReader
}
type EvaluatorFunc ¶
type EvaluatorFunc func(ctx expr.EvalContext) (value.Value, bool)
func Evaluator ¶
func Evaluator(arg expr.Node) EvaluatorFunc
type ExprVm ¶
type ExprVm interface {
Execute(writeContext expr.ContextWriter, readContext expr.ContextReader) error
}
type Includer ¶
type Includer interface {
Include(name string) (*rel.FilterStatement, error)
}
Includer defines an interface used for resolving INCLUDE clauses into a *FilterStatement. Implementations should return an error if the name cannot be resolved.
type State ¶
type State struct { ExprVm // reference to the VM operating on this state expr.ContextReader Writer expr.ContextWriter // contains filtered or unexported fields }
func NewState ¶
func NewState(vm ExprVm, read expr.ContextReader, write expr.ContextWriter) *State
type Vm ¶
A node vm is a vm for parsing, evaluating a single tree-node
func (*Vm) Execute ¶
func (m *Vm) Execute(writeContext expr.ContextWriter, readContext expr.ContextReader) (err error)
Execute applies a parse expression to the specified context's
func (*Vm) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.