1
0
api/ent/sev/sev.go
2024-04-11 10:14:25 +09:00

182 lines
5.7 KiB
Go

// Code generated by ent, DO NOT EDIT.
package sev
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the sev type in the database.
Label = "sev"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldPassword holds the string denoting the password field in the database.
FieldPassword = "password"
// FieldToken holds the string denoting the token field in the database.
FieldToken = "token"
// FieldLimit holds the string denoting the limit field in the database.
FieldLimit = "limit"
// FieldCount holds the string denoting the count field in the database.
FieldCount = "count"
// FieldHandle holds the string denoting the handle field in the database.
FieldHandle = "handle"
// FieldDid holds the string denoting the did field in the database.
FieldDid = "did"
// FieldUID holds the string denoting the uid field in the database.
FieldUID = "uid"
// FieldCid holds the string denoting the cid field in the database.
FieldCid = "cid"
// FieldCp holds the string denoting the cp field in the database.
FieldCp = "cp"
// FieldCard holds the string denoting the card field in the database.
FieldCard = "card"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// EdgeOwner holds the string denoting the owner edge name in mutations.
EdgeOwner = "owner"
// Table holds the table name of the sev in the database.
Table = "sevs"
// OwnerTable is the table that holds the owner relation/edge.
OwnerTable = "sevs"
// OwnerInverseTable is the table name for the User entity.
// It exists in this package in order to avoid circular dependency with the "user" package.
OwnerInverseTable = "users"
// OwnerColumn is the table column denoting the owner relation/edge.
OwnerColumn = "user_sev"
)
// Columns holds all SQL columns for sev fields.
var Columns = []string{
FieldID,
FieldPassword,
FieldToken,
FieldLimit,
FieldCount,
FieldHandle,
FieldDid,
FieldUID,
FieldCid,
FieldCp,
FieldCard,
FieldUpdatedAt,
FieldCreatedAt,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "sevs"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
"user_sev",
}
// 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
}
var (
// PasswordValidator is a validator for the "password" field. It is called by the builders before save.
PasswordValidator func(string) error
// DefaultLimit holds the default value on creation for the "limit" field.
DefaultLimit bool
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
)
// OrderOption defines the ordering options for the Sev 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()
}
// ByPassword orders the results by the password field.
func ByPassword(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPassword, opts...).ToFunc()
}
// ByToken orders the results by the token field.
func ByToken(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldToken, opts...).ToFunc()
}
// ByLimit orders the results by the limit field.
func ByLimit(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLimit, opts...).ToFunc()
}
// ByCount orders the results by the count field.
func ByCount(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCount, opts...).ToFunc()
}
// ByHandle orders the results by the handle field.
func ByHandle(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHandle, opts...).ToFunc()
}
// ByDid orders the results by the did field.
func ByDid(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDid, opts...).ToFunc()
}
// ByUID orders the results by the uid field.
func ByUID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUID, opts...).ToFunc()
}
// ByCid orders the results by the cid field.
func ByCid(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCid, opts...).ToFunc()
}
// ByCp orders the results by the cp field.
func ByCp(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCp, opts...).ToFunc()
}
// ByCard orders the results by the card field.
func ByCard(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCard, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByOwnerField orders the results by owner field.
func ByOwnerField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newOwnerStep(), sql.OrderByField(field, opts...))
}
}
func newOwnerStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(OwnerInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
)
}