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

Function StringHasPrefix

dialect/sql/sqljson/sqljson.go:205–211  ·  view source on GitHub ↗

StringHasPrefix return a predicate for checking that a JSON string value (returned by the path) has the given substring as prefix

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

Source from the content-addressed store, hash-verified

203// StringHasPrefix return a predicate for checking that a JSON string value
204// (returned by the path) has the given substring as prefix
205func StringHasPrefix(column string, prefix string, opts ...Option) *sql.Predicate {
206 return sql.P(func(b *sql.Builder) {
207 opts = append([]Option{Unquote(true)}, opts...)
208 valuePath(b, column, opts...)
209 b.Join(sql.HasPrefix("", prefix))
210 })
211}
212
213// StringHasSuffix return a predicate for checking that a JSON string value
214// (returned by the path) has the given substring as suffix

Callers 2

PredicatesFunction · 0.92
TestWritePathFunction · 0.92

Calls 5

PStruct · 0.92
HasPrefixFunction · 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…