93 lines
2.7 KiB
Go
93 lines
2.7 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package contact
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the contact type in the database.
|
|
Label = "contact"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldType holds the string denoting the type field in the database.
|
|
FieldType = "type"
|
|
// FieldIcon holds the string denoting the icon field in the database.
|
|
FieldIcon = "icon"
|
|
// FieldURL holds the string denoting the url field in the database.
|
|
FieldURL = "url"
|
|
// FieldQrCode holds the string denoting the qr_code field in the database.
|
|
FieldQrCode = "qr_code"
|
|
// FieldHoverColor holds the string denoting the hover_color field in the database.
|
|
FieldHoverColor = "hover_color"
|
|
// FieldSortOrder holds the string denoting the sort_order field in the database.
|
|
FieldSortOrder = "sort_order"
|
|
// Table holds the table name of the contact in the database.
|
|
Table = "contacts"
|
|
)
|
|
|
|
// Columns holds all SQL columns for contact fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldType,
|
|
FieldIcon,
|
|
FieldURL,
|
|
FieldQrCode,
|
|
FieldHoverColor,
|
|
FieldSortOrder,
|
|
}
|
|
|
|
// 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 (
|
|
// DefaultSortOrder holds the default value on creation for the "sort_order" field.
|
|
DefaultSortOrder int
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the Contact 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()
|
|
}
|
|
|
|
// ByType orders the results by the type field.
|
|
func ByType(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldType, opts...).ToFunc()
|
|
}
|
|
|
|
// ByIcon orders the results by the icon field.
|
|
func ByIcon(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldIcon, opts...).ToFunc()
|
|
}
|
|
|
|
// ByURL orders the results by the url field.
|
|
func ByURL(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldURL, opts...).ToFunc()
|
|
}
|
|
|
|
// ByQrCode orders the results by the qr_code field.
|
|
func ByQrCode(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldQrCode, opts...).ToFunc()
|
|
}
|
|
|
|
// ByHoverColor orders the results by the hover_color field.
|
|
func ByHoverColor(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldHoverColor, opts...).ToFunc()
|
|
}
|
|
|
|
// BySortOrder orders the results by the sort_order field.
|
|
func BySortOrder(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldSortOrder, opts...).ToFunc()
|
|
}
|