The following helpers exist to simplify the way raw predicates are defined and used in both ent/schema and generated code. For full predicates API, check out the sql.P in builder.go. FieldIsNull returns a raw predicate to check if the given field is NULL.
(name string)
| 17 | |
| 18 | // FieldIsNull returns a raw predicate to check if the given field is NULL. |
| 19 | func FieldIsNull(name string) func(*Selector) { |
| 20 | return func(s *Selector) { |
| 21 | s.Where(IsNull(s.C(name))) |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | // FieldNotNull returns a raw predicate to check if the given field is not NULL. |
| 26 | func FieldNotNull(name string) func(*Selector) { |
searching dependent graphs…