Files
csgowtfd/ent/player/player.go

240 lines
8.5 KiB
Go

// Code generated by ent, DO NOT EDIT.
package player
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the player type in the database.
Label = "player"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldAvatar holds the string denoting the avatar field in the database.
FieldAvatar = "avatar"
// FieldVanityURL holds the string denoting the vanity_url field in the database.
FieldVanityURL = "vanity_url"
// FieldVanityURLReal holds the string denoting the vanity_url_real field in the database.
FieldVanityURLReal = "vanity_url_real"
// FieldVacDate holds the string denoting the vac_date field in the database.
FieldVacDate = "vac_date"
// FieldVacCount holds the string denoting the vac_count field in the database.
FieldVacCount = "vac_count"
// FieldGameBanDate holds the string denoting the game_ban_date field in the database.
FieldGameBanDate = "game_ban_date"
// FieldGameBanCount holds the string denoting the game_ban_count field in the database.
FieldGameBanCount = "game_ban_count"
// FieldSteamUpdated holds the string denoting the steam_updated field in the database.
FieldSteamUpdated = "steam_updated"
// FieldSharecodeUpdated holds the string denoting the sharecode_updated field in the database.
FieldSharecodeUpdated = "sharecode_updated"
// FieldAuthCode holds the string denoting the auth_code field in the database.
FieldAuthCode = "auth_code"
// FieldProfileCreated holds the string denoting the profile_created field in the database.
FieldProfileCreated = "profile_created"
// FieldOldestSharecodeSeen holds the string denoting the oldest_sharecode_seen field in the database.
FieldOldestSharecodeSeen = "oldest_sharecode_seen"
// FieldWins holds the string denoting the wins field in the database.
FieldWins = "wins"
// FieldLooses holds the string denoting the looses field in the database.
FieldLooses = "looses"
// FieldTies holds the string denoting the ties field in the database.
FieldTies = "ties"
// EdgeStats holds the string denoting the stats edge name in mutations.
EdgeStats = "stats"
// EdgeMatches holds the string denoting the matches edge name in mutations.
EdgeMatches = "matches"
// Table holds the table name of the player in the database.
Table = "players"
// StatsTable is the table that holds the stats relation/edge.
StatsTable = "match_players"
// StatsInverseTable is the table name for the MatchPlayer entity.
// It exists in this package in order to avoid circular dependency with the "matchplayer" package.
StatsInverseTable = "match_players"
// StatsColumn is the table column denoting the stats relation/edge.
StatsColumn = "player_stats"
// MatchesTable is the table that holds the matches relation/edge. The primary key declared below.
MatchesTable = "player_matches"
// 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"
)
// Columns holds all SQL columns for player fields.
var Columns = []string{
FieldID,
FieldName,
FieldAvatar,
FieldVanityURL,
FieldVanityURLReal,
FieldVacDate,
FieldVacCount,
FieldGameBanDate,
FieldGameBanCount,
FieldSteamUpdated,
FieldSharecodeUpdated,
FieldAuthCode,
FieldProfileCreated,
FieldOldestSharecodeSeen,
FieldWins,
FieldLooses,
FieldTies,
}
var (
// MatchesPrimaryKey and MatchesColumn2 are the table columns denoting the
// primary key for the matches relation (M2M).
MatchesPrimaryKey = []string{"player_id", "match_id"}
)
// 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
}
var (
// DefaultSteamUpdated holds the default value on creation for the "steam_updated" field.
DefaultSteamUpdated func() time.Time
)
// OrderOption defines the ordering options for the Player 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()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByAvatar orders the results by the avatar field.
func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAvatar, opts...).ToFunc()
}
// ByVanityURL orders the results by the vanity_url field.
func ByVanityURL(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVanityURL, opts...).ToFunc()
}
// ByVanityURLReal orders the results by the vanity_url_real field.
func ByVanityURLReal(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVanityURLReal, opts...).ToFunc()
}
// ByVacDate orders the results by the vac_date field.
func ByVacDate(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVacDate, opts...).ToFunc()
}
// ByVacCount orders the results by the vac_count field.
func ByVacCount(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldVacCount, opts...).ToFunc()
}
// ByGameBanDate orders the results by the game_ban_date field.
func ByGameBanDate(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldGameBanDate, opts...).ToFunc()
}
// ByGameBanCount orders the results by the game_ban_count field.
func ByGameBanCount(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldGameBanCount, opts...).ToFunc()
}
// BySteamUpdated orders the results by the steam_updated field.
func BySteamUpdated(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSteamUpdated, opts...).ToFunc()
}
// BySharecodeUpdated orders the results by the sharecode_updated field.
func BySharecodeUpdated(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSharecodeUpdated, opts...).ToFunc()
}
// ByAuthCode orders the results by the auth_code field.
func ByAuthCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldAuthCode, opts...).ToFunc()
}
// ByProfileCreated orders the results by the profile_created field.
func ByProfileCreated(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldProfileCreated, opts...).ToFunc()
}
// ByOldestSharecodeSeen orders the results by the oldest_sharecode_seen field.
func ByOldestSharecodeSeen(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOldestSharecodeSeen, opts...).ToFunc()
}
// ByWins orders the results by the wins field.
func ByWins(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldWins, opts...).ToFunc()
}
// ByLooses orders the results by the looses field.
func ByLooses(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLooses, opts...).ToFunc()
}
// ByTies orders the results by the ties field.
func ByTies(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTies, 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...)...)
}
}
// ByMatchesCount orders the results by matches count.
func ByMatchesCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newMatchesStep(), opts...)
}
}
// ByMatches orders the results by matches terms.
func ByMatches(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newMatchesStep(), 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 newMatchesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(MatchesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2M, false, MatchesTable, MatchesPrimaryKey...),
)
}