added spray patterns
This commit is contained in:
53
ent/spray/spray.go
Normal file
53
ent/spray/spray.go
Normal file
@@ -0,0 +1,53 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
|
||||
package spray
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the spray type in the database.
|
||||
Label = "spray"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldWeapon holds the string denoting the weapon field in the database.
|
||||
FieldWeapon = "weapon"
|
||||
// FieldSpray holds the string denoting the spray field in the database.
|
||||
FieldSpray = "spray"
|
||||
// EdgeMatchPlayers holds the string denoting the match_players edge name in mutations.
|
||||
EdgeMatchPlayers = "match_players"
|
||||
// Table holds the table name of the spray in the database.
|
||||
Table = "sprays"
|
||||
// MatchPlayersTable is the table that holds the match_players relation/edge.
|
||||
MatchPlayersTable = "sprays"
|
||||
// MatchPlayersInverseTable is the table name for the MatchPlayer entity.
|
||||
// It exists in this package in order to avoid circular dependency with the "matchplayer" package.
|
||||
MatchPlayersInverseTable = "match_players"
|
||||
// MatchPlayersColumn is the table column denoting the match_players relation/edge.
|
||||
MatchPlayersColumn = "match_player_spray"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for spray fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldWeapon,
|
||||
FieldSpray,
|
||||
}
|
||||
|
||||
// ForeignKeys holds the SQL foreign-keys that are owned by the "sprays"
|
||||
// table and are not defined as standalone fields in the schema.
|
||||
var ForeignKeys = []string{
|
||||
"match_player_spray",
|
||||
}
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
func ValidColumn(column string) bool {
|
||||
for i := range Columns {
|
||||
if column == Columns[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
for i := range ForeignKeys {
|
||||
if column == ForeignKeys[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
319
ent/spray/where.go
Normal file
319
ent/spray/where.go
Normal file
@@ -0,0 +1,319 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
|
||||
package spray
|
||||
|
||||
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.Spray {
|
||||
return predicate.Spray(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.Spray {
|
||||
return predicate.Spray(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.Spray {
|
||||
return predicate.Spray(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.Spray {
|
||||
return predicate.Spray(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.Spray {
|
||||
return predicate.Spray(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.Spray {
|
||||
return predicate.Spray(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.Spray {
|
||||
return predicate.Spray(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.Spray {
|
||||
return predicate.Spray(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.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// Weapon applies equality check predicate on the "weapon" field. It's identical to WeaponEQ.
|
||||
func Weapon(v int) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldWeapon), v))
|
||||
})
|
||||
}
|
||||
|
||||
// Spray applies equality check predicate on the "spray" field. It's identical to SprayEQ.
|
||||
func Spray(v []byte) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldSpray), v))
|
||||
})
|
||||
}
|
||||
|
||||
// WeaponEQ applies the EQ predicate on the "weapon" field.
|
||||
func WeaponEQ(v int) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldWeapon), v))
|
||||
})
|
||||
}
|
||||
|
||||
// WeaponNEQ applies the NEQ predicate on the "weapon" field.
|
||||
func WeaponNEQ(v int) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldWeapon), v))
|
||||
})
|
||||
}
|
||||
|
||||
// WeaponIn applies the In predicate on the "weapon" field.
|
||||
func WeaponIn(vs ...int) predicate.Spray {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Spray(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(FieldWeapon), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// WeaponNotIn applies the NotIn predicate on the "weapon" field.
|
||||
func WeaponNotIn(vs ...int) predicate.Spray {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Spray(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(FieldWeapon), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// WeaponGT applies the GT predicate on the "weapon" field.
|
||||
func WeaponGT(v int) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldWeapon), v))
|
||||
})
|
||||
}
|
||||
|
||||
// WeaponGTE applies the GTE predicate on the "weapon" field.
|
||||
func WeaponGTE(v int) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldWeapon), v))
|
||||
})
|
||||
}
|
||||
|
||||
// WeaponLT applies the LT predicate on the "weapon" field.
|
||||
func WeaponLT(v int) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldWeapon), v))
|
||||
})
|
||||
}
|
||||
|
||||
// WeaponLTE applies the LTE predicate on the "weapon" field.
|
||||
func WeaponLTE(v int) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldWeapon), v))
|
||||
})
|
||||
}
|
||||
|
||||
// SprayEQ applies the EQ predicate on the "spray" field.
|
||||
func SprayEQ(v []byte) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldSpray), v))
|
||||
})
|
||||
}
|
||||
|
||||
// SprayNEQ applies the NEQ predicate on the "spray" field.
|
||||
func SprayNEQ(v []byte) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldSpray), v))
|
||||
})
|
||||
}
|
||||
|
||||
// SprayIn applies the In predicate on the "spray" field.
|
||||
func SprayIn(vs ...[]byte) predicate.Spray {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Spray(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(FieldSpray), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// SprayNotIn applies the NotIn predicate on the "spray" field.
|
||||
func SprayNotIn(vs ...[]byte) predicate.Spray {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Spray(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(FieldSpray), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// SprayGT applies the GT predicate on the "spray" field.
|
||||
func SprayGT(v []byte) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldSpray), v))
|
||||
})
|
||||
}
|
||||
|
||||
// SprayGTE applies the GTE predicate on the "spray" field.
|
||||
func SprayGTE(v []byte) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldSpray), v))
|
||||
})
|
||||
}
|
||||
|
||||
// SprayLT applies the LT predicate on the "spray" field.
|
||||
func SprayLT(v []byte) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldSpray), v))
|
||||
})
|
||||
}
|
||||
|
||||
// SprayLTE applies the LTE predicate on the "spray" field.
|
||||
func SprayLTE(v []byte) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldSpray), v))
|
||||
})
|
||||
}
|
||||
|
||||
// HasMatchPlayers applies the HasEdge predicate on the "match_players" edge.
|
||||
func HasMatchPlayers() predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(MatchPlayersTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, MatchPlayersTable, MatchPlayersColumn),
|
||||
)
|
||||
sqlgraph.HasNeighbors(s, step)
|
||||
})
|
||||
}
|
||||
|
||||
// HasMatchPlayersWith applies the HasEdge predicate on the "match_players" edge with a given conditions (other predicates).
|
||||
func HasMatchPlayersWith(preds ...predicate.MatchPlayer) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(Table, FieldID),
|
||||
sqlgraph.To(MatchPlayersInverseTable, FieldID),
|
||||
sqlgraph.Edge(sqlgraph.M2O, true, MatchPlayersTable, MatchPlayersColumn),
|
||||
)
|
||||
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.Spray) predicate.Spray {
|
||||
return predicate.Spray(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.Spray) predicate.Spray {
|
||||
return predicate.Spray(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.Spray) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
p(s.Not())
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user