updated deps; regen ent
This commit is contained in:
@@ -221,7 +221,7 @@ func (c *MatchClient) DeleteOne(m *Match) *MatchDeleteOne {
|
||||
return c.DeleteOneID(m.ID)
|
||||
}
|
||||
|
||||
// DeleteOne returns a builder for deleting the given entity by its id.
|
||||
// DeleteOneID returns a builder for deleting the given entity by its id.
|
||||
func (c *MatchClient) DeleteOneID(id uint64) *MatchDeleteOne {
|
||||
builder := c.Delete().Where(match.ID(id))
|
||||
builder.mutation.id = &id
|
||||
@@ -253,7 +253,7 @@ func (c *MatchClient) GetX(ctx context.Context, id uint64) *Match {
|
||||
// QueryStats queries the stats edge of a Match.
|
||||
func (c *MatchClient) QueryStats(m *Match) *MatchPlayerQuery {
|
||||
query := &MatchPlayerQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := m.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(match.Table, match.FieldID, id),
|
||||
@@ -269,7 +269,7 @@ func (c *MatchClient) QueryStats(m *Match) *MatchPlayerQuery {
|
||||
// QueryPlayers queries the players edge of a Match.
|
||||
func (c *MatchClient) QueryPlayers(m *Match) *PlayerQuery {
|
||||
query := &PlayerQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := m.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(match.Table, match.FieldID, id),
|
||||
@@ -343,7 +343,7 @@ func (c *MatchPlayerClient) DeleteOne(mp *MatchPlayer) *MatchPlayerDeleteOne {
|
||||
return c.DeleteOneID(mp.ID)
|
||||
}
|
||||
|
||||
// DeleteOne returns a builder for deleting the given entity by its id.
|
||||
// DeleteOneID returns a builder for deleting the given entity by its id.
|
||||
func (c *MatchPlayerClient) DeleteOneID(id int) *MatchPlayerDeleteOne {
|
||||
builder := c.Delete().Where(matchplayer.ID(id))
|
||||
builder.mutation.id = &id
|
||||
@@ -375,7 +375,7 @@ func (c *MatchPlayerClient) GetX(ctx context.Context, id int) *MatchPlayer {
|
||||
// QueryMatches queries the matches edge of a MatchPlayer.
|
||||
func (c *MatchPlayerClient) QueryMatches(mp *MatchPlayer) *MatchQuery {
|
||||
query := &MatchQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := mp.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(matchplayer.Table, matchplayer.FieldID, id),
|
||||
@@ -391,7 +391,7 @@ func (c *MatchPlayerClient) QueryMatches(mp *MatchPlayer) *MatchQuery {
|
||||
// QueryPlayers queries the players edge of a MatchPlayer.
|
||||
func (c *MatchPlayerClient) QueryPlayers(mp *MatchPlayer) *PlayerQuery {
|
||||
query := &PlayerQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := mp.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(matchplayer.Table, matchplayer.FieldID, id),
|
||||
@@ -407,7 +407,7 @@ func (c *MatchPlayerClient) QueryPlayers(mp *MatchPlayer) *PlayerQuery {
|
||||
// QueryWeaponStats queries the weapon_stats edge of a MatchPlayer.
|
||||
func (c *MatchPlayerClient) QueryWeaponStats(mp *MatchPlayer) *WeaponQuery {
|
||||
query := &WeaponQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := mp.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(matchplayer.Table, matchplayer.FieldID, id),
|
||||
@@ -423,7 +423,7 @@ func (c *MatchPlayerClient) QueryWeaponStats(mp *MatchPlayer) *WeaponQuery {
|
||||
// QueryRoundStats queries the round_stats edge of a MatchPlayer.
|
||||
func (c *MatchPlayerClient) QueryRoundStats(mp *MatchPlayer) *RoundStatsQuery {
|
||||
query := &RoundStatsQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := mp.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(matchplayer.Table, matchplayer.FieldID, id),
|
||||
@@ -439,7 +439,7 @@ func (c *MatchPlayerClient) QueryRoundStats(mp *MatchPlayer) *RoundStatsQuery {
|
||||
// QuerySpray queries the spray edge of a MatchPlayer.
|
||||
func (c *MatchPlayerClient) QuerySpray(mp *MatchPlayer) *SprayQuery {
|
||||
query := &SprayQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := mp.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(matchplayer.Table, matchplayer.FieldID, id),
|
||||
@@ -455,7 +455,7 @@ func (c *MatchPlayerClient) QuerySpray(mp *MatchPlayer) *SprayQuery {
|
||||
// QueryMessages queries the messages edge of a MatchPlayer.
|
||||
func (c *MatchPlayerClient) QueryMessages(mp *MatchPlayer) *MessagesQuery {
|
||||
query := &MessagesQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := mp.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(matchplayer.Table, matchplayer.FieldID, id),
|
||||
@@ -529,7 +529,7 @@ func (c *MessagesClient) DeleteOne(m *Messages) *MessagesDeleteOne {
|
||||
return c.DeleteOneID(m.ID)
|
||||
}
|
||||
|
||||
// DeleteOne returns a builder for deleting the given entity by its id.
|
||||
// DeleteOneID returns a builder for deleting the given entity by its id.
|
||||
func (c *MessagesClient) DeleteOneID(id int) *MessagesDeleteOne {
|
||||
builder := c.Delete().Where(messages.ID(id))
|
||||
builder.mutation.id = &id
|
||||
@@ -561,7 +561,7 @@ func (c *MessagesClient) GetX(ctx context.Context, id int) *Messages {
|
||||
// QueryMatchPlayer queries the match_player edge of a Messages.
|
||||
func (c *MessagesClient) QueryMatchPlayer(m *Messages) *MatchPlayerQuery {
|
||||
query := &MatchPlayerQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := m.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(messages.Table, messages.FieldID, id),
|
||||
@@ -635,7 +635,7 @@ func (c *PlayerClient) DeleteOne(pl *Player) *PlayerDeleteOne {
|
||||
return c.DeleteOneID(pl.ID)
|
||||
}
|
||||
|
||||
// DeleteOne returns a builder for deleting the given entity by its id.
|
||||
// DeleteOneID returns a builder for deleting the given entity by its id.
|
||||
func (c *PlayerClient) DeleteOneID(id uint64) *PlayerDeleteOne {
|
||||
builder := c.Delete().Where(player.ID(id))
|
||||
builder.mutation.id = &id
|
||||
@@ -667,7 +667,7 @@ func (c *PlayerClient) GetX(ctx context.Context, id uint64) *Player {
|
||||
// QueryStats queries the stats edge of a Player.
|
||||
func (c *PlayerClient) QueryStats(pl *Player) *MatchPlayerQuery {
|
||||
query := &MatchPlayerQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := pl.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(player.Table, player.FieldID, id),
|
||||
@@ -683,7 +683,7 @@ func (c *PlayerClient) QueryStats(pl *Player) *MatchPlayerQuery {
|
||||
// QueryMatches queries the matches edge of a Player.
|
||||
func (c *PlayerClient) QueryMatches(pl *Player) *MatchQuery {
|
||||
query := &MatchQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := pl.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(player.Table, player.FieldID, id),
|
||||
@@ -757,7 +757,7 @@ func (c *RoundStatsClient) DeleteOne(rs *RoundStats) *RoundStatsDeleteOne {
|
||||
return c.DeleteOneID(rs.ID)
|
||||
}
|
||||
|
||||
// DeleteOne returns a builder for deleting the given entity by its id.
|
||||
// DeleteOneID returns a builder for deleting the given entity by its id.
|
||||
func (c *RoundStatsClient) DeleteOneID(id int) *RoundStatsDeleteOne {
|
||||
builder := c.Delete().Where(roundstats.ID(id))
|
||||
builder.mutation.id = &id
|
||||
@@ -789,7 +789,7 @@ func (c *RoundStatsClient) GetX(ctx context.Context, id int) *RoundStats {
|
||||
// QueryMatchPlayer queries the match_player edge of a RoundStats.
|
||||
func (c *RoundStatsClient) QueryMatchPlayer(rs *RoundStats) *MatchPlayerQuery {
|
||||
query := &MatchPlayerQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := rs.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(roundstats.Table, roundstats.FieldID, id),
|
||||
@@ -863,7 +863,7 @@ func (c *SprayClient) DeleteOne(s *Spray) *SprayDeleteOne {
|
||||
return c.DeleteOneID(s.ID)
|
||||
}
|
||||
|
||||
// DeleteOne returns a builder for deleting the given entity by its id.
|
||||
// DeleteOneID returns a builder for deleting the given entity by its id.
|
||||
func (c *SprayClient) DeleteOneID(id int) *SprayDeleteOne {
|
||||
builder := c.Delete().Where(spray.ID(id))
|
||||
builder.mutation.id = &id
|
||||
@@ -895,7 +895,7 @@ func (c *SprayClient) GetX(ctx context.Context, id int) *Spray {
|
||||
// QueryMatchPlayers queries the match_players edge of a Spray.
|
||||
func (c *SprayClient) QueryMatchPlayers(s *Spray) *MatchPlayerQuery {
|
||||
query := &MatchPlayerQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := s.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(spray.Table, spray.FieldID, id),
|
||||
@@ -969,7 +969,7 @@ func (c *WeaponClient) DeleteOne(w *Weapon) *WeaponDeleteOne {
|
||||
return c.DeleteOneID(w.ID)
|
||||
}
|
||||
|
||||
// DeleteOne returns a builder for deleting the given entity by its id.
|
||||
// DeleteOneID returns a builder for deleting the given entity by its id.
|
||||
func (c *WeaponClient) DeleteOneID(id int) *WeaponDeleteOne {
|
||||
builder := c.Delete().Where(weapon.ID(id))
|
||||
builder.mutation.id = &id
|
||||
@@ -1001,7 +1001,7 @@ func (c *WeaponClient) GetX(ctx context.Context, id int) *Weapon {
|
||||
// QueryStat queries the stat edge of a Weapon.
|
||||
func (c *WeaponClient) QueryStat(w *Weapon) *MatchPlayerQuery {
|
||||
query := &MatchPlayerQuery{config: c.config}
|
||||
query.path = func(ctx context.Context) (fromV *sql.Selector, _ error) {
|
||||
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
||||
id := w.ID
|
||||
step := sqlgraph.NewStep(
|
||||
sqlgraph.From(weapon.Table, weapon.FieldID, id),
|
||||
|
@@ -17,7 +17,7 @@ type config struct {
|
||||
// debug enable a debug logging.
|
||||
debug bool
|
||||
// log used for logging on debug mode.
|
||||
log func(...interface{})
|
||||
log func(...any)
|
||||
// hooks to execute on mutations.
|
||||
hooks *hooks
|
||||
}
|
||||
@@ -51,7 +51,7 @@ func Debug() Option {
|
||||
}
|
||||
|
||||
// Log sets the logging function for debug mode.
|
||||
func Log(fn func(...interface{})) Option {
|
||||
func Log(fn func(...any)) Option {
|
||||
return func(c *config) {
|
||||
c.log = fn
|
||||
}
|
||||
|
@@ -275,11 +275,12 @@ func IsConstraintError(err error) bool {
|
||||
type selector struct {
|
||||
label string
|
||||
flds *[]string
|
||||
scan func(context.Context, interface{}) error
|
||||
fns []AggregateFunc
|
||||
scan func(context.Context, any) error
|
||||
}
|
||||
|
||||
// ScanX is like Scan, but panics if an error occurs.
|
||||
func (s *selector) ScanX(ctx context.Context, v interface{}) {
|
||||
func (s *selector) ScanX(ctx context.Context, v any) {
|
||||
if err := s.scan(ctx, v); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ type (
|
||||
// testing.T and testing.B and used by enttest.
|
||||
TestingT interface {
|
||||
FailNow()
|
||||
Error(...interface{})
|
||||
Error(...any)
|
||||
}
|
||||
|
||||
// Option configures client creation.
|
||||
|
@@ -79,8 +79,8 @@ func (e MatchEdges) PlayersOrErr() ([]*Player, error) {
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Match) scanValues(columns []string) ([]interface{}, error) {
|
||||
values := make([]interface{}, len(columns))
|
||||
func (*Match) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case match.FieldDecryptionKey:
|
||||
@@ -104,7 +104,7 @@ func (*Match) scanValues(columns []string) ([]interface{}, error) {
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the Match fields.
|
||||
func (m *Match) assignValues(columns []string, values []interface{}) error {
|
||||
func (m *Match) assignValues(columns []string, values []any) error {
|
||||
if m, n := len(values), len(columns); m < n {
|
||||
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ func IDNEQ(id uint64) predicate.Match {
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...uint64) predicate.Match {
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func IDIn(ids ...uint64) predicate.Match {
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...uint64) predicate.Match {
|
||||
return predicate.Match(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -195,7 +195,7 @@ func ShareCodeNEQ(v string) predicate.Match {
|
||||
|
||||
// ShareCodeIn applies the In predicate on the "share_code" field.
|
||||
func ShareCodeIn(vs ...string) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -206,7 +206,7 @@ func ShareCodeIn(vs ...string) predicate.Match {
|
||||
|
||||
// ShareCodeNotIn applies the NotIn predicate on the "share_code" field.
|
||||
func ShareCodeNotIn(vs ...string) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -294,7 +294,7 @@ func MapNEQ(v string) predicate.Match {
|
||||
|
||||
// MapIn applies the In predicate on the "map" field.
|
||||
func MapIn(vs ...string) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -305,7 +305,7 @@ func MapIn(vs ...string) predicate.Match {
|
||||
|
||||
// MapNotIn applies the NotIn predicate on the "map" field.
|
||||
func MapNotIn(vs ...string) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -407,7 +407,7 @@ func DateNEQ(v time.Time) predicate.Match {
|
||||
|
||||
// DateIn applies the In predicate on the "date" field.
|
||||
func DateIn(vs ...time.Time) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -418,7 +418,7 @@ func DateIn(vs ...time.Time) predicate.Match {
|
||||
|
||||
// DateNotIn applies the NotIn predicate on the "date" field.
|
||||
func DateNotIn(vs ...time.Time) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -471,7 +471,7 @@ func ScoreTeamANEQ(v int) predicate.Match {
|
||||
|
||||
// ScoreTeamAIn applies the In predicate on the "score_team_a" field.
|
||||
func ScoreTeamAIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -482,7 +482,7 @@ func ScoreTeamAIn(vs ...int) predicate.Match {
|
||||
|
||||
// ScoreTeamANotIn applies the NotIn predicate on the "score_team_a" field.
|
||||
func ScoreTeamANotIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -535,7 +535,7 @@ func ScoreTeamBNEQ(v int) predicate.Match {
|
||||
|
||||
// ScoreTeamBIn applies the In predicate on the "score_team_b" field.
|
||||
func ScoreTeamBIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -546,7 +546,7 @@ func ScoreTeamBIn(vs ...int) predicate.Match {
|
||||
|
||||
// ScoreTeamBNotIn applies the NotIn predicate on the "score_team_b" field.
|
||||
func ScoreTeamBNotIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -599,7 +599,7 @@ func ReplayURLNEQ(v string) predicate.Match {
|
||||
|
||||
// ReplayURLIn applies the In predicate on the "replay_url" field.
|
||||
func ReplayURLIn(vs ...string) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -610,7 +610,7 @@ func ReplayURLIn(vs ...string) predicate.Match {
|
||||
|
||||
// ReplayURLNotIn applies the NotIn predicate on the "replay_url" field.
|
||||
func ReplayURLNotIn(vs ...string) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -712,7 +712,7 @@ func DurationNEQ(v int) predicate.Match {
|
||||
|
||||
// DurationIn applies the In predicate on the "duration" field.
|
||||
func DurationIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -723,7 +723,7 @@ func DurationIn(vs ...int) predicate.Match {
|
||||
|
||||
// DurationNotIn applies the NotIn predicate on the "duration" field.
|
||||
func DurationNotIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -776,7 +776,7 @@ func MatchResultNEQ(v int) predicate.Match {
|
||||
|
||||
// MatchResultIn applies the In predicate on the "match_result" field.
|
||||
func MatchResultIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -787,7 +787,7 @@ func MatchResultIn(vs ...int) predicate.Match {
|
||||
|
||||
// MatchResultNotIn applies the NotIn predicate on the "match_result" field.
|
||||
func MatchResultNotIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -840,7 +840,7 @@ func MaxRoundsNEQ(v int) predicate.Match {
|
||||
|
||||
// MaxRoundsIn applies the In predicate on the "max_rounds" field.
|
||||
func MaxRoundsIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -851,7 +851,7 @@ func MaxRoundsIn(vs ...int) predicate.Match {
|
||||
|
||||
// MaxRoundsNotIn applies the NotIn predicate on the "max_rounds" field.
|
||||
func MaxRoundsNotIn(vs ...int) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -946,7 +946,7 @@ func DecryptionKeyNEQ(v []byte) predicate.Match {
|
||||
|
||||
// DecryptionKeyIn applies the In predicate on the "decryption_key" field.
|
||||
func DecryptionKeyIn(vs ...[]byte) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -957,7 +957,7 @@ func DecryptionKeyIn(vs ...[]byte) predicate.Match {
|
||||
|
||||
// DecryptionKeyNotIn applies the NotIn predicate on the "decryption_key" field.
|
||||
func DecryptionKeyNotIn(vs ...[]byte) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1024,7 +1024,7 @@ func TickRateNEQ(v float64) predicate.Match {
|
||||
|
||||
// TickRateIn applies the In predicate on the "tick_rate" field.
|
||||
func TickRateIn(vs ...float64) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1035,7 +1035,7 @@ func TickRateIn(vs ...float64) predicate.Match {
|
||||
|
||||
// TickRateNotIn applies the NotIn predicate on the "tick_rate" field.
|
||||
func TickRateNotIn(vs ...float64) predicate.Match {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
|
@@ -347,115 +347,59 @@ func (mc *MatchCreate) createSpec() (*Match, *sqlgraph.CreateSpec) {
|
||||
_spec.ID.Value = id
|
||||
}
|
||||
if value, ok := mc.mutation.ShareCode(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: match.FieldShareCode,
|
||||
})
|
||||
_spec.SetField(match.FieldShareCode, field.TypeString, value)
|
||||
_node.ShareCode = value
|
||||
}
|
||||
if value, ok := mc.mutation.Map(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: match.FieldMap,
|
||||
})
|
||||
_spec.SetField(match.FieldMap, field.TypeString, value)
|
||||
_node.Map = value
|
||||
}
|
||||
if value, ok := mc.mutation.Date(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: match.FieldDate,
|
||||
})
|
||||
_spec.SetField(match.FieldDate, field.TypeTime, value)
|
||||
_node.Date = value
|
||||
}
|
||||
if value, ok := mc.mutation.ScoreTeamA(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldScoreTeamA,
|
||||
})
|
||||
_spec.SetField(match.FieldScoreTeamA, field.TypeInt, value)
|
||||
_node.ScoreTeamA = value
|
||||
}
|
||||
if value, ok := mc.mutation.ScoreTeamB(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldScoreTeamB,
|
||||
})
|
||||
_spec.SetField(match.FieldScoreTeamB, field.TypeInt, value)
|
||||
_node.ScoreTeamB = value
|
||||
}
|
||||
if value, ok := mc.mutation.ReplayURL(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: match.FieldReplayURL,
|
||||
})
|
||||
_spec.SetField(match.FieldReplayURL, field.TypeString, value)
|
||||
_node.ReplayURL = value
|
||||
}
|
||||
if value, ok := mc.mutation.Duration(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldDuration,
|
||||
})
|
||||
_spec.SetField(match.FieldDuration, field.TypeInt, value)
|
||||
_node.Duration = value
|
||||
}
|
||||
if value, ok := mc.mutation.MatchResult(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldMatchResult,
|
||||
})
|
||||
_spec.SetField(match.FieldMatchResult, field.TypeInt, value)
|
||||
_node.MatchResult = value
|
||||
}
|
||||
if value, ok := mc.mutation.MaxRounds(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldMaxRounds,
|
||||
})
|
||||
_spec.SetField(match.FieldMaxRounds, field.TypeInt, value)
|
||||
_node.MaxRounds = value
|
||||
}
|
||||
if value, ok := mc.mutation.DemoParsed(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: match.FieldDemoParsed,
|
||||
})
|
||||
_spec.SetField(match.FieldDemoParsed, field.TypeBool, value)
|
||||
_node.DemoParsed = value
|
||||
}
|
||||
if value, ok := mc.mutation.VacPresent(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: match.FieldVacPresent,
|
||||
})
|
||||
_spec.SetField(match.FieldVacPresent, field.TypeBool, value)
|
||||
_node.VacPresent = value
|
||||
}
|
||||
if value, ok := mc.mutation.GamebanPresent(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: match.FieldGamebanPresent,
|
||||
})
|
||||
_spec.SetField(match.FieldGamebanPresent, field.TypeBool, value)
|
||||
_node.GamebanPresent = value
|
||||
}
|
||||
if value, ok := mc.mutation.DecryptionKey(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBytes,
|
||||
Value: value,
|
||||
Column: match.FieldDecryptionKey,
|
||||
})
|
||||
_spec.SetField(match.FieldDecryptionKey, field.TypeBytes, value)
|
||||
_node.DecryptionKey = value
|
||||
}
|
||||
if value, ok := mc.mutation.TickRate(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeFloat64,
|
||||
Value: value,
|
||||
Column: match.FieldTickRate,
|
||||
})
|
||||
_spec.SetField(match.FieldTickRate, field.TypeFloat64, value)
|
||||
_node.TickRate = value
|
||||
}
|
||||
if nodes := mc.mutation.StatsIDs(); len(nodes) > 0 {
|
||||
|
@@ -369,6 +369,11 @@ func (mq *MatchQuery) Select(fields ...string) *MatchSelect {
|
||||
return selbuild
|
||||
}
|
||||
|
||||
// Aggregate returns a MatchSelect configured with the given aggregations.
|
||||
func (mq *MatchQuery) Aggregate(fns ...AggregateFunc) *MatchSelect {
|
||||
return mq.Select().Aggregate(fns...)
|
||||
}
|
||||
|
||||
func (mq *MatchQuery) prepareQuery(ctx context.Context) error {
|
||||
for _, f := range mq.fields {
|
||||
if !match.ValidColumn(f) {
|
||||
@@ -394,10 +399,10 @@ func (mq *MatchQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Match,
|
||||
mq.withPlayers != nil,
|
||||
}
|
||||
)
|
||||
_spec.ScanValues = func(columns []string) ([]interface{}, error) {
|
||||
_spec.ScanValues = func(columns []string) ([]any, error) {
|
||||
return (*Match).scanValues(nil, columns)
|
||||
}
|
||||
_spec.Assign = func(columns []string, values []interface{}) error {
|
||||
_spec.Assign = func(columns []string, values []any) error {
|
||||
node := &Match{config: mq.config}
|
||||
nodes = append(nodes, node)
|
||||
node.Edges.loadedTypes = loadedTypes
|
||||
@@ -485,18 +490,18 @@ func (mq *MatchQuery) loadPlayers(ctx context.Context, query *PlayerQuery, nodes
|
||||
neighbors, err := query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) {
|
||||
assign := spec.Assign
|
||||
values := spec.ScanValues
|
||||
spec.ScanValues = func(columns []string) ([]interface{}, error) {
|
||||
spec.ScanValues = func(columns []string) ([]any, error) {
|
||||
values, err := values(columns[1:])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return append([]interface{}{new(sql.NullInt64)}, values...), nil
|
||||
return append([]any{new(sql.NullInt64)}, values...), nil
|
||||
}
|
||||
spec.Assign = func(columns []string, values []interface{}) error {
|
||||
spec.Assign = func(columns []string, values []any) error {
|
||||
outValue := uint64(values[0].(*sql.NullInt64).Int64)
|
||||
inValue := uint64(values[1].(*sql.NullInt64).Int64)
|
||||
if nids[inValue] == nil {
|
||||
nids[inValue] = map[*Match]struct{}{byID[outValue]: struct{}{}}
|
||||
nids[inValue] = map[*Match]struct{}{byID[outValue]: {}}
|
||||
return assign(columns[1:], values[1:])
|
||||
}
|
||||
nids[inValue][byID[outValue]] = struct{}{}
|
||||
@@ -531,11 +536,14 @@ func (mq *MatchQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
}
|
||||
|
||||
func (mq *MatchQuery) sqlExist(ctx context.Context) (bool, error) {
|
||||
n, err := mq.sqlCount(ctx)
|
||||
if err != nil {
|
||||
switch _, err := mq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
case err != nil:
|
||||
return false, fmt.Errorf("ent: check existence: %w", err)
|
||||
default:
|
||||
return true, nil
|
||||
}
|
||||
return n > 0, nil
|
||||
}
|
||||
|
||||
func (mq *MatchQuery) querySpec() *sqlgraph.QuerySpec {
|
||||
@@ -645,7 +653,7 @@ func (mgb *MatchGroupBy) Aggregate(fns ...AggregateFunc) *MatchGroupBy {
|
||||
}
|
||||
|
||||
// Scan applies the group-by query and scans the result into the given value.
|
||||
func (mgb *MatchGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
func (mgb *MatchGroupBy) Scan(ctx context.Context, v any) error {
|
||||
query, err := mgb.path(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -654,7 +662,7 @@ func (mgb *MatchGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
return mgb.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (mgb *MatchGroupBy) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (mgb *MatchGroupBy) sqlScan(ctx context.Context, v any) error {
|
||||
for _, f := range mgb.fields {
|
||||
if !match.ValidColumn(f) {
|
||||
return &ValidationError{Name: f, err: fmt.Errorf("invalid field %q for group-by", f)}
|
||||
@@ -679,8 +687,6 @@ func (mgb *MatchGroupBy) sqlQuery() *sql.Selector {
|
||||
for _, fn := range mgb.fns {
|
||||
aggregation = append(aggregation, fn(selector))
|
||||
}
|
||||
// If no columns were selected in a custom aggregation function, the default
|
||||
// selection is the fields used for "group-by", and the aggregation functions.
|
||||
if len(selector.SelectedColumns()) == 0 {
|
||||
columns := make([]string, 0, len(mgb.fields)+len(mgb.fns))
|
||||
for _, f := range mgb.fields {
|
||||
@@ -700,8 +706,14 @@ type MatchSelect struct {
|
||||
sql *sql.Selector
|
||||
}
|
||||
|
||||
// Aggregate adds the given aggregation functions to the selector query.
|
||||
func (ms *MatchSelect) Aggregate(fns ...AggregateFunc) *MatchSelect {
|
||||
ms.fns = append(ms.fns, fns...)
|
||||
return ms
|
||||
}
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (ms *MatchSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
func (ms *MatchSelect) Scan(ctx context.Context, v any) error {
|
||||
if err := ms.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -709,7 +721,17 @@ func (ms *MatchSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
return ms.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (ms *MatchSelect) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (ms *MatchSelect) sqlScan(ctx context.Context, v any) error {
|
||||
aggregation := make([]string, 0, len(ms.fns))
|
||||
for _, fn := range ms.fns {
|
||||
aggregation = append(aggregation, fn(ms.sql))
|
||||
}
|
||||
switch n := len(*ms.selector.flds); {
|
||||
case n == 0 && len(aggregation) > 0:
|
||||
ms.sql.Select(aggregation...)
|
||||
case n != 0 && len(aggregation) > 0:
|
||||
ms.sql.AppendSelect(aggregation...)
|
||||
}
|
||||
rows := &sql.Rows{}
|
||||
query, args := ms.sql.Query()
|
||||
if err := ms.driver.Query(ctx, query, args, rows); err != nil {
|
||||
|
@@ -385,168 +385,76 @@ func (mu *MatchUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
}
|
||||
if value, ok := mu.mutation.ShareCode(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: match.FieldShareCode,
|
||||
})
|
||||
_spec.SetField(match.FieldShareCode, field.TypeString, value)
|
||||
}
|
||||
if value, ok := mu.mutation.Map(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: match.FieldMap,
|
||||
})
|
||||
_spec.SetField(match.FieldMap, field.TypeString, value)
|
||||
}
|
||||
if mu.mutation.MapCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: match.FieldMap,
|
||||
})
|
||||
_spec.ClearField(match.FieldMap, field.TypeString)
|
||||
}
|
||||
if value, ok := mu.mutation.Date(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: match.FieldDate,
|
||||
})
|
||||
_spec.SetField(match.FieldDate, field.TypeTime, value)
|
||||
}
|
||||
if value, ok := mu.mutation.ScoreTeamA(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldScoreTeamA,
|
||||
})
|
||||
_spec.SetField(match.FieldScoreTeamA, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := mu.mutation.AddedScoreTeamA(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldScoreTeamA,
|
||||
})
|
||||
_spec.AddField(match.FieldScoreTeamA, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := mu.mutation.ScoreTeamB(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldScoreTeamB,
|
||||
})
|
||||
_spec.SetField(match.FieldScoreTeamB, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := mu.mutation.AddedScoreTeamB(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldScoreTeamB,
|
||||
})
|
||||
_spec.AddField(match.FieldScoreTeamB, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := mu.mutation.ReplayURL(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: match.FieldReplayURL,
|
||||
})
|
||||
_spec.SetField(match.FieldReplayURL, field.TypeString, value)
|
||||
}
|
||||
if mu.mutation.ReplayURLCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: match.FieldReplayURL,
|
||||
})
|
||||
_spec.ClearField(match.FieldReplayURL, field.TypeString)
|
||||
}
|
||||
if value, ok := mu.mutation.Duration(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldDuration,
|
||||
})
|
||||
_spec.SetField(match.FieldDuration, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := mu.mutation.AddedDuration(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldDuration,
|
||||
})
|
||||
_spec.AddField(match.FieldDuration, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := mu.mutation.MatchResult(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldMatchResult,
|
||||
})
|
||||
_spec.SetField(match.FieldMatchResult, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := mu.mutation.AddedMatchResult(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldMatchResult,
|
||||
})
|
||||
_spec.AddField(match.FieldMatchResult, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := mu.mutation.MaxRounds(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldMaxRounds,
|
||||
})
|
||||
_spec.SetField(match.FieldMaxRounds, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := mu.mutation.AddedMaxRounds(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldMaxRounds,
|
||||
})
|
||||
_spec.AddField(match.FieldMaxRounds, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := mu.mutation.DemoParsed(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: match.FieldDemoParsed,
|
||||
})
|
||||
_spec.SetField(match.FieldDemoParsed, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := mu.mutation.VacPresent(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: match.FieldVacPresent,
|
||||
})
|
||||
_spec.SetField(match.FieldVacPresent, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := mu.mutation.GamebanPresent(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: match.FieldGamebanPresent,
|
||||
})
|
||||
_spec.SetField(match.FieldGamebanPresent, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := mu.mutation.DecryptionKey(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBytes,
|
||||
Value: value,
|
||||
Column: match.FieldDecryptionKey,
|
||||
})
|
||||
_spec.SetField(match.FieldDecryptionKey, field.TypeBytes, value)
|
||||
}
|
||||
if mu.mutation.DecryptionKeyCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBytes,
|
||||
Column: match.FieldDecryptionKey,
|
||||
})
|
||||
_spec.ClearField(match.FieldDecryptionKey, field.TypeBytes)
|
||||
}
|
||||
if value, ok := mu.mutation.TickRate(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeFloat64,
|
||||
Value: value,
|
||||
Column: match.FieldTickRate,
|
||||
})
|
||||
_spec.SetField(match.FieldTickRate, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := mu.mutation.AddedTickRate(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeFloat64,
|
||||
Value: value,
|
||||
Column: match.FieldTickRate,
|
||||
})
|
||||
_spec.AddField(match.FieldTickRate, field.TypeFloat64, value)
|
||||
}
|
||||
if mu.mutation.TickRateCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeFloat64,
|
||||
Column: match.FieldTickRate,
|
||||
})
|
||||
_spec.ClearField(match.FieldTickRate, field.TypeFloat64)
|
||||
}
|
||||
if mu.mutation.StatsCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -656,7 +564,7 @@ func (mu *MatchUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = mu.modifiers
|
||||
_spec.AddModifiers(mu.modifiers...)
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, mu.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{match.Label}
|
||||
@@ -1061,168 +969,76 @@ func (muo *MatchUpdateOne) sqlSave(ctx context.Context) (_node *Match, err error
|
||||
}
|
||||
}
|
||||
if value, ok := muo.mutation.ShareCode(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: match.FieldShareCode,
|
||||
})
|
||||
_spec.SetField(match.FieldShareCode, field.TypeString, value)
|
||||
}
|
||||
if value, ok := muo.mutation.Map(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: match.FieldMap,
|
||||
})
|
||||
_spec.SetField(match.FieldMap, field.TypeString, value)
|
||||
}
|
||||
if muo.mutation.MapCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: match.FieldMap,
|
||||
})
|
||||
_spec.ClearField(match.FieldMap, field.TypeString)
|
||||
}
|
||||
if value, ok := muo.mutation.Date(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: match.FieldDate,
|
||||
})
|
||||
_spec.SetField(match.FieldDate, field.TypeTime, value)
|
||||
}
|
||||
if value, ok := muo.mutation.ScoreTeamA(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldScoreTeamA,
|
||||
})
|
||||
_spec.SetField(match.FieldScoreTeamA, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := muo.mutation.AddedScoreTeamA(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldScoreTeamA,
|
||||
})
|
||||
_spec.AddField(match.FieldScoreTeamA, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := muo.mutation.ScoreTeamB(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldScoreTeamB,
|
||||
})
|
||||
_spec.SetField(match.FieldScoreTeamB, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := muo.mutation.AddedScoreTeamB(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldScoreTeamB,
|
||||
})
|
||||
_spec.AddField(match.FieldScoreTeamB, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := muo.mutation.ReplayURL(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: match.FieldReplayURL,
|
||||
})
|
||||
_spec.SetField(match.FieldReplayURL, field.TypeString, value)
|
||||
}
|
||||
if muo.mutation.ReplayURLCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: match.FieldReplayURL,
|
||||
})
|
||||
_spec.ClearField(match.FieldReplayURL, field.TypeString)
|
||||
}
|
||||
if value, ok := muo.mutation.Duration(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldDuration,
|
||||
})
|
||||
_spec.SetField(match.FieldDuration, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := muo.mutation.AddedDuration(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldDuration,
|
||||
})
|
||||
_spec.AddField(match.FieldDuration, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := muo.mutation.MatchResult(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldMatchResult,
|
||||
})
|
||||
_spec.SetField(match.FieldMatchResult, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := muo.mutation.AddedMatchResult(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldMatchResult,
|
||||
})
|
||||
_spec.AddField(match.FieldMatchResult, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := muo.mutation.MaxRounds(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldMaxRounds,
|
||||
})
|
||||
_spec.SetField(match.FieldMaxRounds, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := muo.mutation.AddedMaxRounds(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: match.FieldMaxRounds,
|
||||
})
|
||||
_spec.AddField(match.FieldMaxRounds, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := muo.mutation.DemoParsed(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: match.FieldDemoParsed,
|
||||
})
|
||||
_spec.SetField(match.FieldDemoParsed, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := muo.mutation.VacPresent(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: match.FieldVacPresent,
|
||||
})
|
||||
_spec.SetField(match.FieldVacPresent, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := muo.mutation.GamebanPresent(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: match.FieldGamebanPresent,
|
||||
})
|
||||
_spec.SetField(match.FieldGamebanPresent, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := muo.mutation.DecryptionKey(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBytes,
|
||||
Value: value,
|
||||
Column: match.FieldDecryptionKey,
|
||||
})
|
||||
_spec.SetField(match.FieldDecryptionKey, field.TypeBytes, value)
|
||||
}
|
||||
if muo.mutation.DecryptionKeyCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBytes,
|
||||
Column: match.FieldDecryptionKey,
|
||||
})
|
||||
_spec.ClearField(match.FieldDecryptionKey, field.TypeBytes)
|
||||
}
|
||||
if value, ok := muo.mutation.TickRate(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeFloat64,
|
||||
Value: value,
|
||||
Column: match.FieldTickRate,
|
||||
})
|
||||
_spec.SetField(match.FieldTickRate, field.TypeFloat64, value)
|
||||
}
|
||||
if value, ok := muo.mutation.AddedTickRate(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeFloat64,
|
||||
Value: value,
|
||||
Column: match.FieldTickRate,
|
||||
})
|
||||
_spec.AddField(match.FieldTickRate, field.TypeFloat64, value)
|
||||
}
|
||||
if muo.mutation.TickRateCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeFloat64,
|
||||
Column: match.FieldTickRate,
|
||||
})
|
||||
_spec.ClearField(match.FieldTickRate, field.TypeFloat64)
|
||||
}
|
||||
if muo.mutation.StatsCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -1332,7 +1148,7 @@ func (muo *MatchUpdateOne) sqlSave(ctx context.Context) (_node *Match, err error
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = muo.modifiers
|
||||
_spec.AddModifiers(muo.modifiers...)
|
||||
_node = &Match{config: muo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
|
@@ -168,8 +168,8 @@ func (e MatchPlayerEdges) MessagesOrErr() ([]*Messages, error) {
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*MatchPlayer) scanValues(columns []string) ([]interface{}, error) {
|
||||
values := make([]interface{}, len(columns))
|
||||
func (*MatchPlayer) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case matchplayer.FieldFlashDurationSelf, matchplayer.FieldFlashDurationTeam, matchplayer.FieldFlashDurationEnemy:
|
||||
@@ -187,7 +187,7 @@ func (*MatchPlayer) scanValues(columns []string) ([]interface{}, error) {
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the MatchPlayer fields.
|
||||
func (mp *MatchPlayer) assignValues(columns []string, values []interface{}) error {
|
||||
func (mp *MatchPlayer) assignValues(columns []string, values []any) error {
|
||||
if m, n := len(values), len(columns); m < n {
|
||||
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ func IDNEQ(id int) predicate.MatchPlayer {
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.MatchPlayer {
|
||||
return predicate.MatchPlayer(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -43,7 +43,7 @@ func IDIn(ids ...int) predicate.MatchPlayer {
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.MatchPlayer {
|
||||
return predicate.MatchPlayer(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -312,7 +312,7 @@ func TeamIDNEQ(v int) predicate.MatchPlayer {
|
||||
|
||||
// TeamIDIn applies the In predicate on the "team_id" field.
|
||||
func TeamIDIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -323,7 +323,7 @@ func TeamIDIn(vs ...int) predicate.MatchPlayer {
|
||||
|
||||
// TeamIDNotIn applies the NotIn predicate on the "team_id" field.
|
||||
func TeamIDNotIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -376,7 +376,7 @@ func KillsNEQ(v int) predicate.MatchPlayer {
|
||||
|
||||
// KillsIn applies the In predicate on the "kills" field.
|
||||
func KillsIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -387,7 +387,7 @@ func KillsIn(vs ...int) predicate.MatchPlayer {
|
||||
|
||||
// KillsNotIn applies the NotIn predicate on the "kills" field.
|
||||
func KillsNotIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -440,7 +440,7 @@ func DeathsNEQ(v int) predicate.MatchPlayer {
|
||||
|
||||
// DeathsIn applies the In predicate on the "deaths" field.
|
||||
func DeathsIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -451,7 +451,7 @@ func DeathsIn(vs ...int) predicate.MatchPlayer {
|
||||
|
||||
// DeathsNotIn applies the NotIn predicate on the "deaths" field.
|
||||
func DeathsNotIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -504,7 +504,7 @@ func AssistsNEQ(v int) predicate.MatchPlayer {
|
||||
|
||||
// AssistsIn applies the In predicate on the "assists" field.
|
||||
func AssistsIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -515,7 +515,7 @@ func AssistsIn(vs ...int) predicate.MatchPlayer {
|
||||
|
||||
// AssistsNotIn applies the NotIn predicate on the "assists" field.
|
||||
func AssistsNotIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -568,7 +568,7 @@ func HeadshotNEQ(v int) predicate.MatchPlayer {
|
||||
|
||||
// HeadshotIn applies the In predicate on the "headshot" field.
|
||||
func HeadshotIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -579,7 +579,7 @@ func HeadshotIn(vs ...int) predicate.MatchPlayer {
|
||||
|
||||
// HeadshotNotIn applies the NotIn predicate on the "headshot" field.
|
||||
func HeadshotNotIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -632,7 +632,7 @@ func MvpNEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// MvpIn applies the In predicate on the "mvp" field.
|
||||
func MvpIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -643,7 +643,7 @@ func MvpIn(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// MvpNotIn applies the NotIn predicate on the "mvp" field.
|
||||
func MvpNotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -696,7 +696,7 @@ func ScoreNEQ(v int) predicate.MatchPlayer {
|
||||
|
||||
// ScoreIn applies the In predicate on the "score" field.
|
||||
func ScoreIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -707,7 +707,7 @@ func ScoreIn(vs ...int) predicate.MatchPlayer {
|
||||
|
||||
// ScoreNotIn applies the NotIn predicate on the "score" field.
|
||||
func ScoreNotIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -760,7 +760,7 @@ func RankNewNEQ(v int) predicate.MatchPlayer {
|
||||
|
||||
// RankNewIn applies the In predicate on the "rank_new" field.
|
||||
func RankNewIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -771,7 +771,7 @@ func RankNewIn(vs ...int) predicate.MatchPlayer {
|
||||
|
||||
// RankNewNotIn applies the NotIn predicate on the "rank_new" field.
|
||||
func RankNewNotIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -838,7 +838,7 @@ func RankOldNEQ(v int) predicate.MatchPlayer {
|
||||
|
||||
// RankOldIn applies the In predicate on the "rank_old" field.
|
||||
func RankOldIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -849,7 +849,7 @@ func RankOldIn(vs ...int) predicate.MatchPlayer {
|
||||
|
||||
// RankOldNotIn applies the NotIn predicate on the "rank_old" field.
|
||||
func RankOldNotIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -916,7 +916,7 @@ func Mk2NEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// Mk2In applies the In predicate on the "mk_2" field.
|
||||
func Mk2In(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -927,7 +927,7 @@ func Mk2In(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// Mk2NotIn applies the NotIn predicate on the "mk_2" field.
|
||||
func Mk2NotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -994,7 +994,7 @@ func Mk3NEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// Mk3In applies the In predicate on the "mk_3" field.
|
||||
func Mk3In(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1005,7 +1005,7 @@ func Mk3In(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// Mk3NotIn applies the NotIn predicate on the "mk_3" field.
|
||||
func Mk3NotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1072,7 +1072,7 @@ func Mk4NEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// Mk4In applies the In predicate on the "mk_4" field.
|
||||
func Mk4In(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1083,7 +1083,7 @@ func Mk4In(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// Mk4NotIn applies the NotIn predicate on the "mk_4" field.
|
||||
func Mk4NotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1150,7 +1150,7 @@ func Mk5NEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// Mk5In applies the In predicate on the "mk_5" field.
|
||||
func Mk5In(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1161,7 +1161,7 @@ func Mk5In(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// Mk5NotIn applies the NotIn predicate on the "mk_5" field.
|
||||
func Mk5NotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1228,7 +1228,7 @@ func DmgEnemyNEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// DmgEnemyIn applies the In predicate on the "dmg_enemy" field.
|
||||
func DmgEnemyIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1239,7 +1239,7 @@ func DmgEnemyIn(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// DmgEnemyNotIn applies the NotIn predicate on the "dmg_enemy" field.
|
||||
func DmgEnemyNotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1306,7 +1306,7 @@ func DmgTeamNEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// DmgTeamIn applies the In predicate on the "dmg_team" field.
|
||||
func DmgTeamIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1317,7 +1317,7 @@ func DmgTeamIn(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// DmgTeamNotIn applies the NotIn predicate on the "dmg_team" field.
|
||||
func DmgTeamNotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1384,7 +1384,7 @@ func UdHeNEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// UdHeIn applies the In predicate on the "ud_he" field.
|
||||
func UdHeIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1395,7 +1395,7 @@ func UdHeIn(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// UdHeNotIn applies the NotIn predicate on the "ud_he" field.
|
||||
func UdHeNotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1462,7 +1462,7 @@ func UdFlamesNEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// UdFlamesIn applies the In predicate on the "ud_flames" field.
|
||||
func UdFlamesIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1473,7 +1473,7 @@ func UdFlamesIn(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// UdFlamesNotIn applies the NotIn predicate on the "ud_flames" field.
|
||||
func UdFlamesNotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1540,7 +1540,7 @@ func UdFlashNEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// UdFlashIn applies the In predicate on the "ud_flash" field.
|
||||
func UdFlashIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1551,7 +1551,7 @@ func UdFlashIn(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// UdFlashNotIn applies the NotIn predicate on the "ud_flash" field.
|
||||
func UdFlashNotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1618,7 +1618,7 @@ func UdDecoyNEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// UdDecoyIn applies the In predicate on the "ud_decoy" field.
|
||||
func UdDecoyIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1629,7 +1629,7 @@ func UdDecoyIn(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// UdDecoyNotIn applies the NotIn predicate on the "ud_decoy" field.
|
||||
func UdDecoyNotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1696,7 +1696,7 @@ func UdSmokeNEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// UdSmokeIn applies the In predicate on the "ud_smoke" field.
|
||||
func UdSmokeIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1707,7 +1707,7 @@ func UdSmokeIn(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// UdSmokeNotIn applies the NotIn predicate on the "ud_smoke" field.
|
||||
func UdSmokeNotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1774,7 +1774,7 @@ func CrosshairNEQ(v string) predicate.MatchPlayer {
|
||||
|
||||
// CrosshairIn applies the In predicate on the "crosshair" field.
|
||||
func CrosshairIn(vs ...string) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1785,7 +1785,7 @@ func CrosshairIn(vs ...string) predicate.MatchPlayer {
|
||||
|
||||
// CrosshairNotIn applies the NotIn predicate on the "crosshair" field.
|
||||
func CrosshairNotIn(vs ...string) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1887,7 +1887,7 @@ func ColorNEQ(v Color) predicate.MatchPlayer {
|
||||
|
||||
// ColorIn applies the In predicate on the "color" field.
|
||||
func ColorIn(vs ...Color) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1898,7 +1898,7 @@ func ColorIn(vs ...Color) predicate.MatchPlayer {
|
||||
|
||||
// ColorNotIn applies the NotIn predicate on the "color" field.
|
||||
func ColorNotIn(vs ...Color) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1937,7 +1937,7 @@ func KastNEQ(v int) predicate.MatchPlayer {
|
||||
|
||||
// KastIn applies the In predicate on the "kast" field.
|
||||
func KastIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1948,7 +1948,7 @@ func KastIn(vs ...int) predicate.MatchPlayer {
|
||||
|
||||
// KastNotIn applies the NotIn predicate on the "kast" field.
|
||||
func KastNotIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2015,7 +2015,7 @@ func FlashDurationSelfNEQ(v float32) predicate.MatchPlayer {
|
||||
|
||||
// FlashDurationSelfIn applies the In predicate on the "flash_duration_self" field.
|
||||
func FlashDurationSelfIn(vs ...float32) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2026,7 +2026,7 @@ func FlashDurationSelfIn(vs ...float32) predicate.MatchPlayer {
|
||||
|
||||
// FlashDurationSelfNotIn applies the NotIn predicate on the "flash_duration_self" field.
|
||||
func FlashDurationSelfNotIn(vs ...float32) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2093,7 +2093,7 @@ func FlashDurationTeamNEQ(v float32) predicate.MatchPlayer {
|
||||
|
||||
// FlashDurationTeamIn applies the In predicate on the "flash_duration_team" field.
|
||||
func FlashDurationTeamIn(vs ...float32) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2104,7 +2104,7 @@ func FlashDurationTeamIn(vs ...float32) predicate.MatchPlayer {
|
||||
|
||||
// FlashDurationTeamNotIn applies the NotIn predicate on the "flash_duration_team" field.
|
||||
func FlashDurationTeamNotIn(vs ...float32) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2171,7 +2171,7 @@ func FlashDurationEnemyNEQ(v float32) predicate.MatchPlayer {
|
||||
|
||||
// FlashDurationEnemyIn applies the In predicate on the "flash_duration_enemy" field.
|
||||
func FlashDurationEnemyIn(vs ...float32) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2182,7 +2182,7 @@ func FlashDurationEnemyIn(vs ...float32) predicate.MatchPlayer {
|
||||
|
||||
// FlashDurationEnemyNotIn applies the NotIn predicate on the "flash_duration_enemy" field.
|
||||
func FlashDurationEnemyNotIn(vs ...float32) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2249,7 +2249,7 @@ func FlashTotalSelfNEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// FlashTotalSelfIn applies the In predicate on the "flash_total_self" field.
|
||||
func FlashTotalSelfIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2260,7 +2260,7 @@ func FlashTotalSelfIn(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// FlashTotalSelfNotIn applies the NotIn predicate on the "flash_total_self" field.
|
||||
func FlashTotalSelfNotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2327,7 +2327,7 @@ func FlashTotalTeamNEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// FlashTotalTeamIn applies the In predicate on the "flash_total_team" field.
|
||||
func FlashTotalTeamIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2338,7 +2338,7 @@ func FlashTotalTeamIn(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// FlashTotalTeamNotIn applies the NotIn predicate on the "flash_total_team" field.
|
||||
func FlashTotalTeamNotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2405,7 +2405,7 @@ func FlashTotalEnemyNEQ(v uint) predicate.MatchPlayer {
|
||||
|
||||
// FlashTotalEnemyIn applies the In predicate on the "flash_total_enemy" field.
|
||||
func FlashTotalEnemyIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2416,7 +2416,7 @@ func FlashTotalEnemyIn(vs ...uint) predicate.MatchPlayer {
|
||||
|
||||
// FlashTotalEnemyNotIn applies the NotIn predicate on the "flash_total_enemy" field.
|
||||
func FlashTotalEnemyNotIn(vs ...uint) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2483,7 +2483,7 @@ func MatchStatsNEQ(v uint64) predicate.MatchPlayer {
|
||||
|
||||
// MatchStatsIn applies the In predicate on the "match_stats" field.
|
||||
func MatchStatsIn(vs ...uint64) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2494,7 +2494,7 @@ func MatchStatsIn(vs ...uint64) predicate.MatchPlayer {
|
||||
|
||||
// MatchStatsNotIn applies the NotIn predicate on the "match_stats" field.
|
||||
func MatchStatsNotIn(vs ...uint64) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2533,7 +2533,7 @@ func PlayerStatsNEQ(v uint64) predicate.MatchPlayer {
|
||||
|
||||
// PlayerStatsIn applies the In predicate on the "player_stats" field.
|
||||
func PlayerStatsIn(vs ...uint64) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2544,7 +2544,7 @@ func PlayerStatsIn(vs ...uint64) predicate.MatchPlayer {
|
||||
|
||||
// PlayerStatsNotIn applies the NotIn predicate on the "player_stats" field.
|
||||
func PlayerStatsNotIn(vs ...uint64) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2583,7 +2583,7 @@ func FlashAssistsNEQ(v int) predicate.MatchPlayer {
|
||||
|
||||
// FlashAssistsIn applies the In predicate on the "flash_assists" field.
|
||||
func FlashAssistsIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -2594,7 +2594,7 @@ func FlashAssistsIn(vs ...int) predicate.MatchPlayer {
|
||||
|
||||
// FlashAssistsNotIn applies the NotIn predicate on the "flash_assists" field.
|
||||
func FlashAssistsNotIn(vs ...int) predicate.MatchPlayer {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
|
@@ -645,243 +645,123 @@ func (mpc *MatchPlayerCreate) createSpec() (*MatchPlayer, *sqlgraph.CreateSpec)
|
||||
}
|
||||
)
|
||||
if value, ok := mpc.mutation.TeamID(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldTeamID,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldTeamID, field.TypeInt, value)
|
||||
_node.TeamID = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Kills(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldKills,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldKills, field.TypeInt, value)
|
||||
_node.Kills = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Deaths(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldDeaths,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldDeaths, field.TypeInt, value)
|
||||
_node.Deaths = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Assists(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldAssists,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldAssists, field.TypeInt, value)
|
||||
_node.Assists = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Headshot(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldHeadshot,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldHeadshot, field.TypeInt, value)
|
||||
_node.Headshot = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Mvp(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldMvp,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldMvp, field.TypeUint, value)
|
||||
_node.Mvp = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Score(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldScore,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldScore, field.TypeInt, value)
|
||||
_node.Score = value
|
||||
}
|
||||
if value, ok := mpc.mutation.RankNew(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldRankNew,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldRankNew, field.TypeInt, value)
|
||||
_node.RankNew = value
|
||||
}
|
||||
if value, ok := mpc.mutation.RankOld(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldRankOld,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldRankOld, field.TypeInt, value)
|
||||
_node.RankOld = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Mk2(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldMk2,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldMk2, field.TypeUint, value)
|
||||
_node.Mk2 = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Mk3(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldMk3,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldMk3, field.TypeUint, value)
|
||||
_node.Mk3 = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Mk4(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldMk4,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldMk4, field.TypeUint, value)
|
||||
_node.Mk4 = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Mk5(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldMk5,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldMk5, field.TypeUint, value)
|
||||
_node.Mk5 = value
|
||||
}
|
||||
if value, ok := mpc.mutation.DmgEnemy(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldDmgEnemy,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldDmgEnemy, field.TypeUint, value)
|
||||
_node.DmgEnemy = value
|
||||
}
|
||||
if value, ok := mpc.mutation.DmgTeam(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldDmgTeam,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldDmgTeam, field.TypeUint, value)
|
||||
_node.DmgTeam = value
|
||||
}
|
||||
if value, ok := mpc.mutation.UdHe(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldUdHe,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldUdHe, field.TypeUint, value)
|
||||
_node.UdHe = value
|
||||
}
|
||||
if value, ok := mpc.mutation.UdFlames(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldUdFlames,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldUdFlames, field.TypeUint, value)
|
||||
_node.UdFlames = value
|
||||
}
|
||||
if value, ok := mpc.mutation.UdFlash(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldUdFlash,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldUdFlash, field.TypeUint, value)
|
||||
_node.UdFlash = value
|
||||
}
|
||||
if value, ok := mpc.mutation.UdDecoy(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldUdDecoy,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldUdDecoy, field.TypeUint, value)
|
||||
_node.UdDecoy = value
|
||||
}
|
||||
if value, ok := mpc.mutation.UdSmoke(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldUdSmoke,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldUdSmoke, field.TypeUint, value)
|
||||
_node.UdSmoke = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Crosshair(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldCrosshair,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldCrosshair, field.TypeString, value)
|
||||
_node.Crosshair = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Color(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeEnum,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldColor,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldColor, field.TypeEnum, value)
|
||||
_node.Color = value
|
||||
}
|
||||
if value, ok := mpc.mutation.Kast(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldKast,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldKast, field.TypeInt, value)
|
||||
_node.Kast = value
|
||||
}
|
||||
if value, ok := mpc.mutation.FlashDurationSelf(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeFloat32,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldFlashDurationSelf,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldFlashDurationSelf, field.TypeFloat32, value)
|
||||
_node.FlashDurationSelf = value
|
||||
}
|
||||
if value, ok := mpc.mutation.FlashDurationTeam(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeFloat32,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldFlashDurationTeam,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldFlashDurationTeam, field.TypeFloat32, value)
|
||||
_node.FlashDurationTeam = value
|
||||
}
|
||||
if value, ok := mpc.mutation.FlashDurationEnemy(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeFloat32,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldFlashDurationEnemy,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldFlashDurationEnemy, field.TypeFloat32, value)
|
||||
_node.FlashDurationEnemy = value
|
||||
}
|
||||
if value, ok := mpc.mutation.FlashTotalSelf(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldFlashTotalSelf,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldFlashTotalSelf, field.TypeUint, value)
|
||||
_node.FlashTotalSelf = value
|
||||
}
|
||||
if value, ok := mpc.mutation.FlashTotalTeam(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldFlashTotalTeam,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldFlashTotalTeam, field.TypeUint, value)
|
||||
_node.FlashTotalTeam = value
|
||||
}
|
||||
if value, ok := mpc.mutation.FlashTotalEnemy(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldFlashTotalEnemy,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldFlashTotalEnemy, field.TypeUint, value)
|
||||
_node.FlashTotalEnemy = value
|
||||
}
|
||||
if value, ok := mpc.mutation.FlashAssists(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: matchplayer.FieldFlashAssists,
|
||||
})
|
||||
_spec.SetField(matchplayer.FieldFlashAssists, field.TypeInt, value)
|
||||
_node.FlashAssists = value
|
||||
}
|
||||
if nodes := mpc.mutation.MatchesIDs(); len(nodes) > 0 {
|
||||
|
@@ -513,6 +513,11 @@ func (mpq *MatchPlayerQuery) Select(fields ...string) *MatchPlayerSelect {
|
||||
return selbuild
|
||||
}
|
||||
|
||||
// Aggregate returns a MatchPlayerSelect configured with the given aggregations.
|
||||
func (mpq *MatchPlayerQuery) Aggregate(fns ...AggregateFunc) *MatchPlayerSelect {
|
||||
return mpq.Select().Aggregate(fns...)
|
||||
}
|
||||
|
||||
func (mpq *MatchPlayerQuery) prepareQuery(ctx context.Context) error {
|
||||
for _, f := range mpq.fields {
|
||||
if !matchplayer.ValidColumn(f) {
|
||||
@@ -542,10 +547,10 @@ func (mpq *MatchPlayerQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]
|
||||
mpq.withMessages != nil,
|
||||
}
|
||||
)
|
||||
_spec.ScanValues = func(columns []string) ([]interface{}, error) {
|
||||
_spec.ScanValues = func(columns []string) ([]any, error) {
|
||||
return (*MatchPlayer).scanValues(nil, columns)
|
||||
}
|
||||
_spec.Assign = func(columns []string, values []interface{}) error {
|
||||
_spec.Assign = func(columns []string, values []any) error {
|
||||
node := &MatchPlayer{config: mpq.config}
|
||||
nodes = append(nodes, node)
|
||||
node.Edges.loadedTypes = loadedTypes
|
||||
@@ -796,11 +801,14 @@ func (mpq *MatchPlayerQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
}
|
||||
|
||||
func (mpq *MatchPlayerQuery) sqlExist(ctx context.Context) (bool, error) {
|
||||
n, err := mpq.sqlCount(ctx)
|
||||
if err != nil {
|
||||
switch _, err := mpq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
case err != nil:
|
||||
return false, fmt.Errorf("ent: check existence: %w", err)
|
||||
default:
|
||||
return true, nil
|
||||
}
|
||||
return n > 0, nil
|
||||
}
|
||||
|
||||
func (mpq *MatchPlayerQuery) querySpec() *sqlgraph.QuerySpec {
|
||||
@@ -910,7 +918,7 @@ func (mpgb *MatchPlayerGroupBy) Aggregate(fns ...AggregateFunc) *MatchPlayerGrou
|
||||
}
|
||||
|
||||
// Scan applies the group-by query and scans the result into the given value.
|
||||
func (mpgb *MatchPlayerGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
func (mpgb *MatchPlayerGroupBy) Scan(ctx context.Context, v any) error {
|
||||
query, err := mpgb.path(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -919,7 +927,7 @@ func (mpgb *MatchPlayerGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
return mpgb.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (mpgb *MatchPlayerGroupBy) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (mpgb *MatchPlayerGroupBy) sqlScan(ctx context.Context, v any) error {
|
||||
for _, f := range mpgb.fields {
|
||||
if !matchplayer.ValidColumn(f) {
|
||||
return &ValidationError{Name: f, err: fmt.Errorf("invalid field %q for group-by", f)}
|
||||
@@ -944,8 +952,6 @@ func (mpgb *MatchPlayerGroupBy) sqlQuery() *sql.Selector {
|
||||
for _, fn := range mpgb.fns {
|
||||
aggregation = append(aggregation, fn(selector))
|
||||
}
|
||||
// If no columns were selected in a custom aggregation function, the default
|
||||
// selection is the fields used for "group-by", and the aggregation functions.
|
||||
if len(selector.SelectedColumns()) == 0 {
|
||||
columns := make([]string, 0, len(mpgb.fields)+len(mpgb.fns))
|
||||
for _, f := range mpgb.fields {
|
||||
@@ -965,8 +971,14 @@ type MatchPlayerSelect struct {
|
||||
sql *sql.Selector
|
||||
}
|
||||
|
||||
// Aggregate adds the given aggregation functions to the selector query.
|
||||
func (mps *MatchPlayerSelect) Aggregate(fns ...AggregateFunc) *MatchPlayerSelect {
|
||||
mps.fns = append(mps.fns, fns...)
|
||||
return mps
|
||||
}
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (mps *MatchPlayerSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
func (mps *MatchPlayerSelect) Scan(ctx context.Context, v any) error {
|
||||
if err := mps.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -974,7 +986,17 @@ func (mps *MatchPlayerSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
return mps.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (mps *MatchPlayerSelect) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (mps *MatchPlayerSelect) sqlScan(ctx context.Context, v any) error {
|
||||
aggregation := make([]string, 0, len(mps.fns))
|
||||
for _, fn := range mps.fns {
|
||||
aggregation = append(aggregation, fn(mps.sql))
|
||||
}
|
||||
switch n := len(*mps.selector.flds); {
|
||||
case n == 0 && len(aggregation) > 0:
|
||||
mps.sql.Select(aggregation...)
|
||||
case n != 0 && len(aggregation) > 0:
|
||||
mps.sql.AppendSelect(aggregation...)
|
||||
}
|
||||
rows := &sql.Rows{}
|
||||
query, args := mps.sql.Query()
|
||||
if err := mps.driver.Query(ctx, query, args, rows); err != nil {
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -51,8 +51,8 @@ func (e MessagesEdges) MatchPlayerOrErr() (*MatchPlayer, error) {
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Messages) scanValues(columns []string) ([]interface{}, error) {
|
||||
values := make([]interface{}, len(columns))
|
||||
func (*Messages) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case messages.FieldAllChat:
|
||||
@@ -72,7 +72,7 @@ func (*Messages) scanValues(columns []string) ([]interface{}, error) {
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the Messages fields.
|
||||
func (m *Messages) assignValues(columns []string, values []interface{}) error {
|
||||
func (m *Messages) assignValues(columns []string, values []any) error {
|
||||
if m, n := len(values), len(columns); m < n {
|
||||
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ func IDNEQ(id int) predicate.Messages {
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.Messages {
|
||||
return predicate.Messages(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -43,7 +43,7 @@ func IDIn(ids ...int) predicate.Messages {
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.Messages {
|
||||
return predicate.Messages(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -116,7 +116,7 @@ func MessageNEQ(v string) predicate.Messages {
|
||||
|
||||
// MessageIn applies the In predicate on the "message" field.
|
||||
func MessageIn(vs ...string) predicate.Messages {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -127,7 +127,7 @@ func MessageIn(vs ...string) predicate.Messages {
|
||||
|
||||
// MessageNotIn applies the NotIn predicate on the "message" field.
|
||||
func MessageNotIn(vs ...string) predicate.Messages {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -229,7 +229,7 @@ func TickNEQ(v int) predicate.Messages {
|
||||
|
||||
// TickIn applies the In predicate on the "tick" field.
|
||||
func TickIn(vs ...int) predicate.Messages {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -240,7 +240,7 @@ func TickIn(vs ...int) predicate.Messages {
|
||||
|
||||
// TickNotIn applies the NotIn predicate on the "tick" field.
|
||||
func TickNotIn(vs ...int) predicate.Messages {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
|
@@ -170,27 +170,15 @@ func (mc *MessagesCreate) createSpec() (*Messages, *sqlgraph.CreateSpec) {
|
||||
}
|
||||
)
|
||||
if value, ok := mc.mutation.Message(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: messages.FieldMessage,
|
||||
})
|
||||
_spec.SetField(messages.FieldMessage, field.TypeString, value)
|
||||
_node.Message = value
|
||||
}
|
||||
if value, ok := mc.mutation.AllChat(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: messages.FieldAllChat,
|
||||
})
|
||||
_spec.SetField(messages.FieldAllChat, field.TypeBool, value)
|
||||
_node.AllChat = value
|
||||
}
|
||||
if value, ok := mc.mutation.Tick(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: messages.FieldTick,
|
||||
})
|
||||
_spec.SetField(messages.FieldTick, field.TypeInt, value)
|
||||
_node.Tick = value
|
||||
}
|
||||
if nodes := mc.mutation.MatchPlayerIDs(); len(nodes) > 0 {
|
||||
|
@@ -333,6 +333,11 @@ func (mq *MessagesQuery) Select(fields ...string) *MessagesSelect {
|
||||
return selbuild
|
||||
}
|
||||
|
||||
// Aggregate returns a MessagesSelect configured with the given aggregations.
|
||||
func (mq *MessagesQuery) Aggregate(fns ...AggregateFunc) *MessagesSelect {
|
||||
return mq.Select().Aggregate(fns...)
|
||||
}
|
||||
|
||||
func (mq *MessagesQuery) prepareQuery(ctx context.Context) error {
|
||||
for _, f := range mq.fields {
|
||||
if !messages.ValidColumn(f) {
|
||||
@@ -364,10 +369,10 @@ func (mq *MessagesQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Mes
|
||||
if withFKs {
|
||||
_spec.Node.Columns = append(_spec.Node.Columns, messages.ForeignKeys...)
|
||||
}
|
||||
_spec.ScanValues = func(columns []string) ([]interface{}, error) {
|
||||
_spec.ScanValues = func(columns []string) ([]any, error) {
|
||||
return (*Messages).scanValues(nil, columns)
|
||||
}
|
||||
_spec.Assign = func(columns []string, values []interface{}) error {
|
||||
_spec.Assign = func(columns []string, values []any) error {
|
||||
node := &Messages{config: mq.config}
|
||||
nodes = append(nodes, node)
|
||||
node.Edges.loadedTypes = loadedTypes
|
||||
@@ -437,11 +442,14 @@ func (mq *MessagesQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
}
|
||||
|
||||
func (mq *MessagesQuery) sqlExist(ctx context.Context) (bool, error) {
|
||||
n, err := mq.sqlCount(ctx)
|
||||
if err != nil {
|
||||
switch _, err := mq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
case err != nil:
|
||||
return false, fmt.Errorf("ent: check existence: %w", err)
|
||||
default:
|
||||
return true, nil
|
||||
}
|
||||
return n > 0, nil
|
||||
}
|
||||
|
||||
func (mq *MessagesQuery) querySpec() *sqlgraph.QuerySpec {
|
||||
@@ -551,7 +559,7 @@ func (mgb *MessagesGroupBy) Aggregate(fns ...AggregateFunc) *MessagesGroupBy {
|
||||
}
|
||||
|
||||
// Scan applies the group-by query and scans the result into the given value.
|
||||
func (mgb *MessagesGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
func (mgb *MessagesGroupBy) Scan(ctx context.Context, v any) error {
|
||||
query, err := mgb.path(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -560,7 +568,7 @@ func (mgb *MessagesGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
return mgb.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (mgb *MessagesGroupBy) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (mgb *MessagesGroupBy) sqlScan(ctx context.Context, v any) error {
|
||||
for _, f := range mgb.fields {
|
||||
if !messages.ValidColumn(f) {
|
||||
return &ValidationError{Name: f, err: fmt.Errorf("invalid field %q for group-by", f)}
|
||||
@@ -585,8 +593,6 @@ func (mgb *MessagesGroupBy) sqlQuery() *sql.Selector {
|
||||
for _, fn := range mgb.fns {
|
||||
aggregation = append(aggregation, fn(selector))
|
||||
}
|
||||
// If no columns were selected in a custom aggregation function, the default
|
||||
// selection is the fields used for "group-by", and the aggregation functions.
|
||||
if len(selector.SelectedColumns()) == 0 {
|
||||
columns := make([]string, 0, len(mgb.fields)+len(mgb.fns))
|
||||
for _, f := range mgb.fields {
|
||||
@@ -606,8 +612,14 @@ type MessagesSelect struct {
|
||||
sql *sql.Selector
|
||||
}
|
||||
|
||||
// Aggregate adds the given aggregation functions to the selector query.
|
||||
func (ms *MessagesSelect) Aggregate(fns ...AggregateFunc) *MessagesSelect {
|
||||
ms.fns = append(ms.fns, fns...)
|
||||
return ms
|
||||
}
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (ms *MessagesSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
func (ms *MessagesSelect) Scan(ctx context.Context, v any) error {
|
||||
if err := ms.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -615,7 +627,17 @@ func (ms *MessagesSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
return ms.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (ms *MessagesSelect) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (ms *MessagesSelect) sqlScan(ctx context.Context, v any) error {
|
||||
aggregation := make([]string, 0, len(ms.fns))
|
||||
for _, fn := range ms.fns {
|
||||
aggregation = append(aggregation, fn(ms.sql))
|
||||
}
|
||||
switch n := len(*ms.selector.flds); {
|
||||
case n == 0 && len(aggregation) > 0:
|
||||
ms.sql.Select(aggregation...)
|
||||
case n != 0 && len(aggregation) > 0:
|
||||
ms.sql.AppendSelect(aggregation...)
|
||||
}
|
||||
rows := &sql.Rows{}
|
||||
query, args := ms.sql.Query()
|
||||
if err := ms.driver.Query(ctx, query, args, rows); err != nil {
|
||||
|
@@ -163,32 +163,16 @@ func (mu *MessagesUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
}
|
||||
if value, ok := mu.mutation.Message(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: messages.FieldMessage,
|
||||
})
|
||||
_spec.SetField(messages.FieldMessage, field.TypeString, value)
|
||||
}
|
||||
if value, ok := mu.mutation.AllChat(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: messages.FieldAllChat,
|
||||
})
|
||||
_spec.SetField(messages.FieldAllChat, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := mu.mutation.Tick(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: messages.FieldTick,
|
||||
})
|
||||
_spec.SetField(messages.FieldTick, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := mu.mutation.AddedTick(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: messages.FieldTick,
|
||||
})
|
||||
_spec.AddField(messages.FieldTick, field.TypeInt, value)
|
||||
}
|
||||
if mu.mutation.MatchPlayerCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -225,7 +209,7 @@ func (mu *MessagesUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = mu.modifiers
|
||||
_spec.AddModifiers(mu.modifiers...)
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, mu.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{messages.Label}
|
||||
@@ -410,32 +394,16 @@ func (muo *MessagesUpdateOne) sqlSave(ctx context.Context) (_node *Messages, err
|
||||
}
|
||||
}
|
||||
if value, ok := muo.mutation.Message(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: messages.FieldMessage,
|
||||
})
|
||||
_spec.SetField(messages.FieldMessage, field.TypeString, value)
|
||||
}
|
||||
if value, ok := muo.mutation.AllChat(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBool,
|
||||
Value: value,
|
||||
Column: messages.FieldAllChat,
|
||||
})
|
||||
_spec.SetField(messages.FieldAllChat, field.TypeBool, value)
|
||||
}
|
||||
if value, ok := muo.mutation.Tick(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: messages.FieldTick,
|
||||
})
|
||||
_spec.SetField(messages.FieldTick, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := muo.mutation.AddedTick(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: messages.FieldTick,
|
||||
})
|
||||
_spec.AddField(messages.FieldTick, field.TypeInt, value)
|
||||
}
|
||||
if muo.mutation.MatchPlayerCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -472,7 +440,7 @@ func (muo *MessagesUpdateOne) sqlSave(ctx context.Context) (_node *Messages, err
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = muo.modifiers
|
||||
_spec.AddModifiers(muo.modifiers...)
|
||||
_node = &Messages{config: muo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
|
@@ -5862,8 +5862,6 @@ func (m *MessagesMutation) RemovedEdges() []string {
|
||||
// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
|
||||
// the given name in this mutation.
|
||||
func (m *MessagesMutation) RemovedIDs(name string) []ent.Value {
|
||||
switch name {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -8303,8 +8301,6 @@ func (m *RoundStatsMutation) RemovedEdges() []string {
|
||||
// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
|
||||
// the given name in this mutation.
|
||||
func (m *RoundStatsMutation) RemovedIDs(name string) []ent.Value {
|
||||
switch name {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -8773,8 +8769,6 @@ func (m *SprayMutation) RemovedEdges() []string {
|
||||
// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
|
||||
// the given name in this mutation.
|
||||
func (m *SprayMutation) RemovedIDs(name string) []ent.Value {
|
||||
switch name {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -9450,8 +9444,6 @@ func (m *WeaponMutation) RemovedEdges() []string {
|
||||
// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
|
||||
// the given name in this mutation.
|
||||
func (m *WeaponMutation) RemovedIDs(name string) []ent.Value {
|
||||
switch name {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@@ -83,8 +83,8 @@ func (e PlayerEdges) MatchesOrErr() ([]*Match, error) {
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Player) scanValues(columns []string) ([]interface{}, error) {
|
||||
values := make([]interface{}, len(columns))
|
||||
func (*Player) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case player.FieldID, player.FieldVacCount, player.FieldGameBanCount, player.FieldWins, player.FieldLooses, player.FieldTies:
|
||||
@@ -102,7 +102,7 @@ func (*Player) scanValues(columns []string) ([]interface{}, error) {
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the Player fields.
|
||||
func (pl *Player) assignValues(columns []string, values []interface{}) error {
|
||||
func (pl *Player) assignValues(columns []string, values []any) error {
|
||||
if m, n := len(values), len(columns); m < n {
|
||||
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ func IDNEQ(id uint64) predicate.Player {
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...uint64) predicate.Player {
|
||||
return predicate.Player(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -45,7 +45,7 @@ func IDIn(ids ...uint64) predicate.Player {
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...uint64) predicate.Player {
|
||||
return predicate.Player(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -209,7 +209,7 @@ func NameNEQ(v string) predicate.Player {
|
||||
|
||||
// NameIn applies the In predicate on the "name" field.
|
||||
func NameIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -220,7 +220,7 @@ func NameIn(vs ...string) predicate.Player {
|
||||
|
||||
// NameNotIn applies the NotIn predicate on the "name" field.
|
||||
func NameNotIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -322,7 +322,7 @@ func AvatarNEQ(v string) predicate.Player {
|
||||
|
||||
// AvatarIn applies the In predicate on the "avatar" field.
|
||||
func AvatarIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -333,7 +333,7 @@ func AvatarIn(vs ...string) predicate.Player {
|
||||
|
||||
// AvatarNotIn applies the NotIn predicate on the "avatar" field.
|
||||
func AvatarNotIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -435,7 +435,7 @@ func VanityURLNEQ(v string) predicate.Player {
|
||||
|
||||
// VanityURLIn applies the In predicate on the "vanity_url" field.
|
||||
func VanityURLIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -446,7 +446,7 @@ func VanityURLIn(vs ...string) predicate.Player {
|
||||
|
||||
// VanityURLNotIn applies the NotIn predicate on the "vanity_url" field.
|
||||
func VanityURLNotIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -548,7 +548,7 @@ func VanityURLRealNEQ(v string) predicate.Player {
|
||||
|
||||
// VanityURLRealIn applies the In predicate on the "vanity_url_real" field.
|
||||
func VanityURLRealIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -559,7 +559,7 @@ func VanityURLRealIn(vs ...string) predicate.Player {
|
||||
|
||||
// VanityURLRealNotIn applies the NotIn predicate on the "vanity_url_real" field.
|
||||
func VanityURLRealNotIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -661,7 +661,7 @@ func VacDateNEQ(v time.Time) predicate.Player {
|
||||
|
||||
// VacDateIn applies the In predicate on the "vac_date" field.
|
||||
func VacDateIn(vs ...time.Time) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -672,7 +672,7 @@ func VacDateIn(vs ...time.Time) predicate.Player {
|
||||
|
||||
// VacDateNotIn applies the NotIn predicate on the "vac_date" field.
|
||||
func VacDateNotIn(vs ...time.Time) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -739,7 +739,7 @@ func VacCountNEQ(v int) predicate.Player {
|
||||
|
||||
// VacCountIn applies the In predicate on the "vac_count" field.
|
||||
func VacCountIn(vs ...int) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -750,7 +750,7 @@ func VacCountIn(vs ...int) predicate.Player {
|
||||
|
||||
// VacCountNotIn applies the NotIn predicate on the "vac_count" field.
|
||||
func VacCountNotIn(vs ...int) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -817,7 +817,7 @@ func GameBanDateNEQ(v time.Time) predicate.Player {
|
||||
|
||||
// GameBanDateIn applies the In predicate on the "game_ban_date" field.
|
||||
func GameBanDateIn(vs ...time.Time) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -828,7 +828,7 @@ func GameBanDateIn(vs ...time.Time) predicate.Player {
|
||||
|
||||
// GameBanDateNotIn applies the NotIn predicate on the "game_ban_date" field.
|
||||
func GameBanDateNotIn(vs ...time.Time) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -895,7 +895,7 @@ func GameBanCountNEQ(v int) predicate.Player {
|
||||
|
||||
// GameBanCountIn applies the In predicate on the "game_ban_count" field.
|
||||
func GameBanCountIn(vs ...int) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -906,7 +906,7 @@ func GameBanCountIn(vs ...int) predicate.Player {
|
||||
|
||||
// GameBanCountNotIn applies the NotIn predicate on the "game_ban_count" field.
|
||||
func GameBanCountNotIn(vs ...int) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -973,7 +973,7 @@ func SteamUpdatedNEQ(v time.Time) predicate.Player {
|
||||
|
||||
// SteamUpdatedIn applies the In predicate on the "steam_updated" field.
|
||||
func SteamUpdatedIn(vs ...time.Time) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -984,7 +984,7 @@ func SteamUpdatedIn(vs ...time.Time) predicate.Player {
|
||||
|
||||
// SteamUpdatedNotIn applies the NotIn predicate on the "steam_updated" field.
|
||||
func SteamUpdatedNotIn(vs ...time.Time) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1037,7 +1037,7 @@ func SharecodeUpdatedNEQ(v time.Time) predicate.Player {
|
||||
|
||||
// SharecodeUpdatedIn applies the In predicate on the "sharecode_updated" field.
|
||||
func SharecodeUpdatedIn(vs ...time.Time) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1048,7 +1048,7 @@ func SharecodeUpdatedIn(vs ...time.Time) predicate.Player {
|
||||
|
||||
// SharecodeUpdatedNotIn applies the NotIn predicate on the "sharecode_updated" field.
|
||||
func SharecodeUpdatedNotIn(vs ...time.Time) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1115,7 +1115,7 @@ func AuthCodeNEQ(v string) predicate.Player {
|
||||
|
||||
// AuthCodeIn applies the In predicate on the "auth_code" field.
|
||||
func AuthCodeIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1126,7 +1126,7 @@ func AuthCodeIn(vs ...string) predicate.Player {
|
||||
|
||||
// AuthCodeNotIn applies the NotIn predicate on the "auth_code" field.
|
||||
func AuthCodeNotIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1228,7 +1228,7 @@ func ProfileCreatedNEQ(v time.Time) predicate.Player {
|
||||
|
||||
// ProfileCreatedIn applies the In predicate on the "profile_created" field.
|
||||
func ProfileCreatedIn(vs ...time.Time) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1239,7 +1239,7 @@ func ProfileCreatedIn(vs ...time.Time) predicate.Player {
|
||||
|
||||
// ProfileCreatedNotIn applies the NotIn predicate on the "profile_created" field.
|
||||
func ProfileCreatedNotIn(vs ...time.Time) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1306,7 +1306,7 @@ func OldestSharecodeSeenNEQ(v string) predicate.Player {
|
||||
|
||||
// OldestSharecodeSeenIn applies the In predicate on the "oldest_sharecode_seen" field.
|
||||
func OldestSharecodeSeenIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1317,7 +1317,7 @@ func OldestSharecodeSeenIn(vs ...string) predicate.Player {
|
||||
|
||||
// OldestSharecodeSeenNotIn applies the NotIn predicate on the "oldest_sharecode_seen" field.
|
||||
func OldestSharecodeSeenNotIn(vs ...string) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1419,7 +1419,7 @@ func WinsNEQ(v int) predicate.Player {
|
||||
|
||||
// WinsIn applies the In predicate on the "wins" field.
|
||||
func WinsIn(vs ...int) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1430,7 +1430,7 @@ func WinsIn(vs ...int) predicate.Player {
|
||||
|
||||
// WinsNotIn applies the NotIn predicate on the "wins" field.
|
||||
func WinsNotIn(vs ...int) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1497,7 +1497,7 @@ func LoosesNEQ(v int) predicate.Player {
|
||||
|
||||
// LoosesIn applies the In predicate on the "looses" field.
|
||||
func LoosesIn(vs ...int) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1508,7 +1508,7 @@ func LoosesIn(vs ...int) predicate.Player {
|
||||
|
||||
// LoosesNotIn applies the NotIn predicate on the "looses" field.
|
||||
func LoosesNotIn(vs ...int) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1575,7 +1575,7 @@ func TiesNEQ(v int) predicate.Player {
|
||||
|
||||
// TiesIn applies the In predicate on the "ties" field.
|
||||
func TiesIn(vs ...int) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -1586,7 +1586,7 @@ func TiesIn(vs ...int) predicate.Player {
|
||||
|
||||
// TiesNotIn applies the NotIn predicate on the "ties" field.
|
||||
func TiesNotIn(vs ...int) predicate.Player {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
|
@@ -404,131 +404,67 @@ func (pc *PlayerCreate) createSpec() (*Player, *sqlgraph.CreateSpec) {
|
||||
_spec.ID.Value = id
|
||||
}
|
||||
if value, ok := pc.mutation.Name(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldName,
|
||||
})
|
||||
_spec.SetField(player.FieldName, field.TypeString, value)
|
||||
_node.Name = value
|
||||
}
|
||||
if value, ok := pc.mutation.Avatar(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldAvatar,
|
||||
})
|
||||
_spec.SetField(player.FieldAvatar, field.TypeString, value)
|
||||
_node.Avatar = value
|
||||
}
|
||||
if value, ok := pc.mutation.VanityURL(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldVanityURL,
|
||||
})
|
||||
_spec.SetField(player.FieldVanityURL, field.TypeString, value)
|
||||
_node.VanityURL = value
|
||||
}
|
||||
if value, ok := pc.mutation.VanityURLReal(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldVanityURLReal,
|
||||
})
|
||||
_spec.SetField(player.FieldVanityURLReal, field.TypeString, value)
|
||||
_node.VanityURLReal = value
|
||||
}
|
||||
if value, ok := pc.mutation.VacDate(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldVacDate,
|
||||
})
|
||||
_spec.SetField(player.FieldVacDate, field.TypeTime, value)
|
||||
_node.VacDate = value
|
||||
}
|
||||
if value, ok := pc.mutation.VacCount(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldVacCount,
|
||||
})
|
||||
_spec.SetField(player.FieldVacCount, field.TypeInt, value)
|
||||
_node.VacCount = value
|
||||
}
|
||||
if value, ok := pc.mutation.GameBanDate(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldGameBanDate,
|
||||
})
|
||||
_spec.SetField(player.FieldGameBanDate, field.TypeTime, value)
|
||||
_node.GameBanDate = value
|
||||
}
|
||||
if value, ok := pc.mutation.GameBanCount(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldGameBanCount,
|
||||
})
|
||||
_spec.SetField(player.FieldGameBanCount, field.TypeInt, value)
|
||||
_node.GameBanCount = value
|
||||
}
|
||||
if value, ok := pc.mutation.SteamUpdated(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldSteamUpdated,
|
||||
})
|
||||
_spec.SetField(player.FieldSteamUpdated, field.TypeTime, value)
|
||||
_node.SteamUpdated = value
|
||||
}
|
||||
if value, ok := pc.mutation.SharecodeUpdated(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldSharecodeUpdated,
|
||||
})
|
||||
_spec.SetField(player.FieldSharecodeUpdated, field.TypeTime, value)
|
||||
_node.SharecodeUpdated = value
|
||||
}
|
||||
if value, ok := pc.mutation.AuthCode(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldAuthCode,
|
||||
})
|
||||
_spec.SetField(player.FieldAuthCode, field.TypeString, value)
|
||||
_node.AuthCode = value
|
||||
}
|
||||
if value, ok := pc.mutation.ProfileCreated(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldProfileCreated,
|
||||
})
|
||||
_spec.SetField(player.FieldProfileCreated, field.TypeTime, value)
|
||||
_node.ProfileCreated = value
|
||||
}
|
||||
if value, ok := pc.mutation.OldestSharecodeSeen(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldOldestSharecodeSeen,
|
||||
})
|
||||
_spec.SetField(player.FieldOldestSharecodeSeen, field.TypeString, value)
|
||||
_node.OldestSharecodeSeen = value
|
||||
}
|
||||
if value, ok := pc.mutation.Wins(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
_spec.SetField(player.FieldWins, field.TypeInt, value)
|
||||
_node.Wins = value
|
||||
}
|
||||
if value, ok := pc.mutation.Looses(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
_spec.SetField(player.FieldLooses, field.TypeInt, value)
|
||||
_node.Looses = value
|
||||
}
|
||||
if value, ok := pc.mutation.Ties(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
_spec.SetField(player.FieldTies, field.TypeInt, value)
|
||||
_node.Ties = value
|
||||
}
|
||||
if nodes := pc.mutation.StatsIDs(); len(nodes) > 0 {
|
||||
|
@@ -369,6 +369,11 @@ func (pq *PlayerQuery) Select(fields ...string) *PlayerSelect {
|
||||
return selbuild
|
||||
}
|
||||
|
||||
// Aggregate returns a PlayerSelect configured with the given aggregations.
|
||||
func (pq *PlayerQuery) Aggregate(fns ...AggregateFunc) *PlayerSelect {
|
||||
return pq.Select().Aggregate(fns...)
|
||||
}
|
||||
|
||||
func (pq *PlayerQuery) prepareQuery(ctx context.Context) error {
|
||||
for _, f := range pq.fields {
|
||||
if !player.ValidColumn(f) {
|
||||
@@ -394,10 +399,10 @@ func (pq *PlayerQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Playe
|
||||
pq.withMatches != nil,
|
||||
}
|
||||
)
|
||||
_spec.ScanValues = func(columns []string) ([]interface{}, error) {
|
||||
_spec.ScanValues = func(columns []string) ([]any, error) {
|
||||
return (*Player).scanValues(nil, columns)
|
||||
}
|
||||
_spec.Assign = func(columns []string, values []interface{}) error {
|
||||
_spec.Assign = func(columns []string, values []any) error {
|
||||
node := &Player{config: pq.config}
|
||||
nodes = append(nodes, node)
|
||||
node.Edges.loadedTypes = loadedTypes
|
||||
@@ -485,18 +490,18 @@ func (pq *PlayerQuery) loadMatches(ctx context.Context, query *MatchQuery, nodes
|
||||
neighbors, err := query.sqlAll(ctx, func(_ context.Context, spec *sqlgraph.QuerySpec) {
|
||||
assign := spec.Assign
|
||||
values := spec.ScanValues
|
||||
spec.ScanValues = func(columns []string) ([]interface{}, error) {
|
||||
spec.ScanValues = func(columns []string) ([]any, error) {
|
||||
values, err := values(columns[1:])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return append([]interface{}{new(sql.NullInt64)}, values...), nil
|
||||
return append([]any{new(sql.NullInt64)}, values...), nil
|
||||
}
|
||||
spec.Assign = func(columns []string, values []interface{}) error {
|
||||
spec.Assign = func(columns []string, values []any) error {
|
||||
outValue := uint64(values[0].(*sql.NullInt64).Int64)
|
||||
inValue := uint64(values[1].(*sql.NullInt64).Int64)
|
||||
if nids[inValue] == nil {
|
||||
nids[inValue] = map[*Player]struct{}{byID[outValue]: struct{}{}}
|
||||
nids[inValue] = map[*Player]struct{}{byID[outValue]: {}}
|
||||
return assign(columns[1:], values[1:])
|
||||
}
|
||||
nids[inValue][byID[outValue]] = struct{}{}
|
||||
@@ -531,11 +536,14 @@ func (pq *PlayerQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
}
|
||||
|
||||
func (pq *PlayerQuery) sqlExist(ctx context.Context) (bool, error) {
|
||||
n, err := pq.sqlCount(ctx)
|
||||
if err != nil {
|
||||
switch _, err := pq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
case err != nil:
|
||||
return false, fmt.Errorf("ent: check existence: %w", err)
|
||||
default:
|
||||
return true, nil
|
||||
}
|
||||
return n > 0, nil
|
||||
}
|
||||
|
||||
func (pq *PlayerQuery) querySpec() *sqlgraph.QuerySpec {
|
||||
@@ -645,7 +653,7 @@ func (pgb *PlayerGroupBy) Aggregate(fns ...AggregateFunc) *PlayerGroupBy {
|
||||
}
|
||||
|
||||
// Scan applies the group-by query and scans the result into the given value.
|
||||
func (pgb *PlayerGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
func (pgb *PlayerGroupBy) Scan(ctx context.Context, v any) error {
|
||||
query, err := pgb.path(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -654,7 +662,7 @@ func (pgb *PlayerGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
return pgb.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (pgb *PlayerGroupBy) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (pgb *PlayerGroupBy) sqlScan(ctx context.Context, v any) error {
|
||||
for _, f := range pgb.fields {
|
||||
if !player.ValidColumn(f) {
|
||||
return &ValidationError{Name: f, err: fmt.Errorf("invalid field %q for group-by", f)}
|
||||
@@ -679,8 +687,6 @@ func (pgb *PlayerGroupBy) sqlQuery() *sql.Selector {
|
||||
for _, fn := range pgb.fns {
|
||||
aggregation = append(aggregation, fn(selector))
|
||||
}
|
||||
// If no columns were selected in a custom aggregation function, the default
|
||||
// selection is the fields used for "group-by", and the aggregation functions.
|
||||
if len(selector.SelectedColumns()) == 0 {
|
||||
columns := make([]string, 0, len(pgb.fields)+len(pgb.fns))
|
||||
for _, f := range pgb.fields {
|
||||
@@ -700,8 +706,14 @@ type PlayerSelect struct {
|
||||
sql *sql.Selector
|
||||
}
|
||||
|
||||
// Aggregate adds the given aggregation functions to the selector query.
|
||||
func (ps *PlayerSelect) Aggregate(fns ...AggregateFunc) *PlayerSelect {
|
||||
ps.fns = append(ps.fns, fns...)
|
||||
return ps
|
||||
}
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (ps *PlayerSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
func (ps *PlayerSelect) Scan(ctx context.Context, v any) error {
|
||||
if err := ps.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -709,7 +721,17 @@ func (ps *PlayerSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
return ps.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (ps *PlayerSelect) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (ps *PlayerSelect) sqlScan(ctx context.Context, v any) error {
|
||||
aggregation := make([]string, 0, len(ps.fns))
|
||||
for _, fn := range ps.fns {
|
||||
aggregation = append(aggregation, fn(ps.sql))
|
||||
}
|
||||
switch n := len(*ps.selector.flds); {
|
||||
case n == 0 && len(aggregation) > 0:
|
||||
ps.sql.Select(aggregation...)
|
||||
case n != 0 && len(aggregation) > 0:
|
||||
ps.sql.AppendSelect(aggregation...)
|
||||
}
|
||||
rows := &sql.Rows{}
|
||||
query, args := ps.sql.Query()
|
||||
if err := ps.driver.Query(ctx, query, args, rows); err != nil {
|
||||
|
@@ -536,241 +536,112 @@ func (pu *PlayerUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
}
|
||||
if value, ok := pu.mutation.Name(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldName,
|
||||
})
|
||||
_spec.SetField(player.FieldName, field.TypeString, value)
|
||||
}
|
||||
if pu.mutation.NameCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldName,
|
||||
})
|
||||
_spec.ClearField(player.FieldName, field.TypeString)
|
||||
}
|
||||
if value, ok := pu.mutation.Avatar(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldAvatar,
|
||||
})
|
||||
_spec.SetField(player.FieldAvatar, field.TypeString, value)
|
||||
}
|
||||
if pu.mutation.AvatarCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldAvatar,
|
||||
})
|
||||
_spec.ClearField(player.FieldAvatar, field.TypeString)
|
||||
}
|
||||
if value, ok := pu.mutation.VanityURL(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldVanityURL,
|
||||
})
|
||||
_spec.SetField(player.FieldVanityURL, field.TypeString, value)
|
||||
}
|
||||
if pu.mutation.VanityURLCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldVanityURL,
|
||||
})
|
||||
_spec.ClearField(player.FieldVanityURL, field.TypeString)
|
||||
}
|
||||
if value, ok := pu.mutation.VanityURLReal(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldVanityURLReal,
|
||||
})
|
||||
_spec.SetField(player.FieldVanityURLReal, field.TypeString, value)
|
||||
}
|
||||
if pu.mutation.VanityURLRealCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldVanityURLReal,
|
||||
})
|
||||
_spec.ClearField(player.FieldVanityURLReal, field.TypeString)
|
||||
}
|
||||
if value, ok := pu.mutation.VacDate(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldVacDate,
|
||||
})
|
||||
_spec.SetField(player.FieldVacDate, field.TypeTime, value)
|
||||
}
|
||||
if pu.mutation.VacDateCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: player.FieldVacDate,
|
||||
})
|
||||
_spec.ClearField(player.FieldVacDate, field.TypeTime)
|
||||
}
|
||||
if value, ok := pu.mutation.VacCount(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldVacCount,
|
||||
})
|
||||
_spec.SetField(player.FieldVacCount, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := pu.mutation.AddedVacCount(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldVacCount,
|
||||
})
|
||||
_spec.AddField(player.FieldVacCount, field.TypeInt, value)
|
||||
}
|
||||
if pu.mutation.VacCountCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldVacCount,
|
||||
})
|
||||
_spec.ClearField(player.FieldVacCount, field.TypeInt)
|
||||
}
|
||||
if value, ok := pu.mutation.GameBanDate(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldGameBanDate,
|
||||
})
|
||||
_spec.SetField(player.FieldGameBanDate, field.TypeTime, value)
|
||||
}
|
||||
if pu.mutation.GameBanDateCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: player.FieldGameBanDate,
|
||||
})
|
||||
_spec.ClearField(player.FieldGameBanDate, field.TypeTime)
|
||||
}
|
||||
if value, ok := pu.mutation.GameBanCount(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldGameBanCount,
|
||||
})
|
||||
_spec.SetField(player.FieldGameBanCount, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := pu.mutation.AddedGameBanCount(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldGameBanCount,
|
||||
})
|
||||
_spec.AddField(player.FieldGameBanCount, field.TypeInt, value)
|
||||
}
|
||||
if pu.mutation.GameBanCountCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldGameBanCount,
|
||||
})
|
||||
_spec.ClearField(player.FieldGameBanCount, field.TypeInt)
|
||||
}
|
||||
if value, ok := pu.mutation.SteamUpdated(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldSteamUpdated,
|
||||
})
|
||||
_spec.SetField(player.FieldSteamUpdated, field.TypeTime, value)
|
||||
}
|
||||
if value, ok := pu.mutation.SharecodeUpdated(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldSharecodeUpdated,
|
||||
})
|
||||
_spec.SetField(player.FieldSharecodeUpdated, field.TypeTime, value)
|
||||
}
|
||||
if pu.mutation.SharecodeUpdatedCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: player.FieldSharecodeUpdated,
|
||||
})
|
||||
_spec.ClearField(player.FieldSharecodeUpdated, field.TypeTime)
|
||||
}
|
||||
if value, ok := pu.mutation.AuthCode(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldAuthCode,
|
||||
})
|
||||
_spec.SetField(player.FieldAuthCode, field.TypeString, value)
|
||||
}
|
||||
if pu.mutation.AuthCodeCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldAuthCode,
|
||||
})
|
||||
_spec.ClearField(player.FieldAuthCode, field.TypeString)
|
||||
}
|
||||
if value, ok := pu.mutation.ProfileCreated(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldProfileCreated,
|
||||
})
|
||||
_spec.SetField(player.FieldProfileCreated, field.TypeTime, value)
|
||||
}
|
||||
if pu.mutation.ProfileCreatedCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: player.FieldProfileCreated,
|
||||
})
|
||||
_spec.ClearField(player.FieldProfileCreated, field.TypeTime)
|
||||
}
|
||||
if value, ok := pu.mutation.OldestSharecodeSeen(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldOldestSharecodeSeen,
|
||||
})
|
||||
_spec.SetField(player.FieldOldestSharecodeSeen, field.TypeString, value)
|
||||
}
|
||||
if pu.mutation.OldestSharecodeSeenCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldOldestSharecodeSeen,
|
||||
})
|
||||
_spec.ClearField(player.FieldOldestSharecodeSeen, field.TypeString)
|
||||
}
|
||||
if value, ok := pu.mutation.Wins(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
_spec.SetField(player.FieldWins, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := pu.mutation.AddedWins(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
_spec.AddField(player.FieldWins, field.TypeInt, value)
|
||||
}
|
||||
if pu.mutation.WinsCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
_spec.ClearField(player.FieldWins, field.TypeInt)
|
||||
}
|
||||
if value, ok := pu.mutation.Looses(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
_spec.SetField(player.FieldLooses, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := pu.mutation.AddedLooses(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
_spec.AddField(player.FieldLooses, field.TypeInt, value)
|
||||
}
|
||||
if pu.mutation.LoosesCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
_spec.ClearField(player.FieldLooses, field.TypeInt)
|
||||
}
|
||||
if value, ok := pu.mutation.Ties(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
_spec.SetField(player.FieldTies, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := pu.mutation.AddedTies(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
_spec.AddField(player.FieldTies, field.TypeInt, value)
|
||||
}
|
||||
if pu.mutation.TiesCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
_spec.ClearField(player.FieldTies, field.TypeInt)
|
||||
}
|
||||
if pu.mutation.StatsCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -880,7 +751,7 @@ func (pu *PlayerUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = pu.modifiers
|
||||
_spec.AddModifiers(pu.modifiers...)
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, pu.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{player.Label}
|
||||
@@ -1436,241 +1307,112 @@ func (puo *PlayerUpdateOne) sqlSave(ctx context.Context) (_node *Player, err err
|
||||
}
|
||||
}
|
||||
if value, ok := puo.mutation.Name(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldName,
|
||||
})
|
||||
_spec.SetField(player.FieldName, field.TypeString, value)
|
||||
}
|
||||
if puo.mutation.NameCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldName,
|
||||
})
|
||||
_spec.ClearField(player.FieldName, field.TypeString)
|
||||
}
|
||||
if value, ok := puo.mutation.Avatar(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldAvatar,
|
||||
})
|
||||
_spec.SetField(player.FieldAvatar, field.TypeString, value)
|
||||
}
|
||||
if puo.mutation.AvatarCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldAvatar,
|
||||
})
|
||||
_spec.ClearField(player.FieldAvatar, field.TypeString)
|
||||
}
|
||||
if value, ok := puo.mutation.VanityURL(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldVanityURL,
|
||||
})
|
||||
_spec.SetField(player.FieldVanityURL, field.TypeString, value)
|
||||
}
|
||||
if puo.mutation.VanityURLCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldVanityURL,
|
||||
})
|
||||
_spec.ClearField(player.FieldVanityURL, field.TypeString)
|
||||
}
|
||||
if value, ok := puo.mutation.VanityURLReal(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldVanityURLReal,
|
||||
})
|
||||
_spec.SetField(player.FieldVanityURLReal, field.TypeString, value)
|
||||
}
|
||||
if puo.mutation.VanityURLRealCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldVanityURLReal,
|
||||
})
|
||||
_spec.ClearField(player.FieldVanityURLReal, field.TypeString)
|
||||
}
|
||||
if value, ok := puo.mutation.VacDate(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldVacDate,
|
||||
})
|
||||
_spec.SetField(player.FieldVacDate, field.TypeTime, value)
|
||||
}
|
||||
if puo.mutation.VacDateCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: player.FieldVacDate,
|
||||
})
|
||||
_spec.ClearField(player.FieldVacDate, field.TypeTime)
|
||||
}
|
||||
if value, ok := puo.mutation.VacCount(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldVacCount,
|
||||
})
|
||||
_spec.SetField(player.FieldVacCount, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := puo.mutation.AddedVacCount(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldVacCount,
|
||||
})
|
||||
_spec.AddField(player.FieldVacCount, field.TypeInt, value)
|
||||
}
|
||||
if puo.mutation.VacCountCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldVacCount,
|
||||
})
|
||||
_spec.ClearField(player.FieldVacCount, field.TypeInt)
|
||||
}
|
||||
if value, ok := puo.mutation.GameBanDate(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldGameBanDate,
|
||||
})
|
||||
_spec.SetField(player.FieldGameBanDate, field.TypeTime, value)
|
||||
}
|
||||
if puo.mutation.GameBanDateCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: player.FieldGameBanDate,
|
||||
})
|
||||
_spec.ClearField(player.FieldGameBanDate, field.TypeTime)
|
||||
}
|
||||
if value, ok := puo.mutation.GameBanCount(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldGameBanCount,
|
||||
})
|
||||
_spec.SetField(player.FieldGameBanCount, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := puo.mutation.AddedGameBanCount(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldGameBanCount,
|
||||
})
|
||||
_spec.AddField(player.FieldGameBanCount, field.TypeInt, value)
|
||||
}
|
||||
if puo.mutation.GameBanCountCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldGameBanCount,
|
||||
})
|
||||
_spec.ClearField(player.FieldGameBanCount, field.TypeInt)
|
||||
}
|
||||
if value, ok := puo.mutation.SteamUpdated(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldSteamUpdated,
|
||||
})
|
||||
_spec.SetField(player.FieldSteamUpdated, field.TypeTime, value)
|
||||
}
|
||||
if value, ok := puo.mutation.SharecodeUpdated(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldSharecodeUpdated,
|
||||
})
|
||||
_spec.SetField(player.FieldSharecodeUpdated, field.TypeTime, value)
|
||||
}
|
||||
if puo.mutation.SharecodeUpdatedCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: player.FieldSharecodeUpdated,
|
||||
})
|
||||
_spec.ClearField(player.FieldSharecodeUpdated, field.TypeTime)
|
||||
}
|
||||
if value, ok := puo.mutation.AuthCode(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldAuthCode,
|
||||
})
|
||||
_spec.SetField(player.FieldAuthCode, field.TypeString, value)
|
||||
}
|
||||
if puo.mutation.AuthCodeCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldAuthCode,
|
||||
})
|
||||
_spec.ClearField(player.FieldAuthCode, field.TypeString)
|
||||
}
|
||||
if value, ok := puo.mutation.ProfileCreated(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Value: value,
|
||||
Column: player.FieldProfileCreated,
|
||||
})
|
||||
_spec.SetField(player.FieldProfileCreated, field.TypeTime, value)
|
||||
}
|
||||
if puo.mutation.ProfileCreatedCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeTime,
|
||||
Column: player.FieldProfileCreated,
|
||||
})
|
||||
_spec.ClearField(player.FieldProfileCreated, field.TypeTime)
|
||||
}
|
||||
if value, ok := puo.mutation.OldestSharecodeSeen(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Value: value,
|
||||
Column: player.FieldOldestSharecodeSeen,
|
||||
})
|
||||
_spec.SetField(player.FieldOldestSharecodeSeen, field.TypeString, value)
|
||||
}
|
||||
if puo.mutation.OldestSharecodeSeenCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeString,
|
||||
Column: player.FieldOldestSharecodeSeen,
|
||||
})
|
||||
_spec.ClearField(player.FieldOldestSharecodeSeen, field.TypeString)
|
||||
}
|
||||
if value, ok := puo.mutation.Wins(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
_spec.SetField(player.FieldWins, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := puo.mutation.AddedWins(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
_spec.AddField(player.FieldWins, field.TypeInt, value)
|
||||
}
|
||||
if puo.mutation.WinsCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldWins,
|
||||
})
|
||||
_spec.ClearField(player.FieldWins, field.TypeInt)
|
||||
}
|
||||
if value, ok := puo.mutation.Looses(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
_spec.SetField(player.FieldLooses, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := puo.mutation.AddedLooses(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
_spec.AddField(player.FieldLooses, field.TypeInt, value)
|
||||
}
|
||||
if puo.mutation.LoosesCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldLooses,
|
||||
})
|
||||
_spec.ClearField(player.FieldLooses, field.TypeInt)
|
||||
}
|
||||
if value, ok := puo.mutation.Ties(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
_spec.SetField(player.FieldTies, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := puo.mutation.AddedTies(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
_spec.AddField(player.FieldTies, field.TypeInt, value)
|
||||
}
|
||||
if puo.mutation.TiesCleared() {
|
||||
_spec.Fields.Clear = append(_spec.Fields.Clear, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Column: player.FieldTies,
|
||||
})
|
||||
_spec.ClearField(player.FieldTies, field.TypeInt)
|
||||
}
|
||||
if puo.mutation.StatsCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -1780,7 +1522,7 @@ func (puo *PlayerUpdateOne) sqlSave(ctx context.Context) (_node *Player, err err
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = puo.modifiers
|
||||
_spec.AddModifiers(puo.modifiers...)
|
||||
_node = &Player{config: puo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
|
@@ -53,8 +53,8 @@ func (e RoundStatsEdges) MatchPlayerOrErr() (*MatchPlayer, error) {
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*RoundStats) scanValues(columns []string) ([]interface{}, error) {
|
||||
values := make([]interface{}, len(columns))
|
||||
func (*RoundStats) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case roundstats.FieldID, roundstats.FieldRound, roundstats.FieldBank, roundstats.FieldEquipment, roundstats.FieldSpent:
|
||||
@@ -70,7 +70,7 @@ func (*RoundStats) scanValues(columns []string) ([]interface{}, error) {
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the RoundStats fields.
|
||||
func (rs *RoundStats) assignValues(columns []string, values []interface{}) error {
|
||||
func (rs *RoundStats) assignValues(columns []string, values []any) error {
|
||||
if m, n := len(values), len(columns); m < n {
|
||||
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ func IDNEQ(id int) predicate.RoundStats {
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.RoundStats {
|
||||
return predicate.RoundStats(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -43,7 +43,7 @@ func IDIn(ids ...int) predicate.RoundStats {
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.RoundStats {
|
||||
return predicate.RoundStats(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -123,7 +123,7 @@ func RoundNEQ(v uint) predicate.RoundStats {
|
||||
|
||||
// RoundIn applies the In predicate on the "round" field.
|
||||
func RoundIn(vs ...uint) predicate.RoundStats {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -134,7 +134,7 @@ func RoundIn(vs ...uint) predicate.RoundStats {
|
||||
|
||||
// RoundNotIn applies the NotIn predicate on the "round" field.
|
||||
func RoundNotIn(vs ...uint) predicate.RoundStats {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -187,7 +187,7 @@ func BankNEQ(v uint) predicate.RoundStats {
|
||||
|
||||
// BankIn applies the In predicate on the "bank" field.
|
||||
func BankIn(vs ...uint) predicate.RoundStats {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -198,7 +198,7 @@ func BankIn(vs ...uint) predicate.RoundStats {
|
||||
|
||||
// BankNotIn applies the NotIn predicate on the "bank" field.
|
||||
func BankNotIn(vs ...uint) predicate.RoundStats {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -251,7 +251,7 @@ func EquipmentNEQ(v uint) predicate.RoundStats {
|
||||
|
||||
// EquipmentIn applies the In predicate on the "equipment" field.
|
||||
func EquipmentIn(vs ...uint) predicate.RoundStats {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -262,7 +262,7 @@ func EquipmentIn(vs ...uint) predicate.RoundStats {
|
||||
|
||||
// EquipmentNotIn applies the NotIn predicate on the "equipment" field.
|
||||
func EquipmentNotIn(vs ...uint) predicate.RoundStats {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -315,7 +315,7 @@ func SpentNEQ(v uint) predicate.RoundStats {
|
||||
|
||||
// SpentIn applies the In predicate on the "spent" field.
|
||||
func SpentIn(vs ...uint) predicate.RoundStats {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -326,7 +326,7 @@ func SpentIn(vs ...uint) predicate.RoundStats {
|
||||
|
||||
// SpentNotIn applies the NotIn predicate on the "spent" field.
|
||||
func SpentNotIn(vs ...uint) predicate.RoundStats {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
|
@@ -179,35 +179,19 @@ func (rsc *RoundStatsCreate) createSpec() (*RoundStats, *sqlgraph.CreateSpec) {
|
||||
}
|
||||
)
|
||||
if value, ok := rsc.mutation.Round(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldRound,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldRound, field.TypeUint, value)
|
||||
_node.Round = value
|
||||
}
|
||||
if value, ok := rsc.mutation.Bank(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldBank,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldBank, field.TypeUint, value)
|
||||
_node.Bank = value
|
||||
}
|
||||
if value, ok := rsc.mutation.Equipment(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldEquipment,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldEquipment, field.TypeUint, value)
|
||||
_node.Equipment = value
|
||||
}
|
||||
if value, ok := rsc.mutation.Spent(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldSpent,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldSpent, field.TypeUint, value)
|
||||
_node.Spent = value
|
||||
}
|
||||
if nodes := rsc.mutation.MatchPlayerIDs(); len(nodes) > 0 {
|
||||
|
@@ -333,6 +333,11 @@ func (rsq *RoundStatsQuery) Select(fields ...string) *RoundStatsSelect {
|
||||
return selbuild
|
||||
}
|
||||
|
||||
// Aggregate returns a RoundStatsSelect configured with the given aggregations.
|
||||
func (rsq *RoundStatsQuery) Aggregate(fns ...AggregateFunc) *RoundStatsSelect {
|
||||
return rsq.Select().Aggregate(fns...)
|
||||
}
|
||||
|
||||
func (rsq *RoundStatsQuery) prepareQuery(ctx context.Context) error {
|
||||
for _, f := range rsq.fields {
|
||||
if !roundstats.ValidColumn(f) {
|
||||
@@ -364,10 +369,10 @@ func (rsq *RoundStatsQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*
|
||||
if withFKs {
|
||||
_spec.Node.Columns = append(_spec.Node.Columns, roundstats.ForeignKeys...)
|
||||
}
|
||||
_spec.ScanValues = func(columns []string) ([]interface{}, error) {
|
||||
_spec.ScanValues = func(columns []string) ([]any, error) {
|
||||
return (*RoundStats).scanValues(nil, columns)
|
||||
}
|
||||
_spec.Assign = func(columns []string, values []interface{}) error {
|
||||
_spec.Assign = func(columns []string, values []any) error {
|
||||
node := &RoundStats{config: rsq.config}
|
||||
nodes = append(nodes, node)
|
||||
node.Edges.loadedTypes = loadedTypes
|
||||
@@ -437,11 +442,14 @@ func (rsq *RoundStatsQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
}
|
||||
|
||||
func (rsq *RoundStatsQuery) sqlExist(ctx context.Context) (bool, error) {
|
||||
n, err := rsq.sqlCount(ctx)
|
||||
if err != nil {
|
||||
switch _, err := rsq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
case err != nil:
|
||||
return false, fmt.Errorf("ent: check existence: %w", err)
|
||||
default:
|
||||
return true, nil
|
||||
}
|
||||
return n > 0, nil
|
||||
}
|
||||
|
||||
func (rsq *RoundStatsQuery) querySpec() *sqlgraph.QuerySpec {
|
||||
@@ -551,7 +559,7 @@ func (rsgb *RoundStatsGroupBy) Aggregate(fns ...AggregateFunc) *RoundStatsGroupB
|
||||
}
|
||||
|
||||
// Scan applies the group-by query and scans the result into the given value.
|
||||
func (rsgb *RoundStatsGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
func (rsgb *RoundStatsGroupBy) Scan(ctx context.Context, v any) error {
|
||||
query, err := rsgb.path(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -560,7 +568,7 @@ func (rsgb *RoundStatsGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
return rsgb.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (rsgb *RoundStatsGroupBy) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (rsgb *RoundStatsGroupBy) sqlScan(ctx context.Context, v any) error {
|
||||
for _, f := range rsgb.fields {
|
||||
if !roundstats.ValidColumn(f) {
|
||||
return &ValidationError{Name: f, err: fmt.Errorf("invalid field %q for group-by", f)}
|
||||
@@ -585,8 +593,6 @@ func (rsgb *RoundStatsGroupBy) sqlQuery() *sql.Selector {
|
||||
for _, fn := range rsgb.fns {
|
||||
aggregation = append(aggregation, fn(selector))
|
||||
}
|
||||
// If no columns were selected in a custom aggregation function, the default
|
||||
// selection is the fields used for "group-by", and the aggregation functions.
|
||||
if len(selector.SelectedColumns()) == 0 {
|
||||
columns := make([]string, 0, len(rsgb.fields)+len(rsgb.fns))
|
||||
for _, f := range rsgb.fields {
|
||||
@@ -606,8 +612,14 @@ type RoundStatsSelect struct {
|
||||
sql *sql.Selector
|
||||
}
|
||||
|
||||
// Aggregate adds the given aggregation functions to the selector query.
|
||||
func (rss *RoundStatsSelect) Aggregate(fns ...AggregateFunc) *RoundStatsSelect {
|
||||
rss.fns = append(rss.fns, fns...)
|
||||
return rss
|
||||
}
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (rss *RoundStatsSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
func (rss *RoundStatsSelect) Scan(ctx context.Context, v any) error {
|
||||
if err := rss.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -615,7 +627,17 @@ func (rss *RoundStatsSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
return rss.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (rss *RoundStatsSelect) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (rss *RoundStatsSelect) sqlScan(ctx context.Context, v any) error {
|
||||
aggregation := make([]string, 0, len(rss.fns))
|
||||
for _, fn := range rss.fns {
|
||||
aggregation = append(aggregation, fn(rss.sql))
|
||||
}
|
||||
switch n := len(*rss.selector.flds); {
|
||||
case n == 0 && len(aggregation) > 0:
|
||||
rss.sql.Select(aggregation...)
|
||||
case n != 0 && len(aggregation) > 0:
|
||||
rss.sql.AppendSelect(aggregation...)
|
||||
}
|
||||
rows := &sql.Rows{}
|
||||
query, args := rss.sql.Query()
|
||||
if err := rss.driver.Query(ctx, query, args, rows); err != nil {
|
||||
|
@@ -190,60 +190,28 @@ func (rsu *RoundStatsUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
}
|
||||
if value, ok := rsu.mutation.Round(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldRound,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldRound, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsu.mutation.AddedRound(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldRound,
|
||||
})
|
||||
_spec.AddField(roundstats.FieldRound, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsu.mutation.Bank(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldBank,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldBank, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsu.mutation.AddedBank(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldBank,
|
||||
})
|
||||
_spec.AddField(roundstats.FieldBank, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsu.mutation.Equipment(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldEquipment,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldEquipment, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsu.mutation.AddedEquipment(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldEquipment,
|
||||
})
|
||||
_spec.AddField(roundstats.FieldEquipment, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsu.mutation.Spent(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldSpent,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldSpent, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsu.mutation.AddedSpent(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldSpent,
|
||||
})
|
||||
_spec.AddField(roundstats.FieldSpent, field.TypeUint, value)
|
||||
}
|
||||
if rsu.mutation.MatchPlayerCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -280,7 +248,7 @@ func (rsu *RoundStatsUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = rsu.modifiers
|
||||
_spec.AddModifiers(rsu.modifiers...)
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, rsu.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{roundstats.Label}
|
||||
@@ -492,60 +460,28 @@ func (rsuo *RoundStatsUpdateOne) sqlSave(ctx context.Context) (_node *RoundStats
|
||||
}
|
||||
}
|
||||
if value, ok := rsuo.mutation.Round(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldRound,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldRound, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsuo.mutation.AddedRound(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldRound,
|
||||
})
|
||||
_spec.AddField(roundstats.FieldRound, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsuo.mutation.Bank(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldBank,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldBank, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsuo.mutation.AddedBank(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldBank,
|
||||
})
|
||||
_spec.AddField(roundstats.FieldBank, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsuo.mutation.Equipment(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldEquipment,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldEquipment, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsuo.mutation.AddedEquipment(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldEquipment,
|
||||
})
|
||||
_spec.AddField(roundstats.FieldEquipment, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsuo.mutation.Spent(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldSpent,
|
||||
})
|
||||
_spec.SetField(roundstats.FieldSpent, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := rsuo.mutation.AddedSpent(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: roundstats.FieldSpent,
|
||||
})
|
||||
_spec.AddField(roundstats.FieldSpent, field.TypeUint, value)
|
||||
}
|
||||
if rsuo.mutation.MatchPlayerCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -582,7 +518,7 @@ func (rsuo *RoundStatsUpdateOne) sqlSave(ctx context.Context) (_node *RoundStats
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = rsuo.modifiers
|
||||
_spec.AddModifiers(rsuo.modifiers...)
|
||||
_node = &RoundStats{config: rsuo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
|
@@ -5,6 +5,6 @@ package runtime
|
||||
// The schema-stitching logic is generated in git.harting.dev/csgowtf/csgowtfd/ent/runtime.go
|
||||
|
||||
const (
|
||||
Version = "v0.11.2" // Version of ent codegen.
|
||||
Sum = "h1:UM2/BUhF2FfsxPHRxLjQbhqJNaDdVlOwNIAMLs2jyto=" // Sum of ent codegen.
|
||||
Version = "v0.11.4" // Version of ent codegen.
|
||||
Sum = "h1:grwVY0fp31BZ6oEo3YrXenAuv8VJmEw7F/Bi6WqeH3Q=" // Sum of ent codegen.
|
||||
)
|
||||
|
@@ -49,8 +49,8 @@ func (e SprayEdges) MatchPlayersOrErr() (*MatchPlayer, error) {
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Spray) scanValues(columns []string) ([]interface{}, error) {
|
||||
values := make([]interface{}, len(columns))
|
||||
func (*Spray) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case spray.FieldSpray:
|
||||
@@ -68,7 +68,7 @@ func (*Spray) scanValues(columns []string) ([]interface{}, error) {
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the Spray fields.
|
||||
func (s *Spray) assignValues(columns []string, values []interface{}) error {
|
||||
func (s *Spray) assignValues(columns []string, values []any) error {
|
||||
if m, n := len(values), len(columns); m < n {
|
||||
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ func IDNEQ(id int) predicate.Spray {
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -43,7 +43,7 @@ func IDIn(ids ...int) predicate.Spray {
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.Spray {
|
||||
return predicate.Spray(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -109,7 +109,7 @@ func WeaponNEQ(v int) predicate.Spray {
|
||||
|
||||
// WeaponIn applies the In predicate on the "weapon" field.
|
||||
func WeaponIn(vs ...int) predicate.Spray {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -120,7 +120,7 @@ func WeaponIn(vs ...int) predicate.Spray {
|
||||
|
||||
// WeaponNotIn applies the NotIn predicate on the "weapon" field.
|
||||
func WeaponNotIn(vs ...int) predicate.Spray {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -173,7 +173,7 @@ func SprayNEQ(v []byte) predicate.Spray {
|
||||
|
||||
// SprayIn applies the In predicate on the "spray" field.
|
||||
func SprayIn(vs ...[]byte) predicate.Spray {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -184,7 +184,7 @@ func SprayIn(vs ...[]byte) predicate.Spray {
|
||||
|
||||
// SprayNotIn applies the NotIn predicate on the "spray" field.
|
||||
func SprayNotIn(vs ...[]byte) predicate.Spray {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
|
@@ -161,19 +161,11 @@ func (sc *SprayCreate) createSpec() (*Spray, *sqlgraph.CreateSpec) {
|
||||
}
|
||||
)
|
||||
if value, ok := sc.mutation.Weapon(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: spray.FieldWeapon,
|
||||
})
|
||||
_spec.SetField(spray.FieldWeapon, field.TypeInt, value)
|
||||
_node.Weapon = value
|
||||
}
|
||||
if value, ok := sc.mutation.Spray(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBytes,
|
||||
Value: value,
|
||||
Column: spray.FieldSpray,
|
||||
})
|
||||
_spec.SetField(spray.FieldSpray, field.TypeBytes, value)
|
||||
_node.Spray = value
|
||||
}
|
||||
if nodes := sc.mutation.MatchPlayersIDs(); len(nodes) > 0 {
|
||||
|
@@ -333,6 +333,11 @@ func (sq *SprayQuery) Select(fields ...string) *SpraySelect {
|
||||
return selbuild
|
||||
}
|
||||
|
||||
// Aggregate returns a SpraySelect configured with the given aggregations.
|
||||
func (sq *SprayQuery) Aggregate(fns ...AggregateFunc) *SpraySelect {
|
||||
return sq.Select().Aggregate(fns...)
|
||||
}
|
||||
|
||||
func (sq *SprayQuery) prepareQuery(ctx context.Context) error {
|
||||
for _, f := range sq.fields {
|
||||
if !spray.ValidColumn(f) {
|
||||
@@ -364,10 +369,10 @@ func (sq *SprayQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Spray,
|
||||
if withFKs {
|
||||
_spec.Node.Columns = append(_spec.Node.Columns, spray.ForeignKeys...)
|
||||
}
|
||||
_spec.ScanValues = func(columns []string) ([]interface{}, error) {
|
||||
_spec.ScanValues = func(columns []string) ([]any, error) {
|
||||
return (*Spray).scanValues(nil, columns)
|
||||
}
|
||||
_spec.Assign = func(columns []string, values []interface{}) error {
|
||||
_spec.Assign = func(columns []string, values []any) error {
|
||||
node := &Spray{config: sq.config}
|
||||
nodes = append(nodes, node)
|
||||
node.Edges.loadedTypes = loadedTypes
|
||||
@@ -437,11 +442,14 @@ func (sq *SprayQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
}
|
||||
|
||||
func (sq *SprayQuery) sqlExist(ctx context.Context) (bool, error) {
|
||||
n, err := sq.sqlCount(ctx)
|
||||
if err != nil {
|
||||
switch _, err := sq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
case err != nil:
|
||||
return false, fmt.Errorf("ent: check existence: %w", err)
|
||||
default:
|
||||
return true, nil
|
||||
}
|
||||
return n > 0, nil
|
||||
}
|
||||
|
||||
func (sq *SprayQuery) querySpec() *sqlgraph.QuerySpec {
|
||||
@@ -551,7 +559,7 @@ func (sgb *SprayGroupBy) Aggregate(fns ...AggregateFunc) *SprayGroupBy {
|
||||
}
|
||||
|
||||
// Scan applies the group-by query and scans the result into the given value.
|
||||
func (sgb *SprayGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
func (sgb *SprayGroupBy) Scan(ctx context.Context, v any) error {
|
||||
query, err := sgb.path(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -560,7 +568,7 @@ func (sgb *SprayGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
return sgb.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (sgb *SprayGroupBy) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (sgb *SprayGroupBy) sqlScan(ctx context.Context, v any) error {
|
||||
for _, f := range sgb.fields {
|
||||
if !spray.ValidColumn(f) {
|
||||
return &ValidationError{Name: f, err: fmt.Errorf("invalid field %q for group-by", f)}
|
||||
@@ -585,8 +593,6 @@ func (sgb *SprayGroupBy) sqlQuery() *sql.Selector {
|
||||
for _, fn := range sgb.fns {
|
||||
aggregation = append(aggregation, fn(selector))
|
||||
}
|
||||
// If no columns were selected in a custom aggregation function, the default
|
||||
// selection is the fields used for "group-by", and the aggregation functions.
|
||||
if len(selector.SelectedColumns()) == 0 {
|
||||
columns := make([]string, 0, len(sgb.fields)+len(sgb.fns))
|
||||
for _, f := range sgb.fields {
|
||||
@@ -606,8 +612,14 @@ type SpraySelect struct {
|
||||
sql *sql.Selector
|
||||
}
|
||||
|
||||
// Aggregate adds the given aggregation functions to the selector query.
|
||||
func (ss *SpraySelect) Aggregate(fns ...AggregateFunc) *SpraySelect {
|
||||
ss.fns = append(ss.fns, fns...)
|
||||
return ss
|
||||
}
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (ss *SpraySelect) Scan(ctx context.Context, v interface{}) error {
|
||||
func (ss *SpraySelect) Scan(ctx context.Context, v any) error {
|
||||
if err := ss.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -615,7 +627,17 @@ func (ss *SpraySelect) Scan(ctx context.Context, v interface{}) error {
|
||||
return ss.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (ss *SpraySelect) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (ss *SpraySelect) sqlScan(ctx context.Context, v any) error {
|
||||
aggregation := make([]string, 0, len(ss.fns))
|
||||
for _, fn := range ss.fns {
|
||||
aggregation = append(aggregation, fn(ss.sql))
|
||||
}
|
||||
switch n := len(*ss.selector.flds); {
|
||||
case n == 0 && len(aggregation) > 0:
|
||||
ss.sql.Select(aggregation...)
|
||||
case n != 0 && len(aggregation) > 0:
|
||||
ss.sql.AppendSelect(aggregation...)
|
||||
}
|
||||
rows := &sql.Rows{}
|
||||
query, args := ss.sql.Query()
|
||||
if err := ss.driver.Query(ctx, query, args, rows); err != nil {
|
||||
|
@@ -157,25 +157,13 @@ func (su *SprayUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
}
|
||||
if value, ok := su.mutation.Weapon(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: spray.FieldWeapon,
|
||||
})
|
||||
_spec.SetField(spray.FieldWeapon, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := su.mutation.AddedWeapon(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: spray.FieldWeapon,
|
||||
})
|
||||
_spec.AddField(spray.FieldWeapon, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := su.mutation.Spray(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBytes,
|
||||
Value: value,
|
||||
Column: spray.FieldSpray,
|
||||
})
|
||||
_spec.SetField(spray.FieldSpray, field.TypeBytes, value)
|
||||
}
|
||||
if su.mutation.MatchPlayersCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -212,7 +200,7 @@ func (su *SprayUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = su.modifiers
|
||||
_spec.AddModifiers(su.modifiers...)
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, su.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{spray.Label}
|
||||
@@ -391,25 +379,13 @@ func (suo *SprayUpdateOne) sqlSave(ctx context.Context) (_node *Spray, err error
|
||||
}
|
||||
}
|
||||
if value, ok := suo.mutation.Weapon(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: spray.FieldWeapon,
|
||||
})
|
||||
_spec.SetField(spray.FieldWeapon, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := suo.mutation.AddedWeapon(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: spray.FieldWeapon,
|
||||
})
|
||||
_spec.AddField(spray.FieldWeapon, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := suo.mutation.Spray(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeBytes,
|
||||
Value: value,
|
||||
Column: spray.FieldSpray,
|
||||
})
|
||||
_spec.SetField(spray.FieldSpray, field.TypeBytes, value)
|
||||
}
|
||||
if suo.mutation.MatchPlayersCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -446,7 +422,7 @@ func (suo *SprayUpdateOne) sqlSave(ctx context.Context) (_node *Spray, err error
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = suo.modifiers
|
||||
_spec.AddModifiers(suo.modifiers...)
|
||||
_node = &Spray{config: suo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
|
40
ent/tx.go
40
ent/tx.go
@@ -30,12 +30,6 @@ type Tx struct {
|
||||
// lazily loaded.
|
||||
client *Client
|
||||
clientOnce sync.Once
|
||||
|
||||
// completion callbacks.
|
||||
mu sync.Mutex
|
||||
onCommit []CommitHook
|
||||
onRollback []RollbackHook
|
||||
|
||||
// ctx lives for the life of the transaction. It is
|
||||
// the same context used by the underlying connection.
|
||||
ctx context.Context
|
||||
@@ -80,9 +74,9 @@ func (tx *Tx) Commit() error {
|
||||
var fn Committer = CommitFunc(func(context.Context, *Tx) error {
|
||||
return txDriver.tx.Commit()
|
||||
})
|
||||
tx.mu.Lock()
|
||||
hooks := append([]CommitHook(nil), tx.onCommit...)
|
||||
tx.mu.Unlock()
|
||||
txDriver.mu.Lock()
|
||||
hooks := append([]CommitHook(nil), txDriver.onCommit...)
|
||||
txDriver.mu.Unlock()
|
||||
for i := len(hooks) - 1; i >= 0; i-- {
|
||||
fn = hooks[i](fn)
|
||||
}
|
||||
@@ -91,9 +85,10 @@ func (tx *Tx) Commit() error {
|
||||
|
||||
// OnCommit adds a hook to call on commit.
|
||||
func (tx *Tx) OnCommit(f CommitHook) {
|
||||
tx.mu.Lock()
|
||||
defer tx.mu.Unlock()
|
||||
tx.onCommit = append(tx.onCommit, f)
|
||||
txDriver := tx.config.driver.(*txDriver)
|
||||
txDriver.mu.Lock()
|
||||
txDriver.onCommit = append(txDriver.onCommit, f)
|
||||
txDriver.mu.Unlock()
|
||||
}
|
||||
|
||||
type (
|
||||
@@ -135,9 +130,9 @@ func (tx *Tx) Rollback() error {
|
||||
var fn Rollbacker = RollbackFunc(func(context.Context, *Tx) error {
|
||||
return txDriver.tx.Rollback()
|
||||
})
|
||||
tx.mu.Lock()
|
||||
hooks := append([]RollbackHook(nil), tx.onRollback...)
|
||||
tx.mu.Unlock()
|
||||
txDriver.mu.Lock()
|
||||
hooks := append([]RollbackHook(nil), txDriver.onRollback...)
|
||||
txDriver.mu.Unlock()
|
||||
for i := len(hooks) - 1; i >= 0; i-- {
|
||||
fn = hooks[i](fn)
|
||||
}
|
||||
@@ -146,9 +141,10 @@ func (tx *Tx) Rollback() error {
|
||||
|
||||
// OnRollback adds a hook to call on rollback.
|
||||
func (tx *Tx) OnRollback(f RollbackHook) {
|
||||
tx.mu.Lock()
|
||||
defer tx.mu.Unlock()
|
||||
tx.onRollback = append(tx.onRollback, f)
|
||||
txDriver := tx.config.driver.(*txDriver)
|
||||
txDriver.mu.Lock()
|
||||
txDriver.onRollback = append(txDriver.onRollback, f)
|
||||
txDriver.mu.Unlock()
|
||||
}
|
||||
|
||||
// Client returns a Client that binds to current transaction.
|
||||
@@ -186,6 +182,10 @@ type txDriver struct {
|
||||
drv dialect.Driver
|
||||
// tx is the underlying transaction.
|
||||
tx dialect.Tx
|
||||
// completion hooks.
|
||||
mu sync.Mutex
|
||||
onCommit []CommitHook
|
||||
onRollback []RollbackHook
|
||||
}
|
||||
|
||||
// newTx creates a new transactional driver.
|
||||
@@ -216,12 +216,12 @@ func (*txDriver) Commit() error { return nil }
|
||||
func (*txDriver) Rollback() error { return nil }
|
||||
|
||||
// Exec calls tx.Exec.
|
||||
func (tx *txDriver) Exec(ctx context.Context, query string, args, v interface{}) error {
|
||||
func (tx *txDriver) Exec(ctx context.Context, query string, args, v any) error {
|
||||
return tx.tx.Exec(ctx, query, args, v)
|
||||
}
|
||||
|
||||
// Query calls tx.Query.
|
||||
func (tx *txDriver) Query(ctx context.Context, query string, args, v interface{}) error {
|
||||
func (tx *txDriver) Query(ctx context.Context, query string, args, v any) error {
|
||||
return tx.tx.Query(ctx, query, args, v)
|
||||
}
|
||||
|
||||
|
@@ -53,8 +53,8 @@ func (e WeaponEdges) StatOrErr() (*MatchPlayer, error) {
|
||||
}
|
||||
|
||||
// scanValues returns the types for scanning values from sql.Rows.
|
||||
func (*Weapon) scanValues(columns []string) ([]interface{}, error) {
|
||||
values := make([]interface{}, len(columns))
|
||||
func (*Weapon) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case weapon.FieldID, weapon.FieldVictim, weapon.FieldDmg, weapon.FieldEqType, weapon.FieldHitGroup:
|
||||
@@ -70,7 +70,7 @@ func (*Weapon) scanValues(columns []string) ([]interface{}, error) {
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the Weapon fields.
|
||||
func (w *Weapon) assignValues(columns []string, values []interface{}) error {
|
||||
func (w *Weapon) assignValues(columns []string, values []any) error {
|
||||
if m, n := len(values), len(columns); m < n {
|
||||
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ func IDNEQ(id int) predicate.Weapon {
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -43,7 +43,7 @@ func IDIn(ids ...int) predicate.Weapon {
|
||||
// IDNotIn applies the NotIn predicate on the ID field.
|
||||
func IDNotIn(ids ...int) predicate.Weapon {
|
||||
return predicate.Weapon(func(s *sql.Selector) {
|
||||
v := make([]interface{}, len(ids))
|
||||
v := make([]any, len(ids))
|
||||
for i := range v {
|
||||
v[i] = ids[i]
|
||||
}
|
||||
@@ -123,7 +123,7 @@ func VictimNEQ(v uint64) predicate.Weapon {
|
||||
|
||||
// VictimIn applies the In predicate on the "victim" field.
|
||||
func VictimIn(vs ...uint64) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -134,7 +134,7 @@ func VictimIn(vs ...uint64) predicate.Weapon {
|
||||
|
||||
// VictimNotIn applies the NotIn predicate on the "victim" field.
|
||||
func VictimNotIn(vs ...uint64) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -187,7 +187,7 @@ func DmgNEQ(v uint) predicate.Weapon {
|
||||
|
||||
// DmgIn applies the In predicate on the "dmg" field.
|
||||
func DmgIn(vs ...uint) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -198,7 +198,7 @@ func DmgIn(vs ...uint) predicate.Weapon {
|
||||
|
||||
// DmgNotIn applies the NotIn predicate on the "dmg" field.
|
||||
func DmgNotIn(vs ...uint) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -251,7 +251,7 @@ func EqTypeNEQ(v int) predicate.Weapon {
|
||||
|
||||
// EqTypeIn applies the In predicate on the "eq_type" field.
|
||||
func EqTypeIn(vs ...int) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -262,7 +262,7 @@ func EqTypeIn(vs ...int) predicate.Weapon {
|
||||
|
||||
// EqTypeNotIn applies the NotIn predicate on the "eq_type" field.
|
||||
func EqTypeNotIn(vs ...int) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -315,7 +315,7 @@ func HitGroupNEQ(v int) predicate.Weapon {
|
||||
|
||||
// HitGroupIn applies the In predicate on the "hit_group" field.
|
||||
func HitGroupIn(vs ...int) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
@@ -326,7 +326,7 @@ func HitGroupIn(vs ...int) predicate.Weapon {
|
||||
|
||||
// HitGroupNotIn applies the NotIn predicate on the "hit_group" field.
|
||||
func HitGroupNotIn(vs ...int) predicate.Weapon {
|
||||
v := make([]interface{}, len(vs))
|
||||
v := make([]any, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
|
@@ -179,35 +179,19 @@ func (wc *WeaponCreate) createSpec() (*Weapon, *sqlgraph.CreateSpec) {
|
||||
}
|
||||
)
|
||||
if value, ok := wc.mutation.Victim(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Value: value,
|
||||
Column: weapon.FieldVictim,
|
||||
})
|
||||
_spec.SetField(weapon.FieldVictim, field.TypeUint64, value)
|
||||
_node.Victim = value
|
||||
}
|
||||
if value, ok := wc.mutation.Dmg(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: weapon.FieldDmg,
|
||||
})
|
||||
_spec.SetField(weapon.FieldDmg, field.TypeUint, value)
|
||||
_node.Dmg = value
|
||||
}
|
||||
if value, ok := wc.mutation.EqType(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: weapon.FieldEqType,
|
||||
})
|
||||
_spec.SetField(weapon.FieldEqType, field.TypeInt, value)
|
||||
_node.EqType = value
|
||||
}
|
||||
if value, ok := wc.mutation.HitGroup(); ok {
|
||||
_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: weapon.FieldHitGroup,
|
||||
})
|
||||
_spec.SetField(weapon.FieldHitGroup, field.TypeInt, value)
|
||||
_node.HitGroup = value
|
||||
}
|
||||
if nodes := wc.mutation.StatIDs(); len(nodes) > 0 {
|
||||
|
@@ -333,6 +333,11 @@ func (wq *WeaponQuery) Select(fields ...string) *WeaponSelect {
|
||||
return selbuild
|
||||
}
|
||||
|
||||
// Aggregate returns a WeaponSelect configured with the given aggregations.
|
||||
func (wq *WeaponQuery) Aggregate(fns ...AggregateFunc) *WeaponSelect {
|
||||
return wq.Select().Aggregate(fns...)
|
||||
}
|
||||
|
||||
func (wq *WeaponQuery) prepareQuery(ctx context.Context) error {
|
||||
for _, f := range wq.fields {
|
||||
if !weapon.ValidColumn(f) {
|
||||
@@ -364,10 +369,10 @@ func (wq *WeaponQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*Weapo
|
||||
if withFKs {
|
||||
_spec.Node.Columns = append(_spec.Node.Columns, weapon.ForeignKeys...)
|
||||
}
|
||||
_spec.ScanValues = func(columns []string) ([]interface{}, error) {
|
||||
_spec.ScanValues = func(columns []string) ([]any, error) {
|
||||
return (*Weapon).scanValues(nil, columns)
|
||||
}
|
||||
_spec.Assign = func(columns []string, values []interface{}) error {
|
||||
_spec.Assign = func(columns []string, values []any) error {
|
||||
node := &Weapon{config: wq.config}
|
||||
nodes = append(nodes, node)
|
||||
node.Edges.loadedTypes = loadedTypes
|
||||
@@ -437,11 +442,14 @@ func (wq *WeaponQuery) sqlCount(ctx context.Context) (int, error) {
|
||||
}
|
||||
|
||||
func (wq *WeaponQuery) sqlExist(ctx context.Context) (bool, error) {
|
||||
n, err := wq.sqlCount(ctx)
|
||||
if err != nil {
|
||||
switch _, err := wq.FirstID(ctx); {
|
||||
case IsNotFound(err):
|
||||
return false, nil
|
||||
case err != nil:
|
||||
return false, fmt.Errorf("ent: check existence: %w", err)
|
||||
default:
|
||||
return true, nil
|
||||
}
|
||||
return n > 0, nil
|
||||
}
|
||||
|
||||
func (wq *WeaponQuery) querySpec() *sqlgraph.QuerySpec {
|
||||
@@ -551,7 +559,7 @@ func (wgb *WeaponGroupBy) Aggregate(fns ...AggregateFunc) *WeaponGroupBy {
|
||||
}
|
||||
|
||||
// Scan applies the group-by query and scans the result into the given value.
|
||||
func (wgb *WeaponGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
func (wgb *WeaponGroupBy) Scan(ctx context.Context, v any) error {
|
||||
query, err := wgb.path(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -560,7 +568,7 @@ func (wgb *WeaponGroupBy) Scan(ctx context.Context, v interface{}) error {
|
||||
return wgb.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (wgb *WeaponGroupBy) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (wgb *WeaponGroupBy) sqlScan(ctx context.Context, v any) error {
|
||||
for _, f := range wgb.fields {
|
||||
if !weapon.ValidColumn(f) {
|
||||
return &ValidationError{Name: f, err: fmt.Errorf("invalid field %q for group-by", f)}
|
||||
@@ -585,8 +593,6 @@ func (wgb *WeaponGroupBy) sqlQuery() *sql.Selector {
|
||||
for _, fn := range wgb.fns {
|
||||
aggregation = append(aggregation, fn(selector))
|
||||
}
|
||||
// If no columns were selected in a custom aggregation function, the default
|
||||
// selection is the fields used for "group-by", and the aggregation functions.
|
||||
if len(selector.SelectedColumns()) == 0 {
|
||||
columns := make([]string, 0, len(wgb.fields)+len(wgb.fns))
|
||||
for _, f := range wgb.fields {
|
||||
@@ -606,8 +612,14 @@ type WeaponSelect struct {
|
||||
sql *sql.Selector
|
||||
}
|
||||
|
||||
// Aggregate adds the given aggregation functions to the selector query.
|
||||
func (ws *WeaponSelect) Aggregate(fns ...AggregateFunc) *WeaponSelect {
|
||||
ws.fns = append(ws.fns, fns...)
|
||||
return ws
|
||||
}
|
||||
|
||||
// Scan applies the selector query and scans the result into the given value.
|
||||
func (ws *WeaponSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
func (ws *WeaponSelect) Scan(ctx context.Context, v any) error {
|
||||
if err := ws.prepareQuery(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -615,7 +627,17 @@ func (ws *WeaponSelect) Scan(ctx context.Context, v interface{}) error {
|
||||
return ws.sqlScan(ctx, v)
|
||||
}
|
||||
|
||||
func (ws *WeaponSelect) sqlScan(ctx context.Context, v interface{}) error {
|
||||
func (ws *WeaponSelect) sqlScan(ctx context.Context, v any) error {
|
||||
aggregation := make([]string, 0, len(ws.fns))
|
||||
for _, fn := range ws.fns {
|
||||
aggregation = append(aggregation, fn(ws.sql))
|
||||
}
|
||||
switch n := len(*ws.selector.flds); {
|
||||
case n == 0 && len(aggregation) > 0:
|
||||
ws.sql.Select(aggregation...)
|
||||
case n != 0 && len(aggregation) > 0:
|
||||
ws.sql.AppendSelect(aggregation...)
|
||||
}
|
||||
rows := &sql.Rows{}
|
||||
query, args := ws.sql.Query()
|
||||
if err := ws.driver.Query(ctx, query, args, rows); err != nil {
|
||||
|
@@ -190,60 +190,28 @@ func (wu *WeaponUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
}
|
||||
if value, ok := wu.mutation.Victim(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Value: value,
|
||||
Column: weapon.FieldVictim,
|
||||
})
|
||||
_spec.SetField(weapon.FieldVictim, field.TypeUint64, value)
|
||||
}
|
||||
if value, ok := wu.mutation.AddedVictim(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Value: value,
|
||||
Column: weapon.FieldVictim,
|
||||
})
|
||||
_spec.AddField(weapon.FieldVictim, field.TypeUint64, value)
|
||||
}
|
||||
if value, ok := wu.mutation.Dmg(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: weapon.FieldDmg,
|
||||
})
|
||||
_spec.SetField(weapon.FieldDmg, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := wu.mutation.AddedDmg(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: weapon.FieldDmg,
|
||||
})
|
||||
_spec.AddField(weapon.FieldDmg, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := wu.mutation.EqType(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: weapon.FieldEqType,
|
||||
})
|
||||
_spec.SetField(weapon.FieldEqType, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := wu.mutation.AddedEqType(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: weapon.FieldEqType,
|
||||
})
|
||||
_spec.AddField(weapon.FieldEqType, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := wu.mutation.HitGroup(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: weapon.FieldHitGroup,
|
||||
})
|
||||
_spec.SetField(weapon.FieldHitGroup, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := wu.mutation.AddedHitGroup(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: weapon.FieldHitGroup,
|
||||
})
|
||||
_spec.AddField(weapon.FieldHitGroup, field.TypeInt, value)
|
||||
}
|
||||
if wu.mutation.StatCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -280,7 +248,7 @@ func (wu *WeaponUpdate) sqlSave(ctx context.Context) (n int, err error) {
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = wu.modifiers
|
||||
_spec.AddModifiers(wu.modifiers...)
|
||||
if n, err = sqlgraph.UpdateNodes(ctx, wu.driver, _spec); err != nil {
|
||||
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
||||
err = &NotFoundError{weapon.Label}
|
||||
@@ -492,60 +460,28 @@ func (wuo *WeaponUpdateOne) sqlSave(ctx context.Context) (_node *Weapon, err err
|
||||
}
|
||||
}
|
||||
if value, ok := wuo.mutation.Victim(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Value: value,
|
||||
Column: weapon.FieldVictim,
|
||||
})
|
||||
_spec.SetField(weapon.FieldVictim, field.TypeUint64, value)
|
||||
}
|
||||
if value, ok := wuo.mutation.AddedVictim(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint64,
|
||||
Value: value,
|
||||
Column: weapon.FieldVictim,
|
||||
})
|
||||
_spec.AddField(weapon.FieldVictim, field.TypeUint64, value)
|
||||
}
|
||||
if value, ok := wuo.mutation.Dmg(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: weapon.FieldDmg,
|
||||
})
|
||||
_spec.SetField(weapon.FieldDmg, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := wuo.mutation.AddedDmg(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeUint,
|
||||
Value: value,
|
||||
Column: weapon.FieldDmg,
|
||||
})
|
||||
_spec.AddField(weapon.FieldDmg, field.TypeUint, value)
|
||||
}
|
||||
if value, ok := wuo.mutation.EqType(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: weapon.FieldEqType,
|
||||
})
|
||||
_spec.SetField(weapon.FieldEqType, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := wuo.mutation.AddedEqType(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: weapon.FieldEqType,
|
||||
})
|
||||
_spec.AddField(weapon.FieldEqType, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := wuo.mutation.HitGroup(); ok {
|
||||
_spec.Fields.Set = append(_spec.Fields.Set, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: weapon.FieldHitGroup,
|
||||
})
|
||||
_spec.SetField(weapon.FieldHitGroup, field.TypeInt, value)
|
||||
}
|
||||
if value, ok := wuo.mutation.AddedHitGroup(); ok {
|
||||
_spec.Fields.Add = append(_spec.Fields.Add, &sqlgraph.FieldSpec{
|
||||
Type: field.TypeInt,
|
||||
Value: value,
|
||||
Column: weapon.FieldHitGroup,
|
||||
})
|
||||
_spec.AddField(weapon.FieldHitGroup, field.TypeInt, value)
|
||||
}
|
||||
if wuo.mutation.StatCleared() {
|
||||
edge := &sqlgraph.EdgeSpec{
|
||||
@@ -582,7 +518,7 @@ func (wuo *WeaponUpdateOne) sqlSave(ctx context.Context) (_node *Weapon, err err
|
||||
}
|
||||
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
||||
}
|
||||
_spec.Modifiers = wuo.modifiers
|
||||
_spec.AddModifiers(wuo.modifiers...)
|
||||
_node = &Weapon{config: wuo.config}
|
||||
_spec.Assign = _node.assignValues
|
||||
_spec.ScanValues = _node.scanValues
|
||||
|
Reference in New Issue
Block a user