fixed match win/loss/ties

This commit is contained in:
2021-10-08 17:15:06 +02:00
parent 1fda101a35
commit 1816c5a2b5
28 changed files with 363 additions and 654 deletions

View File

@@ -11,8 +11,6 @@ const (
Label = "player"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldSteamid holds the string denoting the steamid field in the database.
FieldSteamid = "steamid"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldAvatarURL holds the string denoting the avatar_url field in the database.
@@ -56,7 +54,6 @@ const (
// Columns holds all SQL columns for player fields.
var Columns = []string{
FieldID,
FieldSteamid,
FieldName,
FieldAvatarURL,
FieldVanityURL,

View File

@@ -11,28 +11,28 @@ import (
)
// ID filters vertices based on their ID field.
func ID(id int) predicate.Player {
func ID(id uint64) predicate.Player {
return predicate.Player(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.Player {
func IDEQ(id uint64) predicate.Player {
return predicate.Player(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.Player {
func IDNEQ(id uint64) predicate.Player {
return predicate.Player(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.Player {
func IDIn(ids ...uint64) predicate.Player {
return predicate.Player(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.
@@ -49,7 +49,7 @@ func IDIn(ids ...int) predicate.Player {
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int) predicate.Player {
func IDNotIn(ids ...uint64) predicate.Player {
return predicate.Player(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.
@@ -66,40 +66,33 @@ func IDNotIn(ids ...int) predicate.Player {
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id int) predicate.Player {
func IDGT(id uint64) predicate.Player {
return predicate.Player(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.Player {
func IDGTE(id uint64) predicate.Player {
return predicate.Player(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.Player {
func IDLT(id uint64) predicate.Player {
return predicate.Player(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.Player {
func IDLTE(id uint64) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldID), id))
})
}
// Steamid applies equality check predicate on the "steamid" field. It's identical to SteamidEQ.
func Steamid(v uint64) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldSteamid), v))
})
}
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
func Name(v string) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
@@ -170,82 +163,6 @@ func AuthCode(v string) predicate.Player {
})
}
// SteamidEQ applies the EQ predicate on the "steamid" field.
func SteamidEQ(v uint64) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldSteamid), v))
})
}
// SteamidNEQ applies the NEQ predicate on the "steamid" field.
func SteamidNEQ(v uint64) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldSteamid), v))
})
}
// SteamidIn applies the In predicate on the "steamid" field.
func SteamidIn(vs ...uint64) predicate.Player {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Player(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(FieldSteamid), v...))
})
}
// SteamidNotIn applies the NotIn predicate on the "steamid" field.
func SteamidNotIn(vs ...uint64) predicate.Player {
v := make([]interface{}, len(vs))
for i := range v {
v[i] = vs[i]
}
return predicate.Player(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(FieldSteamid), v...))
})
}
// SteamidGT applies the GT predicate on the "steamid" field.
func SteamidGT(v uint64) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.GT(s.C(FieldSteamid), v))
})
}
// SteamidGTE applies the GTE predicate on the "steamid" field.
func SteamidGTE(v uint64) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.GTE(s.C(FieldSteamid), v))
})
}
// SteamidLT applies the LT predicate on the "steamid" field.
func SteamidLT(v uint64) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.LT(s.C(FieldSteamid), v))
})
}
// SteamidLTE applies the LTE predicate on the "steamid" field.
func SteamidLTE(v uint64) predicate.Player {
return predicate.Player(func(s *sql.Selector) {
s.Where(sql.LTE(s.C(FieldSteamid), v))
})
}
// NameEQ applies the EQ predicate on the "name" field.
func NameEQ(v string) predicate.Player {
return predicate.Player(func(s *sql.Selector) {