// Code generated by ent, DO NOT EDIT. 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" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldShareCode holds the string denoting the share_code field in the database. FieldShareCode = "share_code" // FieldMap holds the string denoting the map field in the database. FieldMap = "map" // FieldDate holds the string denoting the date field in the database. FieldDate = "date" // FieldScoreTeamA holds the string denoting the score_team_a field in the database. FieldScoreTeamA = "score_team_a" // FieldScoreTeamB holds the string denoting the score_team_b field in the database. FieldScoreTeamB = "score_team_b" // FieldReplayURL holds the string denoting the replay_url field in the database. FieldReplayURL = "replay_url" // FieldDuration holds the string denoting the duration field in the database. FieldDuration = "duration" // FieldMatchResult holds the string denoting the match_result field in the database. FieldMatchResult = "match_result" // FieldMaxRounds holds the string denoting the max_rounds field in the database. FieldMaxRounds = "max_rounds" // FieldDemoParsed holds the string denoting the demo_parsed field in the database. FieldDemoParsed = "demo_parsed" // FieldVacPresent holds the string denoting the vac_present field in the database. FieldVacPresent = "vac_present" // FieldGamebanPresent holds the string denoting the gameban_present field in the database. FieldGamebanPresent = "gameban_present" // FieldDecryptionKey holds the string denoting the decryption_key field in the database. FieldDecryptionKey = "decryption_key" // FieldTickRate holds the string denoting the tick_rate field in the database. FieldTickRate = "tick_rate" // EdgeStats holds the string denoting the stats edge name in mutations. EdgeStats = "stats" // EdgePlayers holds the string denoting the players edge name in mutations. EdgePlayers = "players" // Table holds the table name of the match in the database. Table = "matches" // 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 = "match_stats" // PlayersTable is the table that holds the players relation/edge. The primary key declared below. PlayersTable = "player_matches" // 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" ) // Columns holds all SQL columns for match fields. var Columns = []string{ FieldID, FieldShareCode, FieldMap, FieldDate, FieldScoreTeamA, FieldScoreTeamB, FieldReplayURL, FieldDuration, FieldMatchResult, FieldMaxRounds, FieldDemoParsed, FieldVacPresent, FieldGamebanPresent, FieldDecryptionKey, FieldTickRate, } var ( // PlayersPrimaryKey and PlayersColumn2 are the table columns denoting the // primary key for the players relation (M2M). PlayersPrimaryKey = []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 ( // DefaultDemoParsed holds the default value on creation for the "demo_parsed" field. DefaultDemoParsed bool // DefaultVacPresent holds the default value on creation for the "vac_present" field. DefaultVacPresent bool // 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...), ) }