updated deps & regen ent

This commit is contained in:
2023-05-16 18:09:10 +02:00
parent e9e3e02a39
commit 3fd0a4204b
53 changed files with 1062 additions and 593 deletions

View File

@@ -7,6 +7,7 @@ import (
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"somegit.dev/csgowtf/csgowtfd/ent/player"
)
@@ -50,7 +51,8 @@ type Player struct {
Ties int `json:"ties,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the PlayerQuery when eager-loading is set.
Edges PlayerEdges `json:"edges"`
Edges PlayerEdges `json:"edges"`
selectValues sql.SelectValues
}
// PlayerEdges holds the relations/edges for other nodes in the graph.
@@ -94,7 +96,7 @@ func (*Player) scanValues(columns []string) ([]any, error) {
case player.FieldVacDate, player.FieldGameBanDate, player.FieldSteamUpdated, player.FieldSharecodeUpdated, player.FieldProfileCreated:
values[i] = new(sql.NullTime)
default:
return nil, fmt.Errorf("unexpected column %q for type Player", columns[i])
values[i] = new(sql.UnknownType)
}
}
return values, nil
@@ -210,11 +212,19 @@ func (pl *Player) assignValues(columns []string, values []any) error {
} else if value.Valid {
pl.Ties = int(value.Int64)
}
default:
pl.selectValues.Set(columns[i], values[i])
}
}
return nil
}
// Value returns the ent.Value that was dynamically selected and assigned to the Player.
// This includes values selected through modifiers, order, etc.
func (pl *Player) Value(name string) (ent.Value, error) {
return pl.selectValues.Get(name)
}
// QueryStats queries the "stats" edge of the Player entity.
func (pl *Player) QueryStats() *MatchPlayerQuery {
return NewPlayerClient(pl.config).QueryStats(pl)