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

@@ -2,6 +2,11 @@
package match
import (
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the match type in the database.
Label = "match"
@@ -98,3 +103,118 @@ var (
// DefaultGamebanPresent holds the default value on creation for the "gameban_present" field.
DefaultGamebanPresent bool
)
// OrderOption defines the ordering options for the Match queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByShareCode orders the results by the share_code field.
func ByShareCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldShareCode, opts...).ToFunc()
}
// ByMap orders the results by the map field.
func ByMap(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMap, opts...).ToFunc()
}
// ByDate orders the results by the date field.
func ByDate(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDate, opts...).ToFunc()
}
// ByScoreTeamA orders the results by the score_team_a field.
func ByScoreTeamA(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldScoreTeamA, opts...).ToFunc()
}
// ByScoreTeamB orders the results by the score_team_b field.
func ByScoreTeamB(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldScoreTeamB, opts...).ToFunc()
}
// ByReplayURL orders the results by the replay_url field.
func ByReplayURL(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldReplayURL, opts...).ToFunc()
}
// ByDuration orders the results by the duration field.
func ByDuration(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDuration, opts...).ToFunc()
}
// ByMatchResult orders the results by the match_result field.
func ByMatchResult(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMatchResult, opts...).ToFunc()
}
// ByMaxRounds orders the results by the max_rounds field.
func ByMaxRounds(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMaxRounds, opts...).ToFunc()
}
// ByDemoParsed orders the results by the demo_parsed field.
func ByDemoParsed(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDemoParsed, opts...).ToFunc()
}
// ByVacPresent orders the results by the vac_present field.
func ByVacPresent(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVacPresent, opts...).ToFunc()
}
// ByGamebanPresent orders the results by the gameban_present field.
func ByGamebanPresent(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldGamebanPresent, opts...).ToFunc()
}
// ByTickRate orders the results by the tick_rate field.
func ByTickRate(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTickRate, opts...).ToFunc()
}
// ByStatsCount orders the results by stats count.
func ByStatsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newStatsStep(), opts...)
}
}
// ByStats orders the results by stats terms.
func ByStats(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newStatsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByPlayersCount orders the results by players count.
func ByPlayersCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newPlayersStep(), opts...)
}
}
// ByPlayers orders the results by players terms.
func ByPlayers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newPlayersStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newStatsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(StatsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, StatsTable, StatsColumn),
)
}
func newPlayersStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(PlayersInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, true, PlayersTable, PlayersPrimaryKey...),
)
}

View File

@@ -724,11 +724,7 @@ func HasStats() predicate.Match {
// HasStatsWith applies the HasEdge predicate on the "stats" edge with a given conditions (other predicates).
func HasStatsWith(preds ...predicate.MatchPlayer) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(StatsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, StatsTable, StatsColumn),
)
step := newStatsStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
@@ -751,11 +747,7 @@ func HasPlayers() predicate.Match {
// HasPlayersWith applies the HasEdge predicate on the "players" edge with a given conditions (other predicates).
func HasPlayersWith(preds ...predicate.Player) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(PlayersInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, true, PlayersTable, PlayersPrimaryKey...),
)
step := newPlayersStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)