mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
entc/gen: add EqualFold and ContainsFold to string IDs (#3382)
This commit is contained in:
@@ -57,6 +57,16 @@ func IDLTE(id string) predicate.Pet {
|
||||
return predicate.Pet(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEqualFold applies the EqualFold predicate on the ID field.
|
||||
func IDEqualFold(id string) predicate.Pet {
|
||||
return predicate.Pet(sql.FieldEqualFold(FieldID, id))
|
||||
}
|
||||
|
||||
// IDContainsFold applies the ContainsFold predicate on the ID field.
|
||||
func IDContainsFold(id string) predicate.Pet {
|
||||
return predicate.Pet(sql.FieldContainsFold(FieldID, id))
|
||||
}
|
||||
|
||||
// HasOwner applies the HasEdge predicate on the "owner" edge.
|
||||
func HasOwner() predicate.Pet {
|
||||
return predicate.Pet(func(s *sql.Selector) {
|
||||
|
||||
@@ -56,6 +56,16 @@ func IDLTE(id string) predicate.Revision {
|
||||
return predicate.Revision(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEqualFold applies the EqualFold predicate on the ID field.
|
||||
func IDEqualFold(id string) predicate.Revision {
|
||||
return predicate.Revision(sql.FieldEqualFold(FieldID, id))
|
||||
}
|
||||
|
||||
// IDContainsFold applies the ContainsFold predicate on the ID field.
|
||||
func IDContainsFold(id string) predicate.Revision {
|
||||
return predicate.Revision(sql.FieldContainsFold(FieldID, id))
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Revision) predicate.Revision {
|
||||
return predicate.Revision(func(s *sql.Selector) {
|
||||
|
||||
@@ -56,6 +56,16 @@ func IDLTE(id string) predicate.Item {
|
||||
return predicate.Item(sql.FieldLTE(FieldID, id))
|
||||
}
|
||||
|
||||
// IDEqualFold applies the EqualFold predicate on the ID field.
|
||||
func IDEqualFold(id string) predicate.Item {
|
||||
return predicate.Item(sql.FieldEqualFold(FieldID, id))
|
||||
}
|
||||
|
||||
// IDContainsFold applies the ContainsFold predicate on the ID field.
|
||||
func IDContainsFold(id string) predicate.Item {
|
||||
return predicate.Item(sql.FieldContainsFold(FieldID, id))
|
||||
}
|
||||
|
||||
// Text applies equality check predicate on the "text" field. It's identical to TextEQ.
|
||||
func Text(v string) predicate.Item {
|
||||
return predicate.Item(sql.FieldEQ(FieldText, v))
|
||||
|
||||
Reference in New Issue
Block a user