152 lines
5.2 KiB
Go
152 lines
5.2 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package players
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"github.com/lib/pq"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the players type in the database.
|
|
Label = "players"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldUserID holds the string denoting the user_id field in the database.
|
|
FieldUserID = "user_id"
|
|
// FieldStatus holds the string denoting the status field in the database.
|
|
FieldStatus = "status"
|
|
// FieldGender holds the string denoting the gender field in the database.
|
|
FieldGender = "gender"
|
|
// FieldRating holds the string denoting the rating field in the database.
|
|
FieldRating = "rating"
|
|
// FieldTotalOrders holds the string denoting the total_orders field in the database.
|
|
FieldTotalOrders = "total_orders"
|
|
// FieldCompletedOrders holds the string denoting the completed_orders field in the database.
|
|
FieldCompletedOrders = "completed_orders"
|
|
// FieldShopID holds the string denoting the shop_id field in the database.
|
|
FieldShopID = "shop_id"
|
|
// FieldTags holds the string denoting the tags field in the database.
|
|
FieldTags = "tags"
|
|
// FieldGames holds the string denoting the games field in the database.
|
|
FieldGames = "games"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
FieldUpdatedAt = "updated_at"
|
|
// Table holds the table name of the players in the database.
|
|
Table = "players"
|
|
)
|
|
|
|
// Columns holds all SQL columns for players fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldUserID,
|
|
FieldStatus,
|
|
FieldGender,
|
|
FieldRating,
|
|
FieldTotalOrders,
|
|
FieldCompletedOrders,
|
|
FieldShopID,
|
|
FieldTags,
|
|
FieldGames,
|
|
FieldCreatedAt,
|
|
FieldUpdatedAt,
|
|
}
|
|
|
|
// 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 (
|
|
// DefaultStatus holds the default value on creation for the "status" field.
|
|
DefaultStatus string
|
|
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
|
StatusValidator func(string) error
|
|
// DefaultGender holds the default value on creation for the "gender" field.
|
|
DefaultGender bool
|
|
// DefaultRating holds the default value on creation for the "rating" field.
|
|
DefaultRating decimal.Decimal
|
|
// DefaultTotalOrders holds the default value on creation for the "total_orders" field.
|
|
DefaultTotalOrders int
|
|
// DefaultCompletedOrders holds the default value on creation for the "completed_orders" field.
|
|
DefaultCompletedOrders int
|
|
// DefaultTags holds the default value on creation for the "tags" field.
|
|
DefaultTags []string
|
|
// DefaultGames holds the default value on creation for the "games" field.
|
|
DefaultGames pq.Int64Array
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt func() time.Time
|
|
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
|
DefaultUpdatedAt func() time.Time
|
|
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
|
|
UpdateDefaultUpdatedAt func() time.Time
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the Players 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()
|
|
}
|
|
|
|
// ByUserID orders the results by the user_id field.
|
|
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUserID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByStatus orders the results by the status field.
|
|
func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
|
}
|
|
|
|
// ByGender orders the results by the gender field.
|
|
func ByGender(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldGender, opts...).ToFunc()
|
|
}
|
|
|
|
// ByRating orders the results by the rating field.
|
|
func ByRating(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldRating, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTotalOrders orders the results by the total_orders field.
|
|
func ByTotalOrders(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTotalOrders, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCompletedOrders orders the results by the completed_orders field.
|
|
func ByCompletedOrders(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCompletedOrders, opts...).ToFunc()
|
|
}
|
|
|
|
// ByShopID orders the results by the shop_id field.
|
|
func ByShopID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldShopID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByGames orders the results by the games field.
|
|
func ByGames(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldGames, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedAt orders the results by the created_at field.
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUpdatedAt orders the results by the updated_at field.
|
|
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
|
}
|