MCPcopy
hub / github.com/ent/ent / TestNotPredicates

Function TestNotPredicates

dialect/sql/sql_test.go:464–471  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

462}
463
464func TestNotPredicates(t *testing.T) {
465 s := Select("*").From(Table("users")).Where(EQ("name", "a8m"))
466 NotPredicates(FieldEQ("a", "a"), FieldEQ("b", "b"))(s)
467 NotPredicates(FieldEQ("c", "c"))(s)
468 query, args := s.Query()
469 require.Equal(t, "SELECT * FROM `users` WHERE (`name` = ? AND (NOT (`users`.`a` = ? AND `users`.`b` = ?))) AND (NOT (`users`.`c` = ?))", query)
470 require.Equal(t, []any{"a8m", "a", "b", "c"}, args)
471}

Callers

nothing calls this directly

Calls 8

NotPredicatesFunction · 0.85
SelectFunction · 0.70
TableFunction · 0.70
EQFunction · 0.70
FieldEQFunction · 0.70
WhereMethod · 0.65
QueryMethod · 0.65
FromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…