online-order/ent/businessconfig/businessconfig.go
2023-10-29 02:42:07 +03:30

91 lines
3.0 KiB
Go

// Code generated by ent, DO NOT EDIT.
package businessconfig
import (
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the businessconfig type in the database.
Label = "business_config"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCompany holds the string denoting the company field in the database.
FieldCompany = "company"
// FieldAuthConfig holds the string denoting the auth_config field in the database.
FieldAuthConfig = "auth_config"
// FieldConfig holds the string denoting the config field in the database.
FieldConfig = "config"
// FieldBusinessID holds the string denoting the business_id field in the database.
FieldBusinessID = "business_id"
// EdgeBusinesses holds the string denoting the businesses edge name in mutations.
EdgeBusinesses = "businesses"
// Table holds the table name of the businessconfig in the database.
Table = "business_configs"
// BusinessesTable is the table that holds the businesses relation/edge.
BusinessesTable = "business_configs"
// BusinessesInverseTable is the table name for the Business entity.
// It exists in this package in order to avoid circular dependency with the "business" package.
BusinessesInverseTable = "businesses"
// BusinessesColumn is the table column denoting the businesses relation/edge.
BusinessesColumn = "business_id"
)
// Columns holds all SQL columns for businessconfig fields.
var Columns = []string{
FieldID,
FieldCompany,
FieldAuthConfig,
FieldConfig,
FieldBusinessID,
}
// 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 (
// DefaultCompany holds the default value on creation for the "company" field.
DefaultCompany string
)
// OrderOption defines the ordering options for the BusinessConfig 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()
}
// ByCompany orders the results by the company field.
func ByCompany(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCompany, opts...).ToFunc()
}
// ByBusinessID orders the results by the business_id field.
func ByBusinessID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBusinessID, opts...).ToFunc()
}
// ByBusinessesField orders the results by businesses field.
func ByBusinessesField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newBusinessesStep(), sql.OrderByField(field, opts...))
}
}
func newBusinessesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(BusinessesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, BusinessesTable, BusinessesColumn),
)
}