99 lines
2.9 KiB
Go
99 lines
2.9 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package skin
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the skin type in the database.
|
|
Label = "skin"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldSkinHash holds the string denoting the skin_hash field in the database.
|
|
FieldSkinHash = "skin_hash"
|
|
// FieldType holds the string denoting the type field in the database.
|
|
FieldType = "type"
|
|
// FieldVariant holds the string denoting the variant field in the database.
|
|
FieldVariant = "variant"
|
|
// EdgeUser holds the string denoting the user edge name in mutations.
|
|
EdgeUser = "user"
|
|
// Table holds the table name of the skin in the database.
|
|
Table = "skins"
|
|
// UserTable is the table that holds the user relation/edge.
|
|
UserTable = "skins"
|
|
// UserInverseTable is the table name for the User entity.
|
|
// It exists in this package in order to avoid circular dependency with the "user" package.
|
|
UserInverseTable = "users"
|
|
// UserColumn is the table column denoting the user relation/edge.
|
|
UserColumn = "skin_user"
|
|
)
|
|
|
|
// Columns holds all SQL columns for skin fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldSkinHash,
|
|
FieldType,
|
|
FieldVariant,
|
|
}
|
|
|
|
// ForeignKeys holds the SQL foreign-keys that are owned by the "skins"
|
|
// table and are not defined as standalone fields in the schema.
|
|
var ForeignKeys = []string{
|
|
"skin_user",
|
|
}
|
|
|
|
// 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 Skin 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()
|
|
}
|
|
|
|
// BySkinHash orders the results by the skin_hash field.
|
|
func BySkinHash(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSkinHash, opts...).ToFunc()
|
|
}
|
|
|
|
// ByType orders the results by the type field.
|
|
func ByType(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldType, opts...).ToFunc()
|
|
}
|
|
|
|
// ByVariant orders the results by the variant field.
|
|
func ByVariant(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldVariant, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUserField orders the results by user field.
|
|
func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newUserStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
func newUserStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(UserInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, false, UserTable, UserColumn),
|
|
)
|
|
}
|