122 lines
3.9 KiB
Go
122 lines
3.9 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package email
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the email type in the database.
|
|
Label = "email"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldEmail holds the string denoting the email field in the database.
|
|
FieldEmail = "email"
|
|
// FieldPrimary holds the string denoting the primary field in the database.
|
|
FieldPrimary = "primary"
|
|
// FieldVerified holds the string denoting the verified field in the database.
|
|
FieldVerified = "verified"
|
|
// FieldVerificationCode holds the string denoting the verification_code field in the database.
|
|
FieldVerificationCode = "verification_code"
|
|
// FieldResetCode holds the string denoting the reset_code field in the database.
|
|
FieldResetCode = "reset_code"
|
|
// EdgeAccounts holds the string denoting the accounts edge name in mutations.
|
|
EdgeAccounts = "accounts"
|
|
// Table holds the table name of the email in the database.
|
|
Table = "emails"
|
|
// AccountsTable is the table that holds the accounts relation/edge.
|
|
AccountsTable = "emails"
|
|
// AccountsInverseTable is the table name for the Account entity.
|
|
// It exists in this package in order to avoid circular dependency with the "account" package.
|
|
AccountsInverseTable = "accounts"
|
|
// AccountsColumn is the table column denoting the accounts relation/edge.
|
|
AccountsColumn = "account_emails"
|
|
)
|
|
|
|
// Columns holds all SQL columns for email fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldEmail,
|
|
FieldPrimary,
|
|
FieldVerified,
|
|
FieldVerificationCode,
|
|
FieldResetCode,
|
|
}
|
|
|
|
// ForeignKeys holds the SQL foreign-keys that are owned by the "emails"
|
|
// table and are not defined as standalone fields in the schema.
|
|
var ForeignKeys = []string{
|
|
"account_emails",
|
|
}
|
|
|
|
// 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 (
|
|
// DefaultPrimary holds the default value on creation for the "primary" field.
|
|
DefaultPrimary bool
|
|
// DefaultVerified holds the default value on creation for the "verified" field.
|
|
DefaultVerified bool
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the Email 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()
|
|
}
|
|
|
|
// ByEmail orders the results by the email field.
|
|
func ByEmail(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldEmail, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPrimary orders the results by the primary field.
|
|
func ByPrimary(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPrimary, opts...).ToFunc()
|
|
}
|
|
|
|
// ByVerified orders the results by the verified field.
|
|
func ByVerified(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldVerified, opts...).ToFunc()
|
|
}
|
|
|
|
// ByVerificationCode orders the results by the verification_code field.
|
|
func ByVerificationCode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldVerificationCode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByResetCode orders the results by the reset_code field.
|
|
func ByResetCode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldResetCode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByAccountsField orders the results by accounts field.
|
|
func ByAccountsField(field string, opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newAccountsStep(), sql.OrderByField(field, opts...))
|
|
}
|
|
}
|
|
func newAccountsStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(AccountsInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.M2O, true, AccountsTable, AccountsColumn),
|
|
)
|
|
}
|