MCPcopy
hub / github.com/ent/ent / ExprFunc

Function ExprFunc

dialect/sql/builder.go:2920–2922  ·  view source on GitHub ↗

ExprFunc returns an expression function that implements the Querier interface. Update("users"). Set("x", ExprFunc(func(b *Builder) { // The sql.Builder config (argc and dialect) // was set before the function was executed. b.Ident("x").WriteOp(OpAdd).Arg(1) }))

(fn func(*Builder))

Source from the content-addressed store, hash-verified

2918// b.Ident("x").WriteOp(OpAdd).Arg(1)
2919// }))
2920func ExprFunc(fn func(*Builder)) Querier {
2921 return &exprFunc{fn: fn}
2922}
2923
2924type exprFunc struct {
2925 Builder

Callers 15

SelectFunction · 0.92
LenPathFunction · 0.92
ValuePathFunction · 0.92
setCaseFunction · 0.92
TestLimitNeighborsFunction · 0.92
TestSelector_OrderByExprFunction · 0.85
TestSelector_SelectExprFunction · 0.85
TestMultipleFromFunction · 0.85
SetExcludedMethod · 0.85

Calls

no outgoing calls

Tested by 8

SelectFunction · 0.74
TestLimitNeighborsFunction · 0.74
TestSelector_OrderByExprFunction · 0.68
TestSelector_SelectExprFunction · 0.68
TestMultipleFromFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…