123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742 |
- // Code generated by entc, DO NOT EDIT.
- package user
- import (
- "code.osinet.fr/fgm/go__ent_demo/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.User {
- return predicate.User(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.User {
- return predicate.User(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.User {
- return predicate.User(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.User {
- return predicate.User(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.User {
- return predicate.User(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.User {
- return predicate.User(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.User {
- return predicate.User(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.User {
- return predicate.User(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.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldID), id))
- })
- }
- // Age applies equality check predicate on the "age" field. It's identical to AgeEQ.
- func Age(v int) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldAge), v))
- })
- }
- // Name applies equality check predicate on the "name" field. It's identical to NameEQ.
- func Name(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldName), v))
- })
- }
- // Password applies equality check predicate on the "password" field. It's identical to PasswordEQ.
- func Password(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldPassword), v))
- })
- }
- // SpouseID applies equality check predicate on the "spouse_id" field. It's identical to SpouseIDEQ.
- func SpouseID(v int) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldSpouseID), v))
- })
- }
- // AgeEQ applies the EQ predicate on the "age" field.
- func AgeEQ(v int) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldAge), v))
- })
- }
- // AgeNEQ applies the NEQ predicate on the "age" field.
- func AgeNEQ(v int) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldAge), v))
- })
- }
- // AgeIn applies the In predicate on the "age" field.
- func AgeIn(vs ...int) predicate.User {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.User(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(FieldAge), v...))
- })
- }
- // AgeNotIn applies the NotIn predicate on the "age" field.
- func AgeNotIn(vs ...int) predicate.User {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.User(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(FieldAge), v...))
- })
- }
- // AgeGT applies the GT predicate on the "age" field.
- func AgeGT(v int) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldAge), v))
- })
- }
- // AgeGTE applies the GTE predicate on the "age" field.
- func AgeGTE(v int) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldAge), v))
- })
- }
- // AgeLT applies the LT predicate on the "age" field.
- func AgeLT(v int) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldAge), v))
- })
- }
- // AgeLTE applies the LTE predicate on the "age" field.
- func AgeLTE(v int) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldAge), v))
- })
- }
- // NameEQ applies the EQ predicate on the "name" field.
- func NameEQ(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldName), v))
- })
- }
- // NameNEQ applies the NEQ predicate on the "name" field.
- func NameNEQ(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldName), v))
- })
- }
- // NameIn applies the In predicate on the "name" field.
- func NameIn(vs ...string) predicate.User {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.User(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(FieldName), v...))
- })
- }
- // NameNotIn applies the NotIn predicate on the "name" field.
- func NameNotIn(vs ...string) predicate.User {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.User(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(FieldName), v...))
- })
- }
- // NameGT applies the GT predicate on the "name" field.
- func NameGT(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldName), v))
- })
- }
- // NameGTE applies the GTE predicate on the "name" field.
- func NameGTE(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldName), v))
- })
- }
- // NameLT applies the LT predicate on the "name" field.
- func NameLT(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldName), v))
- })
- }
- // NameLTE applies the LTE predicate on the "name" field.
- func NameLTE(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldName), v))
- })
- }
- // NameContains applies the Contains predicate on the "name" field.
- func NameContains(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.Contains(s.C(FieldName), v))
- })
- }
- // NameHasPrefix applies the HasPrefix predicate on the "name" field.
- func NameHasPrefix(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.HasPrefix(s.C(FieldName), v))
- })
- }
- // NameHasSuffix applies the HasSuffix predicate on the "name" field.
- func NameHasSuffix(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.HasSuffix(s.C(FieldName), v))
- })
- }
- // NameEqualFold applies the EqualFold predicate on the "name" field.
- func NameEqualFold(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.EqualFold(s.C(FieldName), v))
- })
- }
- // NameContainsFold applies the ContainsFold predicate on the "name" field.
- func NameContainsFold(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.ContainsFold(s.C(FieldName), v))
- })
- }
- // PasswordEQ applies the EQ predicate on the "password" field.
- func PasswordEQ(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldPassword), v))
- })
- }
- // PasswordNEQ applies the NEQ predicate on the "password" field.
- func PasswordNEQ(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldPassword), v))
- })
- }
- // PasswordIn applies the In predicate on the "password" field.
- func PasswordIn(vs ...string) predicate.User {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.User(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(FieldPassword), v...))
- })
- }
- // PasswordNotIn applies the NotIn predicate on the "password" field.
- func PasswordNotIn(vs ...string) predicate.User {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.User(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(FieldPassword), v...))
- })
- }
- // PasswordGT applies the GT predicate on the "password" field.
- func PasswordGT(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldPassword), v))
- })
- }
- // PasswordGTE applies the GTE predicate on the "password" field.
- func PasswordGTE(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldPassword), v))
- })
- }
- // PasswordLT applies the LT predicate on the "password" field.
- func PasswordLT(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldPassword), v))
- })
- }
- // PasswordLTE applies the LTE predicate on the "password" field.
- func PasswordLTE(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldPassword), v))
- })
- }
- // PasswordContains applies the Contains predicate on the "password" field.
- func PasswordContains(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.Contains(s.C(FieldPassword), v))
- })
- }
- // PasswordHasPrefix applies the HasPrefix predicate on the "password" field.
- func PasswordHasPrefix(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.HasPrefix(s.C(FieldPassword), v))
- })
- }
- // PasswordHasSuffix applies the HasSuffix predicate on the "password" field.
- func PasswordHasSuffix(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.HasSuffix(s.C(FieldPassword), v))
- })
- }
- // PasswordIsNil applies the IsNil predicate on the "password" field.
- func PasswordIsNil() predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.IsNull(s.C(FieldPassword)))
- })
- }
- // PasswordNotNil applies the NotNil predicate on the "password" field.
- func PasswordNotNil() predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.NotNull(s.C(FieldPassword)))
- })
- }
- // PasswordEqualFold applies the EqualFold predicate on the "password" field.
- func PasswordEqualFold(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.EqualFold(s.C(FieldPassword), v))
- })
- }
- // PasswordContainsFold applies the ContainsFold predicate on the "password" field.
- func PasswordContainsFold(v string) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.ContainsFold(s.C(FieldPassword), v))
- })
- }
- // SizeEQ applies the EQ predicate on the "size" field.
- func SizeEQ(v Size) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldSize), v))
- })
- }
- // SizeNEQ applies the NEQ predicate on the "size" field.
- func SizeNEQ(v Size) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldSize), v))
- })
- }
- // SizeIn applies the In predicate on the "size" field.
- func SizeIn(vs ...Size) predicate.User {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.User(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(FieldSize), v...))
- })
- }
- // SizeNotIn applies the NotIn predicate on the "size" field.
- func SizeNotIn(vs ...Size) predicate.User {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.User(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(FieldSize), v...))
- })
- }
- // SpouseIDEQ applies the EQ predicate on the "spouse_id" field.
- func SpouseIDEQ(v int) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldSpouseID), v))
- })
- }
- // SpouseIDNEQ applies the NEQ predicate on the "spouse_id" field.
- func SpouseIDNEQ(v int) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldSpouseID), v))
- })
- }
- // SpouseIDIn applies the In predicate on the "spouse_id" field.
- func SpouseIDIn(vs ...int) predicate.User {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.User(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(FieldSpouseID), v...))
- })
- }
- // SpouseIDNotIn applies the NotIn predicate on the "spouse_id" field.
- func SpouseIDNotIn(vs ...int) predicate.User {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.User(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(FieldSpouseID), v...))
- })
- }
- // SpouseIDIsNil applies the IsNil predicate on the "spouse_id" field.
- func SpouseIDIsNil() predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.IsNull(s.C(FieldSpouseID)))
- })
- }
- // SpouseIDNotNil applies the NotNil predicate on the "spouse_id" field.
- func SpouseIDNotNil() predicate.User {
- return predicate.User(func(s *sql.Selector) {
- s.Where(sql.NotNull(s.C(FieldSpouseID)))
- })
- }
- // HasCars applies the HasEdge predicate on the "cars" edge.
- func HasCars() predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(CarsTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, false, CarsTable, CarsColumn),
- )
- sqlgraph.HasNeighbors(s, step)
- })
- }
- // HasCarsWith applies the HasEdge predicate on the "cars" edge with a given conditions (other predicates).
- func HasCarsWith(preds ...predicate.Car) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(CarsInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, false, CarsTable, CarsColumn),
- )
- sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
- for _, p := range preds {
- p(s)
- }
- })
- })
- }
- // HasGroups applies the HasEdge predicate on the "groups" edge.
- func HasGroups() predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(GroupsTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2M, true, GroupsTable, GroupsPrimaryKey...),
- )
- sqlgraph.HasNeighbors(s, step)
- })
- }
- // HasGroupsWith applies the HasEdge predicate on the "groups" edge with a given conditions (other predicates).
- func HasGroupsWith(preds ...predicate.Group) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(GroupsInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2M, true, GroupsTable, GroupsPrimaryKey...),
- )
- sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
- for _, p := range preds {
- p(s)
- }
- })
- })
- }
- // HasSpouse applies the HasEdge predicate on the "spouse" edge.
- func HasSpouse() predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(SpouseTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2O, false, SpouseTable, SpouseColumn),
- )
- sqlgraph.HasNeighbors(s, step)
- })
- }
- // HasSpouseWith applies the HasEdge predicate on the "spouse" edge with a given conditions (other predicates).
- func HasSpouseWith(preds ...predicate.User) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(Table, FieldID),
- sqlgraph.Edge(sqlgraph.O2O, false, SpouseTable, SpouseColumn),
- )
- sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
- for _, p := range preds {
- p(s)
- }
- })
- })
- }
- // HasFollowers applies the HasEdge predicate on the "followers" edge.
- func HasFollowers() predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(FollowersTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2M, true, FollowersTable, FollowersPrimaryKey...),
- )
- sqlgraph.HasNeighbors(s, step)
- })
- }
- // HasFollowersWith applies the HasEdge predicate on the "followers" edge with a given conditions (other predicates).
- func HasFollowersWith(preds ...predicate.User) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(Table, FieldID),
- sqlgraph.Edge(sqlgraph.M2M, true, FollowersTable, FollowersPrimaryKey...),
- )
- sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
- for _, p := range preds {
- p(s)
- }
- })
- })
- }
- // HasFollowing applies the HasEdge predicate on the "following" edge.
- func HasFollowing() predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(FollowingTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2M, false, FollowingTable, FollowingPrimaryKey...),
- )
- sqlgraph.HasNeighbors(s, step)
- })
- }
- // HasFollowingWith applies the HasEdge predicate on the "following" edge with a given conditions (other predicates).
- func HasFollowingWith(preds ...predicate.User) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(Table, FieldID),
- sqlgraph.Edge(sqlgraph.M2M, false, FollowingTable, FollowingPrimaryKey...),
- )
- sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
- for _, p := range preds {
- p(s)
- }
- })
- })
- }
- // HasFriends applies the HasEdge predicate on the "friends" edge.
- func HasFriends() predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(FriendsTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2M, false, FriendsTable, FriendsPrimaryKey...),
- )
- sqlgraph.HasNeighbors(s, step)
- })
- }
- // HasFriendsWith applies the HasEdge predicate on the "friends" edge with a given conditions (other predicates).
- func HasFriendsWith(preds ...predicate.User) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(Table, FieldID),
- sqlgraph.Edge(sqlgraph.M2M, false, FriendsTable, FriendsPrimaryKey...),
- )
- 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.User) predicate.User {
- return predicate.User(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.User) predicate.User {
- return predicate.User(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.User) predicate.User {
- return predicate.User(func(s *sql.Selector) {
- p(s.Not())
- })
- }
|