mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 19:47:47 +08:00
first draft version
This commit is contained in:
87
ent/epidodes/epidodes.go
Normal file
87
ent/epidodes/epidodes.go
Normal file
@@ -0,0 +1,87 @@
|
||||
// Code generated by ent, DO NOT EDIT.
|
||||
|
||||
package epidodes
|
||||
|
||||
import (
|
||||
"entgo.io/ent/dialect/sql"
|
||||
)
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the epidodes type in the database.
|
||||
Label = "epidodes"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldSeriesID holds the string denoting the series_id field in the database.
|
||||
FieldSeriesID = "series_id"
|
||||
// FieldSeasonNumber holds the string denoting the season_number field in the database.
|
||||
FieldSeasonNumber = "season_number"
|
||||
// FieldEpisodeNumber holds the string denoting the episode_number field in the database.
|
||||
FieldEpisodeNumber = "episode_number"
|
||||
// FieldTitle holds the string denoting the title field in the database.
|
||||
FieldTitle = "title"
|
||||
// FieldOverview holds the string denoting the overview field in the database.
|
||||
FieldOverview = "overview"
|
||||
// FieldAirDate holds the string denoting the air_date field in the database.
|
||||
FieldAirDate = "air_date"
|
||||
// Table holds the table name of the epidodes in the database.
|
||||
Table = "epidodes"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for epidodes fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldSeriesID,
|
||||
FieldSeasonNumber,
|
||||
FieldEpisodeNumber,
|
||||
FieldTitle,
|
||||
FieldOverview,
|
||||
FieldAirDate,
|
||||
}
|
||||
|
||||
// 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 Epidodes 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()
|
||||
}
|
||||
|
||||
// BySeriesID orders the results by the series_id field.
|
||||
func BySeriesID(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSeriesID, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// BySeasonNumber orders the results by the season_number field.
|
||||
func BySeasonNumber(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldSeasonNumber, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByEpisodeNumber orders the results by the episode_number field.
|
||||
func ByEpisodeNumber(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldEpisodeNumber, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByTitle orders the results by the title field.
|
||||
func ByTitle(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldTitle, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByOverview orders the results by the overview field.
|
||||
func ByOverview(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldOverview, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByAirDate orders the results by the air_date field.
|
||||
func ByAirDate(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldAirDate, opts...).ToFunc()
|
||||
}
|
||||
Reference in New Issue
Block a user