119 lines
4.2 KiB
Go
119 lines
4.2 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package usertexture
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the usertexture type in the database.
|
|
Label = "user_texture"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldUserProfileID holds the string denoting the user_profile_id field in the database.
|
|
FieldUserProfileID = "user_profile_id"
|
|
// FieldTextureID holds the string denoting the texture_id field in the database.
|
|
FieldTextureID = "texture_id"
|
|
// 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"
|
|
// EdgeUserProfile holds the string denoting the user_profile edge name in mutations.
|
|
EdgeUserProfile = "user_profile"
|
|
// EdgeTexture holds the string denoting the texture edge name in mutations.
|
|
EdgeTexture = "texture"
|
|
// Table holds the table name of the usertexture in the database.
|
|
Table = "user_textures"
|
|
// UserProfileTable is the table that holds the user_profile relation/edge.
|
|
UserProfileTable = "user_textures"
|
|
// UserProfileInverseTable is the table name for the UserProfile entity.
|
|
// It exists in this package in order to avoid circular dependency with the "userprofile" package.
|
|
UserProfileInverseTable = "user_profiles"
|
|
// UserProfileColumn is the table column denoting the user_profile relation/edge.
|
|
UserProfileColumn = "user_profile_id"
|
|
// TextureTable is the table that holds the texture relation/edge.
|
|
TextureTable = "user_textures"
|
|
// TextureInverseTable is the table name for the Texture entity.
|
|
// It exists in this package in order to avoid circular dependency with the "texture" package.
|
|
TextureInverseTable = "textures"
|
|
// TextureColumn is the table column denoting the texture relation/edge.
|
|
TextureColumn = "texture_id"
|
|
)
|
|
|
|
// Columns holds all SQL columns for usertexture fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldUserProfileID,
|
|
FieldTextureID,
|
|
FieldType,
|
|
FieldVariant,
|
|
}
|
|
|
|
// 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
|
|
}
|
|
|
|
// OrderOption defines the ordering options for the UserTexture 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()
|
|
}
|
|
|
|
// ByUserProfileID orders the results by the user_profile_id field.
|
|
func ByUserProfileID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUserProfileID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByTextureID orders the results by the texture_id field.
|
|
func ByTextureID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldTextureID, 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()
|
|
}
|
|
|
|
// ByUserProfileField orders the results by user_profile field.
|
|
func ByUserProfileField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newUserProfileStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
|
|
// ByTextureField orders the results by texture field.
|
|
func ByTextureField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newTextureStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
func newUserProfileStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(UserProfileInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, false, UserProfileTable, UserProfileColumn),
|
|
)
|
|
}
|
|
func newTextureStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(TextureInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, false, TextureTable, TextureColumn),
|
|
)
|
|
}
|