// 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()) }) }