96 lines
2.8 KiB
Go
96 lines
2.8 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package validators
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the validators type in the database.
|
|
Label = "validators"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldFacilitator holds the string denoting the facilitator field in the database.
|
|
FieldFacilitator = "facilitator"
|
|
// EdgeKey holds the string denoting the key edge name in mutations.
|
|
EdgeKey = "key"
|
|
// Table holds the table name of the validators in the database.
|
|
Table = "validators"
|
|
// KeyTable is the table that holds the key relation/edge.
|
|
KeyTable = "keys"
|
|
// KeyInverseTable is the table name for the Key entity.
|
|
// It exists in this package in order to avoid circular dependency with the "key" package.
|
|
KeyInverseTable = "keys"
|
|
// KeyColumn is the table column denoting the key relation/edge.
|
|
KeyColumn = "validators_key"
|
|
)
|
|
|
|
// Columns holds all SQL columns for validators fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldFacilitator,
|
|
}
|
|
|
|
// ForeignKeys holds the SQL foreign-keys that are owned by the "validators"
|
|
// table and are not defined as standalone fields in the schema.
|
|
var ForeignKeys = []string{
|
|
"blocks_caster",
|
|
"white_list_sponsor",
|
|
}
|
|
|
|
// 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 (
|
|
// FacilitatorValidator is a validator for the "facilitator" field. It is called by the builders before save.
|
|
FacilitatorValidator func(string) error
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the Validators 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()
|
|
}
|
|
|
|
// ByFacilitator orders the results by the facilitator field.
|
|
func ByFacilitator(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldFacilitator, opts...).ToFunc()
|
|
}
|
|
|
|
// ByKeyCount orders the results by key count.
|
|
func ByKeyCount(opts ...sql.OrderTermOption) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborsCount(s, newKeyStep(), opts...)
|
|
}
|
|
}
|
|
|
|
// ByKey orders the results by key terms.
|
|
func ByKey(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
|
|
return func(s *sql.Selector) {
|
|
sqlgraph.OrderByNeighborTerms(s, newKeyStep(), append([]sql.OrderTerm{term}, terms...)...)
|
|
}
|
|
}
|
|
func newKeyStep() *sqlgraph.Step {
|
|
return sqlgraph.NewStep(
|
|
sqlgraph.From(Table, FieldID),
|
|
sqlgraph.To(KeyInverseTable, FieldID),
|
|
sqlgraph.Edge(sqlgraph.O2M, false, KeyTable, KeyColumn),
|
|
)
|
|
}
|