Files
csgowtfd/ent/matchplayer/matchplayer.go

500 lines
18 KiB
Go

// Code generated by ent, DO NOT EDIT.
package matchplayer
import (
"fmt"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the matchplayer type in the database.
Label = "match_player"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldTeamID holds the string denoting the team_id field in the database.
FieldTeamID = "team_id"
// FieldKills holds the string denoting the kills field in the database.
FieldKills = "kills"
// FieldDeaths holds the string denoting the deaths field in the database.
FieldDeaths = "deaths"
// FieldAssists holds the string denoting the assists field in the database.
FieldAssists = "assists"
// FieldHeadshot holds the string denoting the headshot field in the database.
FieldHeadshot = "headshot"
// FieldMvp holds the string denoting the mvp field in the database.
FieldMvp = "mvp"
// FieldScore holds the string denoting the score field in the database.
FieldScore = "score"
// FieldRankNew holds the string denoting the rank_new field in the database.
FieldRankNew = "rank_new"
// FieldRankOld holds the string denoting the rank_old field in the database.
FieldRankOld = "rank_old"
// FieldMk2 holds the string denoting the mk_2 field in the database.
FieldMk2 = "mk_2"
// FieldMk3 holds the string denoting the mk_3 field in the database.
FieldMk3 = "mk_3"
// FieldMk4 holds the string denoting the mk_4 field in the database.
FieldMk4 = "mk_4"
// FieldMk5 holds the string denoting the mk_5 field in the database.
FieldMk5 = "mk_5"
// FieldDmgEnemy holds the string denoting the dmg_enemy field in the database.
FieldDmgEnemy = "dmg_enemy"
// FieldDmgTeam holds the string denoting the dmg_team field in the database.
FieldDmgTeam = "dmg_team"
// FieldUdHe holds the string denoting the ud_he field in the database.
FieldUdHe = "ud_he"
// FieldUdFlames holds the string denoting the ud_flames field in the database.
FieldUdFlames = "ud_flames"
// FieldUdFlash holds the string denoting the ud_flash field in the database.
FieldUdFlash = "ud_flash"
// FieldUdDecoy holds the string denoting the ud_decoy field in the database.
FieldUdDecoy = "ud_decoy"
// FieldUdSmoke holds the string denoting the ud_smoke field in the database.
FieldUdSmoke = "ud_smoke"
// FieldCrosshair holds the string denoting the crosshair field in the database.
FieldCrosshair = "crosshair"
// FieldColor holds the string denoting the color field in the database.
FieldColor = "color"
// FieldKast holds the string denoting the kast field in the database.
FieldKast = "kast"
// FieldFlashDurationSelf holds the string denoting the flash_duration_self field in the database.
FieldFlashDurationSelf = "flash_duration_self"
// FieldFlashDurationTeam holds the string denoting the flash_duration_team field in the database.
FieldFlashDurationTeam = "flash_duration_team"
// FieldFlashDurationEnemy holds the string denoting the flash_duration_enemy field in the database.
FieldFlashDurationEnemy = "flash_duration_enemy"
// FieldFlashTotalSelf holds the string denoting the flash_total_self field in the database.
FieldFlashTotalSelf = "flash_total_self"
// FieldFlashTotalTeam holds the string denoting the flash_total_team field in the database.
FieldFlashTotalTeam = "flash_total_team"
// FieldFlashTotalEnemy holds the string denoting the flash_total_enemy field in the database.
FieldFlashTotalEnemy = "flash_total_enemy"
// FieldMatchStats holds the string denoting the match_stats field in the database.
FieldMatchStats = "match_stats"
// FieldPlayerStats holds the string denoting the player_stats field in the database.
FieldPlayerStats = "player_stats"
// FieldFlashAssists holds the string denoting the flash_assists field in the database.
FieldFlashAssists = "flash_assists"
// FieldAvgPing holds the string denoting the avg_ping field in the database.
FieldAvgPing = "avg_ping"
// EdgeMatches holds the string denoting the matches edge name in mutations.
EdgeMatches = "matches"
// EdgePlayers holds the string denoting the players edge name in mutations.
EdgePlayers = "players"
// EdgeWeaponStats holds the string denoting the weapon_stats edge name in mutations.
EdgeWeaponStats = "weapon_stats"
// EdgeRoundStats holds the string denoting the round_stats edge name in mutations.
EdgeRoundStats = "round_stats"
// EdgeSpray holds the string denoting the spray edge name in mutations.
EdgeSpray = "spray"
// EdgeMessages holds the string denoting the messages edge name in mutations.
EdgeMessages = "messages"
// Table holds the table name of the matchplayer in the database.
Table = "match_players"
// MatchesTable is the table that holds the matches relation/edge.
MatchesTable = "match_players"
// MatchesInverseTable is the table name for the Match entity.
// It exists in this package in order to avoid circular dependency with the "match" package.
MatchesInverseTable = "matches"
// MatchesColumn is the table column denoting the matches relation/edge.
MatchesColumn = "match_stats"
// PlayersTable is the table that holds the players relation/edge.
PlayersTable = "match_players"
// PlayersInverseTable is the table name for the Player entity.
// It exists in this package in order to avoid circular dependency with the "player" package.
PlayersInverseTable = "players"
// PlayersColumn is the table column denoting the players relation/edge.
PlayersColumn = "player_stats"
// WeaponStatsTable is the table that holds the weapon_stats relation/edge.
WeaponStatsTable = "weapons"
// WeaponStatsInverseTable is the table name for the Weapon entity.
// It exists in this package in order to avoid circular dependency with the "weapon" package.
WeaponStatsInverseTable = "weapons"
// WeaponStatsColumn is the table column denoting the weapon_stats relation/edge.
WeaponStatsColumn = "match_player_weapon_stats"
// RoundStatsTable is the table that holds the round_stats relation/edge.
RoundStatsTable = "round_stats"
// RoundStatsInverseTable is the table name for the RoundStats entity.
// It exists in this package in order to avoid circular dependency with the "roundstats" package.
RoundStatsInverseTable = "round_stats"
// RoundStatsColumn is the table column denoting the round_stats relation/edge.
RoundStatsColumn = "match_player_round_stats"
// SprayTable is the table that holds the spray relation/edge.
SprayTable = "sprays"
// SprayInverseTable is the table name for the Spray entity.
// It exists in this package in order to avoid circular dependency with the "spray" package.
SprayInverseTable = "sprays"
// SprayColumn is the table column denoting the spray relation/edge.
SprayColumn = "match_player_spray"
// MessagesTable is the table that holds the messages relation/edge.
MessagesTable = "messages"
// MessagesInverseTable is the table name for the Messages entity.
// It exists in this package in order to avoid circular dependency with the "messages" package.
MessagesInverseTable = "messages"
// MessagesColumn is the table column denoting the messages relation/edge.
MessagesColumn = "match_player_messages"
)
// Columns holds all SQL columns for matchplayer fields.
var Columns = []string{
FieldID,
FieldTeamID,
FieldKills,
FieldDeaths,
FieldAssists,
FieldHeadshot,
FieldMvp,
FieldScore,
FieldRankNew,
FieldRankOld,
FieldMk2,
FieldMk3,
FieldMk4,
FieldMk5,
FieldDmgEnemy,
FieldDmgTeam,
FieldUdHe,
FieldUdFlames,
FieldUdFlash,
FieldUdDecoy,
FieldUdSmoke,
FieldCrosshair,
FieldColor,
FieldKast,
FieldFlashDurationSelf,
FieldFlashDurationTeam,
FieldFlashDurationEnemy,
FieldFlashTotalSelf,
FieldFlashTotalTeam,
FieldFlashTotalEnemy,
FieldMatchStats,
FieldPlayerStats,
FieldFlashAssists,
FieldAvgPing,
}
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
return false
}
// Color defines the type for the "color" enum field.
type Color string
// Color values.
const (
ColorGreen Color = "green"
ColorYellow Color = "yellow"
ColorPurple Color = "purple"
ColorBlue Color = "blue"
ColorOrange Color = "orange"
ColorGrey Color = "grey"
)
func (c Color) String() string {
return string(c)
}
// ColorValidator is a validator for the "color" field enum values. It is called by the builders before save.
func ColorValidator(c Color) error {
switch c {
case ColorGreen, ColorYellow, ColorPurple, ColorBlue, ColorOrange, ColorGrey:
return nil
default:
return fmt.Errorf("matchplayer: invalid enum value for color field: %q", c)
}
}
// OrderOption defines the ordering options for the MatchPlayer 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()
}
// ByTeamID orders the results by the team_id field.
func ByTeamID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTeamID, opts...).ToFunc()
}
// ByKills orders the results by the kills field.
func ByKills(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldKills, opts...).ToFunc()
}
// ByDeaths orders the results by the deaths field.
func ByDeaths(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeaths, opts...).ToFunc()
}
// ByAssists orders the results by the assists field.
func ByAssists(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAssists, opts...).ToFunc()
}
// ByHeadshot orders the results by the headshot field.
func ByHeadshot(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHeadshot, opts...).ToFunc()
}
// ByMvp orders the results by the mvp field.
func ByMvp(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMvp, opts...).ToFunc()
}
// ByScore orders the results by the score field.
func ByScore(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldScore, opts...).ToFunc()
}
// ByRankNew orders the results by the rank_new field.
func ByRankNew(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRankNew, opts...).ToFunc()
}
// ByRankOld orders the results by the rank_old field.
func ByRankOld(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRankOld, opts...).ToFunc()
}
// ByMk2 orders the results by the mk_2 field.
func ByMk2(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMk2, opts...).ToFunc()
}
// ByMk3 orders the results by the mk_3 field.
func ByMk3(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMk3, opts...).ToFunc()
}
// ByMk4 orders the results by the mk_4 field.
func ByMk4(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMk4, opts...).ToFunc()
}
// ByMk5 orders the results by the mk_5 field.
func ByMk5(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMk5, opts...).ToFunc()
}
// ByDmgEnemy orders the results by the dmg_enemy field.
func ByDmgEnemy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDmgEnemy, opts...).ToFunc()
}
// ByDmgTeam orders the results by the dmg_team field.
func ByDmgTeam(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDmgTeam, opts...).ToFunc()
}
// ByUdHe orders the results by the ud_he field.
func ByUdHe(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUdHe, opts...).ToFunc()
}
// ByUdFlames orders the results by the ud_flames field.
func ByUdFlames(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUdFlames, opts...).ToFunc()
}
// ByUdFlash orders the results by the ud_flash field.
func ByUdFlash(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUdFlash, opts...).ToFunc()
}
// ByUdDecoy orders the results by the ud_decoy field.
func ByUdDecoy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUdDecoy, opts...).ToFunc()
}
// ByUdSmoke orders the results by the ud_smoke field.
func ByUdSmoke(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUdSmoke, opts...).ToFunc()
}
// ByCrosshair orders the results by the crosshair field.
func ByCrosshair(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCrosshair, opts...).ToFunc()
}
// ByColor orders the results by the color field.
func ByColor(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldColor, opts...).ToFunc()
}
// ByKast orders the results by the kast field.
func ByKast(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldKast, opts...).ToFunc()
}
// ByFlashDurationSelf orders the results by the flash_duration_self field.
func ByFlashDurationSelf(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFlashDurationSelf, opts...).ToFunc()
}
// ByFlashDurationTeam orders the results by the flash_duration_team field.
func ByFlashDurationTeam(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFlashDurationTeam, opts...).ToFunc()
}
// ByFlashDurationEnemy orders the results by the flash_duration_enemy field.
func ByFlashDurationEnemy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFlashDurationEnemy, opts...).ToFunc()
}
// ByFlashTotalSelf orders the results by the flash_total_self field.
func ByFlashTotalSelf(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFlashTotalSelf, opts...).ToFunc()
}
// ByFlashTotalTeam orders the results by the flash_total_team field.
func ByFlashTotalTeam(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFlashTotalTeam, opts...).ToFunc()
}
// ByFlashTotalEnemy orders the results by the flash_total_enemy field.
func ByFlashTotalEnemy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFlashTotalEnemy, opts...).ToFunc()
}
// ByMatchStats orders the results by the match_stats field.
func ByMatchStats(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMatchStats, opts...).ToFunc()
}
// ByPlayerStats orders the results by the player_stats field.
func ByPlayerStats(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPlayerStats, opts...).ToFunc()
}
// ByFlashAssists orders the results by the flash_assists field.
func ByFlashAssists(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFlashAssists, opts...).ToFunc()
}
// ByAvgPing orders the results by the avg_ping field.
func ByAvgPing(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAvgPing, opts...).ToFunc()
}
// ByMatchesField orders the results by matches field.
func ByMatchesField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newMatchesStep(), sql.OrderByField(field, opts...))
}
}
// ByPlayersField orders the results by players field.
func ByPlayersField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newPlayersStep(), sql.OrderByField(field, opts...))
}
}
// ByWeaponStatsCount orders the results by weapon_stats count.
func ByWeaponStatsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newWeaponStatsStep(), opts...)
}
}
// ByWeaponStats orders the results by weapon_stats terms.
func ByWeaponStats(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newWeaponStatsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByRoundStatsCount orders the results by round_stats count.
func ByRoundStatsCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newRoundStatsStep(), opts...)
}
}
// ByRoundStats orders the results by round_stats terms.
func ByRoundStats(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newRoundStatsStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// BySprayCount orders the results by spray count.
func BySprayCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newSprayStep(), opts...)
}
}
// BySpray orders the results by spray terms.
func BySpray(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newSprayStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByMessagesCount orders the results by messages count.
func ByMessagesCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newMessagesStep(), opts...)
}
}
// ByMessages orders the results by messages terms.
func ByMessages(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newMessagesStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
func newMatchesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(MatchesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, MatchesTable, MatchesColumn),
)
}
func newPlayersStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(PlayersInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, PlayersTable, PlayersColumn),
)
}
func newWeaponStatsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(WeaponStatsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, WeaponStatsTable, WeaponStatsColumn),
)
}
func newRoundStatsStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(RoundStatsInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, RoundStatsTable, RoundStatsColumn),
)
}
func newSprayStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(SprayInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, SprayTable, SprayColumn),
)
}
func newMessagesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(MessagesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, MessagesTable, MessagesColumn),
)
}