MCPcopy Index your code
hub / github.com/ent/ent / StringContains

Function StringContains

dialect/sql/sqljson/sqljson.go:225–231  ·  view source on GitHub ↗

StringContains return a predicate for checking that a JSON string value (returned by the path) contains the given substring

(column string, sub string, opts ...Option)

Source from the content-addressed store, hash-verified

223// StringContains return a predicate for checking that a JSON string value
224// (returned by the path) contains the given substring
225func StringContains(column string, sub string, opts ...Option) *sql.Predicate {
226 return sql.P(func(b *sql.Builder) {
227 opts = append([]Option{Unquote(true)}, opts...)
228 valuePath(b, column, opts...)
229 b.Join(sql.Contains("", sub))
230 })
231}
232
233// ValueIn return a predicate for checking that a JSON value
234// (returned by the path) is IN the given arguments.

Callers 2

PredicatesFunction · 0.92
TestWritePathFunction · 0.92

Calls 5

PStruct · 0.92
ContainsFunction · 0.92
UnquoteFunction · 0.85
valuePathFunction · 0.85
JoinMethod · 0.45

Tested by 2

PredicatesFunction · 0.74
TestWritePathFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…