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

Method NotIn

dialect/sql/builder.go:1107–1123  ·  view source on GitHub ↗

NotIn appends the `Not IN` predicate.

(col string, args ...any)

Source from the content-addressed store, hash-verified

1105
1106// NotIn appends the `Not IN` predicate.
1107func (p *Predicate) NotIn(col string, args ...any) *Predicate {
1108 // If no arguments were provided, append the NOT FALSE constant, since
1109 // we cannot apply "NOT IN ()". This will make this predicate truthy.
1110 if len(args) == 0 {
1111 return Not(p.False())
1112 }
1113 return p.Append(func(b *Builder) {
1114 b.Ident(col).WriteOp(OpNotIn)
1115 b.Wrap(func(b *Builder) {
1116 if s, ok := args[0].(*Selector); ok {
1117 b.Join(s)
1118 } else {
1119 b.Args(args...)
1120 }
1121 })
1122 })
1123}
1124
1125// Exists returns the `Exists` predicate.
1126func Exists(query Querier) *Predicate {

Callers 1

NotInFunction · 0.80

Calls 8

FalseMethod · 0.95
AppendMethod · 0.95
WriteOpMethod · 0.80
IdentMethod · 0.80
WrapMethod · 0.80
ArgsMethod · 0.80
NotFunction · 0.70
JoinMethod · 0.45

Tested by

no test coverage detected