Documentation ¶
Index ¶
- Variables
- type ConditionFn
- type Executor
- func (e *Executor) DoAst(ast *expression.AstNode, prefix, suffix string) (sqls string, params []any, keys []string)
- func (e *Executor) DoExpr(expr string, prefix, suffix string) (sqls string, params []any, keys []string, err error)
- func (e *Executor) DoTerm(term *expression.AstNode, prefix, suffix string) (sql string, params []any, keys []string)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFnMap = map[string]map[token.Token]ConditionFn{ "==": { token.NUM: equal[float64], token.BOOL: equal[bool], token.STRING: equal[string], }, "!=": { token.NUM: unEqual[float64], token.BOOL: unEqual[bool], token.STRING: unEqual[string], }, ">=": { token.NUM: gte[float64], token.STRING: gte[string], }, "<=": { token.NUM: lte[float64], token.STRING: lte[string], }, ">": { token.NUM: gt[float64], token.STRING: lt[string], }, "<": { token.NUM: lt[float64], token.STRING: lt[string], }, "contains": { token.STRING: contains, }, "unContains": { token.STRING: unContains, }, "startsWith": { token.STRING: startsWith, }, "unStartsWith": { token.STRING: unStartsWith, }, "endsWith": { token.STRING: endsWith, }, "unEndsWith": { token.STRING: unEndsWith, }, "reg": { token.STRING: reg, }, "in": { token.STRING: in, }, "notIn": { token.STRING: notIn, }, "containsBit": { token.NUM: containsBit, token.STRING: containsBit, }, "unContainsBit": { token.NUM: unContainsBit, token.STRING: unContainsBit, }, "&": {}, "|": {}, }
View Source
var StdExecutor = New(nil, nil)
Functions ¶
This section is empty.
Types ¶
type ConditionFn ¶ added in v1.13.1
type Executor ¶
type Executor struct { FnMap map[string]map[token.Token]ConditionFn // KeyMap 字段映射 // 存在映射 => key 转换为映射值 KeyMap map[string]string }
func (*Executor) DoAst ¶
func (e *Executor) DoAst(ast *expression.AstNode, prefix, suffix string) (sqls string, params []any, keys []string)
DoAst 执行 ast
Click to show internal directories.
Click to hide internal directories.