regenerate ent
This commit is contained in:
90
ent/match.go
90
ent/match.go
@@ -106,7 +106,7 @@ func (*Match) scanValues(columns []string) ([]any, error) {
|
||||
|
||||
// assignValues assigns the values that were returned from sql.Rows (after scanning)
|
||||
// to the Match fields.
|
||||
func (m *Match) assignValues(columns []string, values []any) 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)
|
||||
}
|
||||
@@ -117,93 +117,93 @@ func (m *Match) assignValues(columns []string, values []any) error {
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field id", value)
|
||||
}
|
||||
m.ID = uint64(value.Int64)
|
||||
_m.ID = uint64(value.Int64)
|
||||
case match.FieldShareCode:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field share_code", values[i])
|
||||
} else if value.Valid {
|
||||
m.ShareCode = value.String
|
||||
_m.ShareCode = value.String
|
||||
}
|
||||
case match.FieldMap:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field map", values[i])
|
||||
} else if value.Valid {
|
||||
m.Map = value.String
|
||||
_m.Map = value.String
|
||||
}
|
||||
case match.FieldDate:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field date", values[i])
|
||||
} else if value.Valid {
|
||||
m.Date = value.Time
|
||||
_m.Date = value.Time
|
||||
}
|
||||
case match.FieldScoreTeamA:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field score_team_a", values[i])
|
||||
} else if value.Valid {
|
||||
m.ScoreTeamA = int(value.Int64)
|
||||
_m.ScoreTeamA = int(value.Int64)
|
||||
}
|
||||
case match.FieldScoreTeamB:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field score_team_b", values[i])
|
||||
} else if value.Valid {
|
||||
m.ScoreTeamB = int(value.Int64)
|
||||
_m.ScoreTeamB = int(value.Int64)
|
||||
}
|
||||
case match.FieldReplayURL:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field replay_url", values[i])
|
||||
} else if value.Valid {
|
||||
m.ReplayURL = value.String
|
||||
_m.ReplayURL = value.String
|
||||
}
|
||||
case match.FieldDuration:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field duration", values[i])
|
||||
} else if value.Valid {
|
||||
m.Duration = int(value.Int64)
|
||||
_m.Duration = int(value.Int64)
|
||||
}
|
||||
case match.FieldMatchResult:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field match_result", values[i])
|
||||
} else if value.Valid {
|
||||
m.MatchResult = int(value.Int64)
|
||||
_m.MatchResult = int(value.Int64)
|
||||
}
|
||||
case match.FieldMaxRounds:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field max_rounds", values[i])
|
||||
} else if value.Valid {
|
||||
m.MaxRounds = int(value.Int64)
|
||||
_m.MaxRounds = int(value.Int64)
|
||||
}
|
||||
case match.FieldDemoParsed:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field demo_parsed", values[i])
|
||||
} else if value.Valid {
|
||||
m.DemoParsed = value.Bool
|
||||
_m.DemoParsed = value.Bool
|
||||
}
|
||||
case match.FieldVacPresent:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field vac_present", values[i])
|
||||
} else if value.Valid {
|
||||
m.VacPresent = value.Bool
|
||||
_m.VacPresent = value.Bool
|
||||
}
|
||||
case match.FieldGamebanPresent:
|
||||
if value, ok := values[i].(*sql.NullBool); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field gameban_present", values[i])
|
||||
} else if value.Valid {
|
||||
m.GamebanPresent = value.Bool
|
||||
_m.GamebanPresent = value.Bool
|
||||
}
|
||||
case match.FieldDecryptionKey:
|
||||
if value, ok := values[i].(*[]byte); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field decryption_key", values[i])
|
||||
} else if value != nil {
|
||||
m.DecryptionKey = *value
|
||||
_m.DecryptionKey = *value
|
||||
}
|
||||
case match.FieldTickRate:
|
||||
if value, ok := values[i].(*sql.NullFloat64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field tick_rate", values[i])
|
||||
} else if value.Valid {
|
||||
m.TickRate = value.Float64
|
||||
_m.TickRate = value.Float64
|
||||
}
|
||||
default:
|
||||
m.selectValues.Set(columns[i], values[i])
|
||||
_m.selectValues.Set(columns[i], values[i])
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@@ -211,84 +211,84 @@ func (m *Match) assignValues(columns []string, values []any) error {
|
||||
|
||||
// Value returns the ent.Value that was dynamically selected and assigned to the Match.
|
||||
// This includes values selected through modifiers, order, etc.
|
||||
func (m *Match) Value(name string) (ent.Value, error) {
|
||||
return m.selectValues.Get(name)
|
||||
func (_m *Match) Value(name string) (ent.Value, error) {
|
||||
return _m.selectValues.Get(name)
|
||||
}
|
||||
|
||||
// QueryStats queries the "stats" edge of the Match entity.
|
||||
func (m *Match) QueryStats() *MatchPlayerQuery {
|
||||
return NewMatchClient(m.config).QueryStats(m)
|
||||
func (_m *Match) QueryStats() *MatchPlayerQuery {
|
||||
return NewMatchClient(_m.config).QueryStats(_m)
|
||||
}
|
||||
|
||||
// QueryPlayers queries the "players" edge of the Match entity.
|
||||
func (m *Match) QueryPlayers() *PlayerQuery {
|
||||
return NewMatchClient(m.config).QueryPlayers(m)
|
||||
func (_m *Match) QueryPlayers() *PlayerQuery {
|
||||
return NewMatchClient(_m.config).QueryPlayers(_m)
|
||||
}
|
||||
|
||||
// Update returns a builder for updating this Match.
|
||||
// Note that you need to call Match.Unwrap() before calling this method if this Match
|
||||
// was returned from a transaction, and the transaction was committed or rolled back.
|
||||
func (m *Match) Update() *MatchUpdateOne {
|
||||
return NewMatchClient(m.config).UpdateOne(m)
|
||||
func (_m *Match) Update() *MatchUpdateOne {
|
||||
return NewMatchClient(_m.config).UpdateOne(_m)
|
||||
}
|
||||
|
||||
// Unwrap unwraps the Match 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 (m *Match) Unwrap() *Match {
|
||||
_tx, ok := m.config.driver.(*txDriver)
|
||||
func (_m *Match) Unwrap() *Match {
|
||||
_tx, ok := _m.config.driver.(*txDriver)
|
||||
if !ok {
|
||||
panic("ent: Match is not a transactional entity")
|
||||
}
|
||||
m.config.driver = _tx.drv
|
||||
return m
|
||||
_m.config.driver = _tx.drv
|
||||
return _m
|
||||
}
|
||||
|
||||
// String implements the fmt.Stringer.
|
||||
func (m *Match) String() string {
|
||||
func (_m *Match) String() string {
|
||||
var builder strings.Builder
|
||||
builder.WriteString("Match(")
|
||||
builder.WriteString(fmt.Sprintf("id=%v, ", m.ID))
|
||||
builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
|
||||
builder.WriteString("share_code=")
|
||||
builder.WriteString(m.ShareCode)
|
||||
builder.WriteString(_m.ShareCode)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("map=")
|
||||
builder.WriteString(m.Map)
|
||||
builder.WriteString(_m.Map)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("date=")
|
||||
builder.WriteString(m.Date.Format(time.ANSIC))
|
||||
builder.WriteString(_m.Date.Format(time.ANSIC))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("score_team_a=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.ScoreTeamA))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.ScoreTeamA))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("score_team_b=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.ScoreTeamB))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.ScoreTeamB))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("replay_url=")
|
||||
builder.WriteString(m.ReplayURL)
|
||||
builder.WriteString(_m.ReplayURL)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("duration=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.Duration))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.Duration))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("match_result=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.MatchResult))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.MatchResult))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("max_rounds=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.MaxRounds))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.MaxRounds))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("demo_parsed=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.DemoParsed))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.DemoParsed))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("vac_present=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.VacPresent))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.VacPresent))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("gameban_present=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.GamebanPresent))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.GamebanPresent))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("decryption_key=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.DecryptionKey))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.DecryptionKey))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("tick_rate=")
|
||||
builder.WriteString(fmt.Sprintf("%v", m.TickRate))
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.TickRate))
|
||||
builder.WriteByte(')')
|
||||
return builder.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user