// Code generated by ent, DO NOT EDIT. package soracachefile import ( "time" "entgo.io/ent/dialect/sql" ) const ( // Label holds the string label denoting the soracachefile type in the database. Label = "sora_cache_file" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldTaskID holds the string denoting the task_id field in the database. FieldTaskID = "task_id" // FieldAccountID holds the string denoting the account_id field in the database. FieldAccountID = "account_id" // FieldUserID holds the string denoting the user_id field in the database. FieldUserID = "user_id" // FieldMediaType holds the string denoting the media_type field in the database. FieldMediaType = "media_type" // FieldOriginalURL holds the string denoting the original_url field in the database. FieldOriginalURL = "original_url" // FieldCachePath holds the string denoting the cache_path field in the database. FieldCachePath = "cache_path" // FieldCacheURL holds the string denoting the cache_url field in the database. FieldCacheURL = "cache_url" // FieldSizeBytes holds the string denoting the size_bytes field in the database. FieldSizeBytes = "size_bytes" // FieldCreatedAt holds the string denoting the created_at field in the database. FieldCreatedAt = "created_at" // Table holds the table name of the soracachefile in the database. Table = "sora_cache_files" ) // Columns holds all SQL columns for soracachefile fields. var Columns = []string{ FieldID, FieldTaskID, FieldAccountID, FieldUserID, FieldMediaType, FieldOriginalURL, FieldCachePath, FieldCacheURL, FieldSizeBytes, 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 ( // TaskIDValidator is a validator for the "task_id" field. It is called by the builders before save. TaskIDValidator func(string) error // MediaTypeValidator is a validator for the "media_type" field. It is called by the builders before save. MediaTypeValidator func(string) error // DefaultSizeBytes holds the default value on creation for the "size_bytes" field. DefaultSizeBytes int64 // DefaultCreatedAt holds the default value on creation for the "created_at" field. DefaultCreatedAt func() time.Time ) // OrderOption defines the ordering options for the SoraCacheFile 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() } // ByTaskID orders the results by the task_id field. func ByTaskID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldTaskID, opts...).ToFunc() } // ByAccountID orders the results by the account_id field. func ByAccountID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldAccountID, opts...).ToFunc() } // ByUserID orders the results by the user_id field. func ByUserID(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUserID, opts...).ToFunc() } // ByMediaType orders the results by the media_type field. func ByMediaType(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldMediaType, opts...).ToFunc() } // ByOriginalURL orders the results by the original_url field. func ByOriginalURL(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldOriginalURL, opts...).ToFunc() } // ByCachePath orders the results by the cache_path field. func ByCachePath(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCachePath, opts...).ToFunc() } // ByCacheURL orders the results by the cache_url field. func ByCacheURL(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCacheURL, opts...).ToFunc() } // BySizeBytes orders the results by the size_bytes field. func BySizeBytes(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSizeBytes, opts...).ToFunc() } // ByCreatedAt orders the results by the created_at field. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() }