1
0
api/ent/ma/ma.go
2024-04-25 14:05:59 +09:00

270 lines
8.7 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"
// FieldCidRoot holds the string denoting the cid_root field in the database.
FieldCidRoot = "cid_root"
// FieldURIRoot holds the string denoting the uri_root field in the database.
FieldURIRoot = "uri_root"
// FieldRoot holds the string denoting the root field in the database.
FieldRoot = "root"
// 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"
// FieldComment holds the string denoting the comment field in the database.
FieldComment = "comment"
// FieldBlog holds the string denoting the blog field in the database.
FieldBlog = "blog"
// FieldBlogURL holds the string denoting the blog_url field in the database.
FieldBlogURL = "blog_url"
// FieldDomain holds the string denoting the domain field in the database.
FieldDomain = "domain"
// FieldHost holds the string denoting the host field in the database.
FieldHost = "host"
// FieldFeed holds the string denoting the feed field in the database.
FieldFeed = "feed"
// 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,
FieldCidRoot,
FieldURIRoot,
FieldRoot,
FieldRkey,
FieldBskyURL,
FieldComment,
FieldBlog,
FieldBlogURL,
FieldDomain,
FieldHost,
FieldFeed,
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()
}
// ByCidRoot orders the results by the cid_root field.
func ByCidRoot(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCidRoot, opts...).ToFunc()
}
// ByURIRoot orders the results by the uri_root field.
func ByURIRoot(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldURIRoot, opts...).ToFunc()
}
// ByRoot orders the results by the root field.
func ByRoot(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRoot, 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()
}
// ByComment orders the results by the comment field.
func ByComment(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldComment, opts...).ToFunc()
}
// ByBlog orders the results by the blog field.
func ByBlog(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBlog, opts...).ToFunc()
}
// ByBlogURL orders the results by the blog_url field.
func ByBlogURL(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBlogURL, opts...).ToFunc()
}
// ByDomain orders the results by the domain field.
func ByDomain(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDomain, opts...).ToFunc()
}
// ByHost orders the results by the host field.
func ByHost(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHost, opts...).ToFunc()
}
// ByFeed orders the results by the feed field.
func ByFeed(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldFeed, 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),
)
}