198 lines
6.2 KiB
Go
198 lines
6.2 KiB
Go
|
// Code generated by ent, DO NOT EDIT.
|
||
|
|
||
|
package ma
|
||
|
|
||
|
import (
|
||
|
"time"
|
||
|
|
||
|
"entgo.io/ent/dialect/sql"
|
||
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
// Label holds the string label denoting the ma type in the database.
|
||
|
Label = "ma"
|
||
|
// 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"
|
||
|
// FieldText holds the string denoting the text field in the database.
|
||
|
FieldText = "text"
|
||
|
// FieldDid holds the string denoting the did field in the database.
|
||
|
FieldDid = "did"
|
||
|
// FieldAvatar holds the string denoting the avatar field in the database.
|
||
|
FieldAvatar = "avatar"
|
||
|
// FieldCid holds the string denoting the cid field in the database.
|
||
|
FieldCid = "cid"
|
||
|
// FieldURI holds the string denoting the uri field in the database.
|
||
|
FieldURI = "uri"
|
||
|
// FieldRkey holds the string denoting the rkey field in the database.
|
||
|
FieldRkey = "rkey"
|
||
|
// FieldBskyURL holds the string denoting the bsky_url field in the database.
|
||
|
FieldBskyURL = "bsky_url"
|
||
|
// 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 ma in the database.
|
||
|
Table = "mas"
|
||
|
// OwnerTable is the table that holds the owner relation/edge.
|
||
|
OwnerTable = "mas"
|
||
|
// 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_ma"
|
||
|
)
|
||
|
|
||
|
// Columns holds all SQL columns for ma fields.
|
||
|
var Columns = []string{
|
||
|
FieldID,
|
||
|
FieldPassword,
|
||
|
FieldToken,
|
||
|
FieldLimit,
|
||
|
FieldCount,
|
||
|
FieldHandle,
|
||
|
FieldText,
|
||
|
FieldDid,
|
||
|
FieldAvatar,
|
||
|
FieldCid,
|
||
|
FieldURI,
|
||
|
FieldRkey,
|
||
|
FieldBskyURL,
|
||
|
FieldUpdatedAt,
|
||
|
FieldCreatedAt,
|
||
|
}
|
||
|
|
||
|
// ForeignKeys holds the SQL foreign-keys that are owned by the "mas"
|
||
|
// table and are not defined as standalone fields in the schema.
|
||
|
var ForeignKeys = []string{
|
||
|
"user_ma",
|
||
|
}
|
||
|
|
||
|
// 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 Ma 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()
|
||
|
}
|
||
|
|
||
|
// ByText orders the results by the text field.
|
||
|
func ByText(opts ...sql.OrderTermOption) OrderOption {
|
||
|
return sql.OrderByField(FieldText, opts...).ToFunc()
|
||
|
}
|
||
|
|
||
|
// ByDid orders the results by the did field.
|
||
|
func ByDid(opts ...sql.OrderTermOption) OrderOption {
|
||
|
return sql.OrderByField(FieldDid, opts...).ToFunc()
|
||
|
}
|
||
|
|
||
|
// ByAvatar orders the results by the avatar field.
|
||
|
func ByAvatar(opts ...sql.OrderTermOption) OrderOption {
|
||
|
return sql.OrderByField(FieldAvatar, opts...).ToFunc()
|
||
|
}
|
||
|
|
||
|
// ByCid orders the results by the cid field.
|
||
|
func ByCid(opts ...sql.OrderTermOption) OrderOption {
|
||
|
return sql.OrderByField(FieldCid, opts...).ToFunc()
|
||
|
}
|
||
|
|
||
|
// ByURI orders the results by the uri field.
|
||
|
func ByURI(opts ...sql.OrderTermOption) OrderOption {
|
||
|
return sql.OrderByField(FieldURI, opts...).ToFunc()
|
||
|
}
|
||
|
|
||
|
// ByRkey orders the results by the rkey field.
|
||
|
func ByRkey(opts ...sql.OrderTermOption) OrderOption {
|
||
|
return sql.OrderByField(FieldRkey, opts...).ToFunc()
|
||
|
}
|
||
|
|
||
|
// ByBskyURL orders the results by the bsky_url field.
|
||
|
func ByBskyURL(opts ...sql.OrderTermOption) OrderOption {
|
||
|
return sql.OrderByField(FieldBskyURL, 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),
|
||
|
)
|
||
|
}
|