regenerate ent
This commit is contained in:
@@ -44,12 +44,10 @@ type RoundStatsEdges struct {
|
||||
// MatchPlayerOrErr returns the MatchPlayer value or an error if the edge
|
||||
// was not loaded in eager-loading, or loaded but was not found.
|
||||
func (e RoundStatsEdges) MatchPlayerOrErr() (*MatchPlayer, error) {
|
||||
if e.loadedTypes[0] {
|
||||
if e.MatchPlayer == nil {
|
||||
// Edge was loaded but was not found.
|
||||
return nil, &NotFoundError{label: matchplayer.Label}
|
||||
}
|
||||
if e.MatchPlayer != nil {
|
||||
return e.MatchPlayer, nil
|
||||
} else if e.loadedTypes[0] {
|
||||
return nil, &NotFoundError{label: matchplayer.Label}
|
||||
}
|
||||
return nil, &NotLoadedError{edge: "match_player"}
|
||||
}
|
||||
@@ -72,7 +70,7 @@ func (*RoundStats) scanValues(columns []string) ([]any, error) {
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the RoundStats fields.
|
||||
func (rs *RoundStats) assignValues(columns []string, values []any) error {
|
||||
func (_m *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)
|
||||
}
|
||||
@@ -83,40 +81,40 @@ func (rs *RoundStats) assignValues(columns []string, values []any) error {
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field id", value)
|
||||
}
|
||||
rs.ID = int(value.Int64)
|
||||
_m.ID = int(value.Int64)
|
||||
case roundstats.FieldRound:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field round", values[i])
|
||||
} else if value.Valid {
|
||||
rs.Round = uint(value.Int64)
|
||||
_m.Round = uint(value.Int64)
|
||||
}
|
||||
case roundstats.FieldBank:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field bank", values[i])
|
||||
} else if value.Valid {
|
||||
rs.Bank = uint(value.Int64)
|
||||
_m.Bank = uint(value.Int64)
|
||||
}
|
||||
case roundstats.FieldEquipment:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field equipment", values[i])
|
||||
} else if value.Valid {
|
||||
rs.Equipment = uint(value.Int64)
|
||||
_m.Equipment = uint(value.Int64)
|
||||
}
|
||||
case roundstats.FieldSpent:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field spent", values[i])
|
||||
} else if value.Valid {
|
||||
rs.Spent = uint(value.Int64)
|
||||
_m.Spent = uint(value.Int64)
|
||||
}
|
||||
case roundstats.ForeignKeys[0]:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for edge-field match_player_round_stats", value)
|
||||
} else if value.Valid {
|
||||
rs.match_player_round_stats = new(int)
|
||||
*rs.match_player_round_stats = int(value.Int64)
|
||||
_m.match_player_round_stats = new(int)
|
||||
*_m.match_player_round_stats = int(value.Int64)
|
||||
}
|
||||
default:
|
||||
rs.selectValues.Set(columns[i], values[i])
|
||||
_m.selectValues.Set(columns[i], values[i])
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@@ -124,49 +122,49 @@ func (rs *RoundStats) assignValues(columns []string, values []any) error {
|
||||
|
||||
// Value returns the ent.Value that was dynamically selected and assigned to the RoundStats.
|
||||
// This includes values selected through modifiers, order, etc.
|
||||
func (rs *RoundStats) Value(name string) (ent.Value, error) {
|
||||
return rs.selectValues.Get(name)
|
||||
func (_m *RoundStats) Value(name string) (ent.Value, error) {
|
||||
return _m.selectValues.Get(name)
|
||||
}
|
||||
|
||||
// QueryMatchPlayer queries the "match_player" edge of the RoundStats entity.
|
||||
func (rs *RoundStats) QueryMatchPlayer() *MatchPlayerQuery {
|
||||
return NewRoundStatsClient(rs.config).QueryMatchPlayer(rs)
|
||||
func (_m *RoundStats) QueryMatchPlayer() *MatchPlayerQuery {
|
||||
return NewRoundStatsClient(_m.config).QueryMatchPlayer(_m)
|
||||
}
|
||||
|
||||
// Update returns a builder for updating this RoundStats.
|
||||
// Note that you need to call RoundStats.Unwrap() before calling this method if this RoundStats
|
||||
// was returned from a transaction, and the transaction was committed or rolled back.
|
||||
func (rs *RoundStats) Update() *RoundStatsUpdateOne {
|
||||
return NewRoundStatsClient(rs.config).UpdateOne(rs)
|
||||
func (_m *RoundStats) Update() *RoundStatsUpdateOne {
|
||||
return NewRoundStatsClient(_m.config).UpdateOne(_m)
|
||||
}
|
||||
|
||||
// Unwrap unwraps the RoundStats entity that was returned from a transaction after it was closed,
|
||||
// so that all future queries will be executed through the driver which created the transaction.
|
||||
func (rs *RoundStats) Unwrap() *RoundStats {
|
||||
_tx, ok := rs.config.driver.(*txDriver)
|
||||
func (_m *RoundStats) Unwrap() *RoundStats {
|
||||
_tx, ok := _m.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: RoundStats is not a transactional entity")
|
||||
}
|
||||
rs.config.driver = _tx.drv
|
||||
return rs
|
||||
_m.config.driver = _tx.drv
|
||||
return _m
|
||||
}
|
||||
|
||||
// String implements the fmt.Stringer.
|
||||
func (rs *RoundStats) String() string {
|
||||
func (_m *RoundStats) String() string {
|
||||
var builder strings.Builder
|
||||
builder.WriteString("RoundStats(")
|
||||
builder.WriteString(fmt.Sprintf("id=%v, ", rs.ID))
|
||||
builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
|
||||
builder.WriteString("round=")
|
||||
builder.WriteString(fmt.Sprintf("%v", rs.Round))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.Round))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("bank=")
|
||||
builder.WriteString(fmt.Sprintf("%v", rs.Bank))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.Bank))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("equipment=")
|
||||
builder.WriteString(fmt.Sprintf("%v", rs.Equipment))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.Equipment))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("spent=")
|
||||
builder.WriteString(fmt.Sprintf("%v", rs.Spent))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.Spent))
|
||||
builder.WriteByte(')')
|
||||
return builder.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user