MCPcopy
hub / github.com/ent/ent / EQ

Method EQ

dialect/sql/builder.go:867–883  ·  view source on GitHub ↗

EQ appends a "=" predicate.

(col string, arg any)

Source from the content-addressed store, hash-verified

865
866// EQ appends a "=" predicate.
867func (p *Predicate) EQ(col string, arg any) *Predicate {
868 // A small optimization to avoid passing
869 // arguments when it can be avoided.
870 switch arg := arg.(type) {
871 case bool:
872 if arg {
873 return IsTrue(col)
874 }
875 return IsFalse(col)
876 default:
877 return p.Append(func(b *Builder) {
878 b.Ident(col)
879 b.WriteOp(OpEQ)
880 p.arg(b, arg)
881 })
882 }
883}
884
885// ColumnsEQ appends a "=" predicate between 2 columns.
886func ColumnsEQ(col1, col2 string) *Predicate {

Callers 2

TestBuilderFunction · 0.80
EQFunction · 0.80

Calls 6

AppendMethod · 0.95
argMethod · 0.95
IsTrueFunction · 0.85
IsFalseFunction · 0.85
IdentMethod · 0.80
WriteOpMethod · 0.80

Tested by 1

TestBuilderFunction · 0.64