// Code generated by ent, DO NOT EDIT. package series import ( "time" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" ) 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" // FieldName holds the string denoting the name field in the database. FieldName = "name" // 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" // FieldPosterPath holds the string denoting the poster_path field in the database. FieldPosterPath = "poster_path" // FieldCreatedAt holds the string denoting the created_at field in the database. FieldCreatedAt = "created_at" // EdgeEpisodes holds the string denoting the episodes edge name in mutations. EdgeEpisodes = "episodes" // Table holds the table name of the series in the database. Table = "series" // EpisodesTable is the table that holds the episodes relation/edge. EpisodesTable = "episodes" // EpisodesInverseTable is the table name for the Episode entity. // It exists in this package in order to avoid circular dependency with the "episode" package. EpisodesInverseTable = "episodes" // EpisodesColumn is the table column denoting the episodes relation/edge. EpisodesColumn = "series_id" ) // Columns holds all SQL columns for series fields. var Columns = []string{ FieldID, FieldTmdbID, FieldImdbID, FieldName, FieldOriginalName, FieldOverview, FieldPath, FieldPosterPath, FieldCreatedAt, } // 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 } var ( // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt time.Time ) // 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() } // ByName orders the results by the name field. func ByName(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldName, 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() } // ByPosterPath orders the results by the poster_path field. func ByPosterPath(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldPosterPath, opts...).ToFunc() } // ByCreatedAt orders the results by the created_at field. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() } // ByEpisodesCount orders the results by episodes count. func ByEpisodesCount(opts ...sql.OrderTermOption) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborsCount(s, newEpisodesStep(), opts...) } } // ByEpisodes orders the results by episodes terms. func ByEpisodes(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption { return func(s *sql.Selector) { sqlgraph.OrderByNeighborTerms(s, newEpisodesStep(), append([]sql.OrderTerm{term}, terms...)...) } } func newEpisodesStep() *sqlgraph.Step { return sqlgraph.NewStep( sqlgraph.From(Table, FieldID), sqlgraph.To(EpisodesInverseTable, FieldID), sqlgraph.Edge(sqlgraph.O2M, false, EpisodesTable, EpisodesColumn), ) }