// Code generated by ent, DO NOT EDIT. package roundstats import ( "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" ) const ( // Label holds the string label denoting the roundstats type in the database. Label = "round_stats" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldRound holds the string denoting the round field in the database. FieldRound = "round" // FieldBank holds the string denoting the bank field in the database. FieldBank = "bank" // FieldEquipment holds the string denoting the equipment field in the database. FieldEquipment = "equipment" // FieldSpent holds the string denoting the spent field in the database. FieldSpent = "spent" // EdgeMatchPlayer holds the string denoting the match_player edge name in mutations. EdgeMatchPlayer = "match_player" // Table holds the table name of the roundstats in the database. Table = "round_stats" // MatchPlayerTable is the table that holds the match_player relation/edge. MatchPlayerTable = "round_stats" // MatchPlayerInverseTable is the table name for the MatchPlayer entity. // It exists in this package in order to avoid circular dependency with the "matchplayer" package. MatchPlayerInverseTable = "match_players" // MatchPlayerColumn is the table column denoting the match_player relation/edge. MatchPlayerColumn = "match_player_round_stats" ) // Columns holds all SQL columns for roundstats fields. var Columns = []string{ FieldID, FieldRound, FieldBank, FieldEquipment, FieldSpent, } // ForeignKeys holds the SQL foreign-keys that are owned by the "round_stats" // table and are not defined as standalone fields in the schema. var ForeignKeys = []string{ "match_player_round_stats", } // 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 } } for i := range ForeignKeys { if column == ForeignKeys[i] { return true } } return false } // OrderOption defines the ordering options for the RoundStats 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() } // ByRound orders the results by the round field. func ByRound(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRound, opts...).ToFunc() } // ByBank orders the results by the bank field. func ByBank(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBank, opts...).ToFunc() } // ByEquipment orders the results by the equipment field. func ByEquipment(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldEquipment, opts...).ToFunc() } // BySpent orders the results by the spent field. func BySpent(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSpent, opts...).ToFunc() } // ByMatchPlayerField orders the results by match_player field. func ByMatchPlayerField(field string, opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newMatchPlayerStep(), sql.OrderByField(field, opts...)) } } func newMatchPlayerStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(MatchPlayerInverseTable, FieldID), sqlgraph.Edge(sqlgraph.M2O, true, MatchPlayerTable, MatchPlayerColumn), ) }