MCPcopy
hub / github.com/ent/ent / LenPath

Function LenPath

dialect/sql/sqljson/sqljson.go:344–348  ·  view source on GitHub ↗

LenPath returns an SQL expression for getting the length of a JSON value (returned by the path).

(column string, opts ...Option)

Source from the content-addressed store, hash-verified

342// LenPath returns an SQL expression for getting the length
343// of a JSON value (returned by the path).
344func LenPath(column string, opts ...Option) sql.Querier {
345 return sql.ExprFunc(func(b *sql.Builder) {
346 lenPath(b, column, opts...)
347 })
348}
349
350// OrderLen returns a custom predicate function (as defined in the doc),
351// that sets the result order by the length of the given JSON value.

Callers 3

TestWritePathFunction · 0.92
OrderLenFunction · 0.85
OrderLenDescFunction · 0.85

Calls 2

ExprFuncFunction · 0.92
lenPathFunction · 0.85

Tested by 1

TestWritePathFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…