Files
polaris/ent/series/series.go
2024-06-22 17:15:24 +08:00

88 lines
2.6 KiB
Go

// Code generated by ent, DO NOT EDIT.
package series
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the series type in the database.
Label = "series"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldTmdbID holds the string denoting the tmdb_id field in the database.
FieldTmdbID = "tmdb_id"
// FieldImdbID holds the string denoting the imdb_id field in the database.
FieldImdbID = "imdb_id"
// FieldTitle holds the string denoting the title field in the database.
FieldTitle = "title"
// FieldOriginalName holds the string denoting the original_name field in the database.
FieldOriginalName = "original_name"
// FieldOverview holds the string denoting the overview field in the database.
FieldOverview = "overview"
// FieldPath holds the string denoting the path field in the database.
FieldPath = "path"
// Table holds the table name of the series in the database.
Table = "series"
)
// Columns holds all SQL columns for series fields.
var Columns = []string{
FieldID,
FieldTmdbID,
FieldImdbID,
FieldTitle,
FieldOriginalName,
FieldOverview,
FieldPath,
}
// 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
}
}
return false
}
// OrderOption defines the ordering options for the Series 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()
}
// ByTmdbID orders the results by the tmdb_id field.
func ByTmdbID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTmdbID, opts...).ToFunc()
}
// ByImdbID orders the results by the imdb_id field.
func ByImdbID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldImdbID, opts...).ToFunc()
}
// ByTitle orders the results by the title field.
func ByTitle(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTitle, opts...).ToFunc()
}
// ByOriginalName orders the results by the original_name field.
func ByOriginalName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOriginalName, opts...).ToFunc()
}
// ByOverview orders the results by the overview field.
func ByOverview(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOverview, opts...).ToFunc()
}
// ByPath orders the results by the path field.
func ByPath(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldPath, opts...).ToFunc()
}