import from unified repo
This commit is contained in:
776
ent/stats/where.go
Normal file
776
ent/stats/where.go
Normal file
@@ -0,0 +1,776 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
|
||||
package stats
|
||||
|
||||
import (
|
||||
"csgowtfd/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.Stats {
|
||||
return predicate.Stats(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.Stats {
|
||||
return predicate.Stats(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.Stats {
|
||||
return predicate.Stats(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.Stats {
|
||||
return predicate.Stats(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.Stats {
|
||||
return predicate.Stats(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.Stats {
|
||||
return predicate.Stats(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.Stats {
|
||||
return predicate.Stats(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.Stats {
|
||||
return predicate.Stats(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.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// TeamID applies equality check predicate on the "team_id" field. It's identical to TeamIDEQ.
|
||||
func TeamID(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldTeamID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Kills applies equality check predicate on the "kills" field. It's identical to KillsEQ.
|
||||
func Kills(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldKills), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Deaths applies equality check predicate on the "deaths" field. It's identical to DeathsEQ.
|
||||
func Deaths(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldDeaths), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Assists applies equality check predicate on the "assists" field. It's identical to AssistsEQ.
|
||||
func Assists(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldAssists), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Headshot applies equality check predicate on the "headshot" field. It's identical to HeadshotEQ.
|
||||
func Headshot(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldHeadshot), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Mvp applies equality check predicate on the "mvp" field. It's identical to MvpEQ.
|
||||
func Mvp(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldMvp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Score applies equality check predicate on the "score" field. It's identical to ScoreEQ.
|
||||
func Score(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldScore), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TeamIDEQ applies the EQ predicate on the "team_id" field.
|
||||
func TeamIDEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldTeamID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TeamIDNEQ applies the NEQ predicate on the "team_id" field.
|
||||
func TeamIDNEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldTeamID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TeamIDIn applies the In predicate on the "team_id" field.
|
||||
func TeamIDIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldTeamID), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// TeamIDNotIn applies the NotIn predicate on the "team_id" field.
|
||||
func TeamIDNotIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldTeamID), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// TeamIDGT applies the GT predicate on the "team_id" field.
|
||||
func TeamIDGT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldTeamID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TeamIDGTE applies the GTE predicate on the "team_id" field.
|
||||
func TeamIDGTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldTeamID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TeamIDLT applies the LT predicate on the "team_id" field.
|
||||
func TeamIDLT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldTeamID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// TeamIDLTE applies the LTE predicate on the "team_id" field.
|
||||
func TeamIDLTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldTeamID), v))
|
||||
})
|
||||
}
|
||||
|
||||
// KillsEQ applies the EQ predicate on the "kills" field.
|
||||
func KillsEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldKills), v))
|
||||
})
|
||||
}
|
||||
|
||||
// KillsNEQ applies the NEQ predicate on the "kills" field.
|
||||
func KillsNEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldKills), v))
|
||||
})
|
||||
}
|
||||
|
||||
// KillsIn applies the In predicate on the "kills" field.
|
||||
func KillsIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldKills), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// KillsNotIn applies the NotIn predicate on the "kills" field.
|
||||
func KillsNotIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldKills), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// KillsGT applies the GT predicate on the "kills" field.
|
||||
func KillsGT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldKills), v))
|
||||
})
|
||||
}
|
||||
|
||||
// KillsGTE applies the GTE predicate on the "kills" field.
|
||||
func KillsGTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldKills), v))
|
||||
})
|
||||
}
|
||||
|
||||
// KillsLT applies the LT predicate on the "kills" field.
|
||||
func KillsLT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldKills), v))
|
||||
})
|
||||
}
|
||||
|
||||
// KillsLTE applies the LTE predicate on the "kills" field.
|
||||
func KillsLTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldKills), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DeathsEQ applies the EQ predicate on the "deaths" field.
|
||||
func DeathsEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldDeaths), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DeathsNEQ applies the NEQ predicate on the "deaths" field.
|
||||
func DeathsNEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldDeaths), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DeathsIn applies the In predicate on the "deaths" field.
|
||||
func DeathsIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldDeaths), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// DeathsNotIn applies the NotIn predicate on the "deaths" field.
|
||||
func DeathsNotIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldDeaths), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// DeathsGT applies the GT predicate on the "deaths" field.
|
||||
func DeathsGT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldDeaths), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DeathsGTE applies the GTE predicate on the "deaths" field.
|
||||
func DeathsGTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldDeaths), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DeathsLT applies the LT predicate on the "deaths" field.
|
||||
func DeathsLT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldDeaths), v))
|
||||
})
|
||||
}
|
||||
|
||||
// DeathsLTE applies the LTE predicate on the "deaths" field.
|
||||
func DeathsLTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldDeaths), v))
|
||||
})
|
||||
}
|
||||
|
||||
// AssistsEQ applies the EQ predicate on the "assists" field.
|
||||
func AssistsEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldAssists), v))
|
||||
})
|
||||
}
|
||||
|
||||
// AssistsNEQ applies the NEQ predicate on the "assists" field.
|
||||
func AssistsNEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldAssists), v))
|
||||
})
|
||||
}
|
||||
|
||||
// AssistsIn applies the In predicate on the "assists" field.
|
||||
func AssistsIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldAssists), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// AssistsNotIn applies the NotIn predicate on the "assists" field.
|
||||
func AssistsNotIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldAssists), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// AssistsGT applies the GT predicate on the "assists" field.
|
||||
func AssistsGT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldAssists), v))
|
||||
})
|
||||
}
|
||||
|
||||
// AssistsGTE applies the GTE predicate on the "assists" field.
|
||||
func AssistsGTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldAssists), v))
|
||||
})
|
||||
}
|
||||
|
||||
// AssistsLT applies the LT predicate on the "assists" field.
|
||||
func AssistsLT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldAssists), v))
|
||||
})
|
||||
}
|
||||
|
||||
// AssistsLTE applies the LTE predicate on the "assists" field.
|
||||
func AssistsLTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldAssists), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HeadshotEQ applies the EQ predicate on the "headshot" field.
|
||||
func HeadshotEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldHeadshot), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HeadshotNEQ applies the NEQ predicate on the "headshot" field.
|
||||
func HeadshotNEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldHeadshot), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HeadshotIn applies the In predicate on the "headshot" field.
|
||||
func HeadshotIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldHeadshot), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// HeadshotNotIn applies the NotIn predicate on the "headshot" field.
|
||||
func HeadshotNotIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldHeadshot), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// HeadshotGT applies the GT predicate on the "headshot" field.
|
||||
func HeadshotGT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldHeadshot), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HeadshotGTE applies the GTE predicate on the "headshot" field.
|
||||
func HeadshotGTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldHeadshot), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HeadshotLT applies the LT predicate on the "headshot" field.
|
||||
func HeadshotLT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldHeadshot), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HeadshotLTE applies the LTE predicate on the "headshot" field.
|
||||
func HeadshotLTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldHeadshot), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MvpEQ applies the EQ predicate on the "mvp" field.
|
||||
func MvpEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldMvp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MvpNEQ applies the NEQ predicate on the "mvp" field.
|
||||
func MvpNEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldMvp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MvpIn applies the In predicate on the "mvp" field.
|
||||
func MvpIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldMvp), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// MvpNotIn applies the NotIn predicate on the "mvp" field.
|
||||
func MvpNotIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldMvp), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// MvpGT applies the GT predicate on the "mvp" field.
|
||||
func MvpGT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldMvp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MvpGTE applies the GTE predicate on the "mvp" field.
|
||||
func MvpGTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldMvp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MvpLT applies the LT predicate on the "mvp" field.
|
||||
func MvpLT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldMvp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// MvpLTE applies the LTE predicate on the "mvp" field.
|
||||
func MvpLTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldMvp), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ScoreEQ applies the EQ predicate on the "score" field.
|
||||
func ScoreEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldScore), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ScoreNEQ applies the NEQ predicate on the "score" field.
|
||||
func ScoreNEQ(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldScore), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ScoreIn applies the In predicate on the "score" field.
|
||||
func ScoreIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldScore), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// ScoreNotIn applies the NotIn predicate on the "score" field.
|
||||
func ScoreNotIn(vs ...int) predicate.Stats {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Stats(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(FieldScore), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// ScoreGT applies the GT predicate on the "score" field.
|
||||
func ScoreGT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldScore), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ScoreGTE applies the GTE predicate on the "score" field.
|
||||
func ScoreGTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldScore), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ScoreLT applies the LT predicate on the "score" field.
|
||||
func ScoreLT(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldScore), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ScoreLTE applies the LTE predicate on the "score" field.
|
||||
func ScoreLTE(v int) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldScore), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ExtendedIsNil applies the IsNil predicate on the "extended" field.
|
||||
func ExtendedIsNil() predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.IsNull(s.C(FieldExtended)))
|
||||
})
|
||||
}
|
||||
|
||||
// ExtendedNotNil applies the NotNil predicate on the "extended" field.
|
||||
func ExtendedNotNil() predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
s.Where(sql.NotNull(s.C(FieldExtended)))
|
||||
})
|
||||
}
|
||||
|
||||
// HasMatches applies the HasEdge predicate on the "matches" edge.
|
||||
func HasMatches() predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(MatchesTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, MatchesTable, MatchesColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasMatchesWith applies the HasEdge predicate on the "matches" edge with a given conditions (other predicates).
|
||||
func HasMatchesWith(preds ...predicate.Match) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(MatchesInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, MatchesTable, MatchesColumn),
|
||||
)
|
||||
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
|
||||
for _, p := range preds {
|
||||
p(s)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// HasPlayers applies the HasEdge predicate on the "players" edge.
|
||||
func HasPlayers() predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(PlayersTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, PlayersTable, PlayersColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasPlayersWith applies the HasEdge predicate on the "players" edge with a given conditions (other predicates).
|
||||
func HasPlayersWith(preds ...predicate.Player) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(PlayersInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, PlayersTable, PlayersColumn),
|
||||
)
|
||||
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.Stats) predicate.Stats {
|
||||
return predicate.Stats(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.Stats) predicate.Stats {
|
||||
return predicate.Stats(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.Stats) predicate.Stats {
|
||||
return predicate.Stats(func(s *sql.Selector) {
|
||||
p(s.Not())
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user