mirror of
https://github.com/versia-pub/versia-go.git
synced 2025-12-06 14:28:20 +01:00
61 lines
1.6 KiB
Go
61 lines
1.6 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package image
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the image type in the database.
|
|
Label = "image"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldURL holds the string denoting the url field in the database.
|
|
FieldURL = "url"
|
|
// FieldMimeType holds the string denoting the mimetype field in the database.
|
|
FieldMimeType = "mime_type"
|
|
// Table holds the table name of the image in the database.
|
|
Table = "images"
|
|
)
|
|
|
|
// Columns holds all SQL columns for image fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldURL,
|
|
FieldMimeType,
|
|
}
|
|
|
|
// 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 (
|
|
// URLValidator is a validator for the "url" field. It is called by the builders before save.
|
|
URLValidator func(string) error
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the Image 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()
|
|
}
|
|
|
|
// ByURL orders the results by the url field.
|
|
func ByURL(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldURL, opts...).ToFunc()
|
|
}
|
|
|
|
// ByMimeType orders the results by the mimeType field.
|
|
func ByMimeType(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldMimeType, opts...).ToFunc()
|
|
}
|