MCPcopy
hub / github.com/ent/ent / valueInOp

Function valueInOp

dialect/sql/sqljson/sqljson.go:252–270  ·  view source on GitHub ↗
(column string, args []any, opts []Option, op sql.Op)

Source from the content-addressed store, hash-verified

250}
251
252func valueInOp(column string, args []any, opts []Option, op sql.Op) *sql.Predicate {
253 return sql.P(func(b *sql.Builder) {
254 if allString(args) {
255 opts = append(opts, Unquote(true))
256 }
257 if len(args) > 0 {
258 opts = normalizePG(b, args[0], opts)
259 }
260 valuePath(b, column, opts...)
261 b.WriteOp(op)
262 b.Wrap(func(b *sql.Builder) {
263 if s, ok := args[0].(*sql.Selector); ok {
264 b.Join(s)
265 } else {
266 b.Args(args...)
267 }
268 })
269 })
270}
271
272// LenEQ return a predicate for checking that an array length
273// of a JSON (returned by the path) is equal to the given argument.

Callers 2

ValueInFunction · 0.85
ValueNotInFunction · 0.85

Calls 9

PStruct · 0.92
allStringFunction · 0.85
UnquoteFunction · 0.85
normalizePGFunction · 0.85
valuePathFunction · 0.85
WriteOpMethod · 0.80
WrapMethod · 0.80
ArgsMethod · 0.80
JoinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…