MCPcopy Create free account
hub / github.com/araddon/qlbridge / eval

Method eval

datasource/sqlite/sqlrewrite.go:69–84  ·  view source on GitHub ↗

eval() returns ( value, isOk, isIdentity )

(arg expr.Node)

Source from the content-addressed store, hash-verified

67
68// eval() returns ( value, isOk, isIdentity )
69func (m *rewrite) eval(arg expr.Node) (value.Value, bool, bool) {
70 switch arg := arg.(type) {
71 case *expr.NumberNode, *expr.StringNode:
72 val, ok := vm.Eval(nil, arg)
73 return val, ok, false
74 case *expr.IdentityNode:
75 if arg.IsBooleanIdentity() {
76 return value.NewBoolValue(arg.Bool()), true, false
77 }
78 return value.NewStringValue(arg.Text), true, true
79 case *expr.ArrayNode:
80 val, ok := vm.Eval(nil, arg)
81 return val, ok, false
82 }
83 return nil, false, false
84}
85
86// Aggregations from the <select_list>
87//

Callers

nothing calls this directly

Calls 5

EvalFunction · 0.92
NewBoolValueFunction · 0.92
NewStringValueFunction · 0.92
IsBooleanIdentityMethod · 0.80
BoolMethod · 0.80

Tested by

no test coverage detected