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

@@ -6,6 +6,7 @@ import (
"fmt"
"strings"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"somegit.dev/csgowtf/csgowtfd/ent/match"
"somegit.dev/csgowtf/csgowtfd/ent/matchplayer"
@@ -85,7 +86,8 @@ type MatchPlayer struct {
AvgPing float64 `json:"avg_ping,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the MatchPlayerQuery when eager-loading is set.
Edges MatchPlayerEdges `json:"edges"`
Edges MatchPlayerEdges `json:"edges"`
selectValues sql.SelectValues
}
// MatchPlayerEdges holds the relations/edges for other nodes in the graph.
@@ -181,7 +183,7 @@ func (*MatchPlayer) scanValues(columns []string) ([]any, error) {
case matchplayer.FieldCrosshair, matchplayer.FieldColor:
values[i] = new(sql.NullString)
default:
return nil, fmt.Errorf("unexpected column %q for type MatchPlayer", columns[i])
values[i] = new(sql.UnknownType)
}
}
return values, nil
@@ -399,11 +401,19 @@ func (mp *MatchPlayer) assignValues(columns []string, values []any) error {
} else if value.Valid {
mp.AvgPing = value.Float64
}
default:
mp.selectValues.Set(columns[i], values[i])
}
}
return nil
}
// Value returns the ent.Value that was dynamically selected and assigned to the MatchPlayer.
// This includes values selected through modifiers, order, etc.
func (mp *MatchPlayer) Value(name string) (ent.Value, error) {
return mp.selectValues.Get(name)
}
// QueryMatches queries the "matches" edge of the MatchPlayer entity.
func (mp *MatchPlayer) QueryMatches() *MatchQuery {
return NewMatchPlayerClient(mp.config).QueryMatches(mp)