entc/predicate: add isnull/notnull predicates for codegen

Reviewed By: idoshveki

Differential Revision: D16687226

fbshipit-source-id: 14a39e066447dbf77413e5c7f7318a2d61bddd32
This commit is contained in:
Ariel Mashraki
2019-08-07 06:53:00 -07:00
committed by Facebook Github Bot
parent 23059c8bae
commit 25f5a2ef01
27 changed files with 1060 additions and 44 deletions

View File

@@ -466,6 +466,24 @@ func AddressHasSuffix(v string) predicate.User {
)
}
// AddressIsNull applies the IsNull predicate on the "address" field.
func AddressIsNull() predicate.User {
return predicate.User(
func(s *sql.Selector) {
s.Where(sql.IsNull(s.C(FieldAddress)))
},
)
}
// AddressNotNull applies the NotNull predicate on the "address" field.
func AddressNotNull() predicate.User {
return predicate.User(
func(s *sql.Selector) {
s.Where(sql.NotNull(s.C(FieldAddress)))
},
)
}
// And groups list of predicates with the AND operator between them.
func And(predicates ...predicate.User) predicate.User {
return predicate.User(