// Code generated by ent, DO NOT EDIT. package attachment import ( "time" "entgo.io/ent/dialect/sql" ) const ( // Label holds the string label denoting the attachment type in the database. Label = "attachment" // FieldID holds the string denoting the id field in the database. FieldID = "id" // FieldBizType holds the string denoting the biztype field in the database. FieldBizType = "biz_type" // FieldBizId holds the string denoting the bizid field in the database. FieldBizId = "biz_id" // FieldFileName holds the string denoting the filename field in the database. FieldFileName = "file_name" // FieldFilePath holds the string denoting the filepath field in the database. FieldFilePath = "file_path" // FieldFileSize holds the string denoting the filesize field in the database. FieldFileSize = "file_size" // FieldUploader holds the string denoting the uploader field in the database. FieldUploader = "uploader" // FieldCreatedAt holds the string denoting the createdat field in the database. FieldCreatedAt = "created_at" // Table holds the table name of the attachment in the database. Table = "attachment" ) // Columns holds all SQL columns for attachment fields. var Columns = []string{ FieldID, FieldBizType, FieldBizId, FieldFileName, FieldFilePath, FieldFileSize, FieldUploader, 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 ( // BizTypeValidator is a validator for the "bizType" field. It is called by the builders before save. BizTypeValidator func(string) error // BizIdValidator is a validator for the "bizId" field. It is called by the builders before save. BizIdValidator func(string) error // FileNameValidator is a validator for the "fileName" field. It is called by the builders before save. FileNameValidator func(string) error // FilePathValidator is a validator for the "filePath" field. It is called by the builders before save. FilePathValidator func(string) error // DefaultFileSize holds the default value on creation for the "fileSize" field. DefaultFileSize int // DefaultUploader holds the default value on creation for the "uploader" field. DefaultUploader string // UploaderValidator is a validator for the "uploader" field. It is called by the builders before save. UploaderValidator func(string) error // DefaultCreatedAt holds the default value on creation for the "createdAt" field. DefaultCreatedAt func() time.Time // IDValidator is a validator for the "id" field. It is called by the builders before save. IDValidator func(int) error ) // OrderOption defines the ordering options for the Attachment 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() } // ByBizType orders the results by the bizType field. func ByBizType(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBizType, opts...).ToFunc() } // ByBizId orders the results by the bizId field. func ByBizId(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldBizId, opts...).ToFunc() } // ByFileName orders the results by the fileName field. func ByFileName(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFileName, opts...).ToFunc() } // ByFilePath orders the results by the filePath field. func ByFilePath(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFilePath, opts...).ToFunc() } // ByFileSize orders the results by the fileSize field. func ByFileSize(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldFileSize, opts...).ToFunc() } // ByUploader orders the results by the uploader field. func ByUploader(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldUploader, opts...).ToFunc() } // ByCreatedAt orders the results by the createdAt field. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldCreatedAt, opts...).ToFunc() }