123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514 |
- // Code generated by entc, DO NOT EDIT.
- package todo
- import (
- "time"
- "todo/ent/predicate"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- // ID filters vertices based on their ID field.
- func ID(id int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldID), id))
- })
- }
- // IDEQ applies the EQ predicate on the ID field.
- func IDEQ(id int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldID), id))
- })
- }
- // IDNEQ applies the NEQ predicate on the ID field.
- func IDNEQ(id int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldID), id))
- })
- }
- // IDIn applies the In predicate on the ID field.
- func IDIn(ids ...int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(ids) == 0 {
- s.Where(sql.False())
- return
- }
- v := make([]interface{}, len(ids))
- for i := range v {
- v[i] = ids[i]
- }
- s.Where(sql.In(s.C(FieldID), v...))
- })
- }
- // IDNotIn applies the NotIn predicate on the ID field.
- func IDNotIn(ids ...int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(ids) == 0 {
- s.Where(sql.False())
- return
- }
- v := make([]interface{}, len(ids))
- for i := range v {
- v[i] = ids[i]
- }
- s.Where(sql.NotIn(s.C(FieldID), v...))
- })
- }
- // IDGT applies the GT predicate on the ID field.
- func IDGT(id int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldID), id))
- })
- }
- // IDGTE applies the GTE predicate on the ID field.
- func IDGTE(id int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldID), id))
- })
- }
- // IDLT applies the LT predicate on the ID field.
- func IDLT(id int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldID), id))
- })
- }
- // IDLTE applies the LTE predicate on the ID field.
- func IDLTE(id int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldID), id))
- })
- }
- // Text applies equality check predicate on the "text" field. It's identical to TextEQ.
- func Text(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldText), v))
- })
- }
- // CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
- func CreatedAt(v time.Time) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldCreatedAt), v))
- })
- }
- // Priority applies equality check predicate on the "priority" field. It's identical to PriorityEQ.
- func Priority(v int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldPriority), v))
- })
- }
- // TextEQ applies the EQ predicate on the "text" field.
- func TextEQ(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldText), v))
- })
- }
- // TextNEQ applies the NEQ predicate on the "text" field.
- func TextNEQ(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldText), v))
- })
- }
- // TextIn applies the In predicate on the "text" field.
- func TextIn(vs ...string) predicate.Todo {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Todo(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldText), v...))
- })
- }
- // TextNotIn applies the NotIn predicate on the "text" field.
- func TextNotIn(vs ...string) predicate.Todo {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Todo(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldText), v...))
- })
- }
- // TextGT applies the GT predicate on the "text" field.
- func TextGT(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldText), v))
- })
- }
- // TextGTE applies the GTE predicate on the "text" field.
- func TextGTE(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldText), v))
- })
- }
- // TextLT applies the LT predicate on the "text" field.
- func TextLT(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldText), v))
- })
- }
- // TextLTE applies the LTE predicate on the "text" field.
- func TextLTE(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldText), v))
- })
- }
- // TextContains applies the Contains predicate on the "text" field.
- func TextContains(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.Contains(s.C(FieldText), v))
- })
- }
- // TextHasPrefix applies the HasPrefix predicate on the "text" field.
- func TextHasPrefix(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.HasPrefix(s.C(FieldText), v))
- })
- }
- // TextHasSuffix applies the HasSuffix predicate on the "text" field.
- func TextHasSuffix(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.HasSuffix(s.C(FieldText), v))
- })
- }
- // TextEqualFold applies the EqualFold predicate on the "text" field.
- func TextEqualFold(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.EqualFold(s.C(FieldText), v))
- })
- }
- // TextContainsFold applies the ContainsFold predicate on the "text" field.
- func TextContainsFold(v string) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.ContainsFold(s.C(FieldText), v))
- })
- }
- // CreatedAtEQ applies the EQ predicate on the "created_at" field.
- func CreatedAtEQ(v time.Time) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldCreatedAt), v))
- })
- }
- // CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
- func CreatedAtNEQ(v time.Time) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldCreatedAt), v))
- })
- }
- // CreatedAtIn applies the In predicate on the "created_at" field.
- func CreatedAtIn(vs ...time.Time) predicate.Todo {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Todo(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldCreatedAt), v...))
- })
- }
- // CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
- func CreatedAtNotIn(vs ...time.Time) predicate.Todo {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Todo(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldCreatedAt), v...))
- })
- }
- // CreatedAtGT applies the GT predicate on the "created_at" field.
- func CreatedAtGT(v time.Time) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldCreatedAt), v))
- })
- }
- // CreatedAtGTE applies the GTE predicate on the "created_at" field.
- func CreatedAtGTE(v time.Time) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldCreatedAt), v))
- })
- }
- // CreatedAtLT applies the LT predicate on the "created_at" field.
- func CreatedAtLT(v time.Time) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldCreatedAt), v))
- })
- }
- // CreatedAtLTE applies the LTE predicate on the "created_at" field.
- func CreatedAtLTE(v time.Time) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldCreatedAt), v))
- })
- }
- // StatusEQ applies the EQ predicate on the "status" field.
- func StatusEQ(v Status) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldStatus), v))
- })
- }
- // StatusNEQ applies the NEQ predicate on the "status" field.
- func StatusNEQ(v Status) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldStatus), v))
- })
- }
- // StatusIn applies the In predicate on the "status" field.
- func StatusIn(vs ...Status) predicate.Todo {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Todo(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldStatus), v...))
- })
- }
- // StatusNotIn applies the NotIn predicate on the "status" field.
- func StatusNotIn(vs ...Status) predicate.Todo {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Todo(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldStatus), v...))
- })
- }
- // PriorityEQ applies the EQ predicate on the "priority" field.
- func PriorityEQ(v int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldPriority), v))
- })
- }
- // PriorityNEQ applies the NEQ predicate on the "priority" field.
- func PriorityNEQ(v int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldPriority), v))
- })
- }
- // PriorityIn applies the In predicate on the "priority" field.
- func PriorityIn(vs ...int) predicate.Todo {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Todo(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldPriority), v...))
- })
- }
- // PriorityNotIn applies the NotIn predicate on the "priority" field.
- func PriorityNotIn(vs ...int) predicate.Todo {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Todo(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldPriority), v...))
- })
- }
- // PriorityGT applies the GT predicate on the "priority" field.
- func PriorityGT(v int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldPriority), v))
- })
- }
- // PriorityGTE applies the GTE predicate on the "priority" field.
- func PriorityGTE(v int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldPriority), v))
- })
- }
- // PriorityLT applies the LT predicate on the "priority" field.
- func PriorityLT(v int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldPriority), v))
- })
- }
- // PriorityLTE applies the LTE predicate on the "priority" field.
- func PriorityLTE(v int) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldPriority), v))
- })
- }
- // HasChildren applies the HasEdge predicate on the "children" edge.
- func HasChildren() predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(ChildrenTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, true, ChildrenTable, ChildrenColumn),
- )
- sqlgraph.HasNeighbors(s, step)
- })
- }
- // HasChildrenWith applies the HasEdge predicate on the "children" edge with a given conditions (other predicates).
- func HasChildrenWith(preds ...predicate.Todo) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(Table, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, true, ChildrenTable, ChildrenColumn),
- )
- sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
- for _, p := range preds {
- p(s)
- }
- })
- })
- }
- // HasParent applies the HasEdge predicate on the "parent" edge.
- func HasParent() predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(ParentTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, false, ParentTable, ParentColumn),
- )
- sqlgraph.HasNeighbors(s, step)
- })
- }
- // HasParentWith applies the HasEdge predicate on the "parent" edge with a given conditions (other predicates).
- func HasParentWith(preds ...predicate.Todo) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(Table, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, false, ParentTable, ParentColumn),
- )
- sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
- for _, p := range preds {
- p(s)
- }
- })
- })
- }
- // And groups predicates with the AND operator between them.
- func And(predicates ...predicate.Todo) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s1 := s.Clone().SetP(nil)
- for _, p := range predicates {
- p(s1)
- }
- s.Where(s1.P())
- })
- }
- // Or groups predicates with the OR operator between them.
- func Or(predicates ...predicate.Todo) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- s1 := s.Clone().SetP(nil)
- for i, p := range predicates {
- if i > 0 {
- s1.Or()
- }
- p(s1)
- }
- s.Where(s1.P())
- })
- }
- // Not applies the not operator on the given predicate.
- func Not(p predicate.Todo) predicate.Todo {
- return predicate.Todo(func(s *sql.Selector) {
- p(s.Not())
- })
- }
|