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

Function FieldIn

dialect/sql/sql.go:124–132  ·  view source on GitHub ↗

FieldIn returns a raw predicate to check if the value of the field is IN the given values.

(name string, vs ...T)

Source from the content-addressed store, hash-verified

122
123// FieldIn returns a raw predicate to check if the value of the field is IN the given values.
124func FieldIn[T any](name string, vs ...T) func(*Selector) {
125 return func(s *Selector) {
126 v := make([]any, len(vs))
127 for i := range v {
128 v[i] = vs[i]
129 }
130 s.Where(In(s.C(name), v...))
131 }
132}
133
134// FieldNotIn returns a raw predicate to check if the value of the field is NOT IN the given values.
135func FieldNotIn[T any](name string, vs ...T) func(*Selector) {

Callers 15

IDInFunction · 0.92
OidInFunction · 0.92
IDInFunction · 0.92
SourceInFunction · 0.92
SourceURIInFunction · 0.92
TextInFunction · 0.92
IDInFunction · 0.92
MixedStringInFunction · 0.92
MixedEnumInFunction · 0.92
AgeInFunction · 0.92
NameInFunction · 0.92
DescriptionInFunction · 0.92

Calls 3

InFunction · 0.70
WhereMethod · 0.65
CMethod · 0.65

Tested by 1

TestFieldInFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…