pcmt/ent/settings/settings.go
surtur 74546f996b
All checks were successful
continuous-integration/drone/push Build is passing
ent: add/extend entities, tests, validation
2023-08-19 04:52:15 +02:00

72 lines
2.1 KiB
Go

// Code generated by ent, DO NOT EDIT.
package settings
import (
"entgo.io/ent/dialect/sql"
"github.com/google/uuid"
)
const (
// Label holds the string label denoting the settings type in the database.
Label = "settings"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldHibpAPIKey holds the string denoting the hibp_api_key field in the database.
FieldHibpAPIKey = "hibp_api_key"
// FieldDehashedAPIKey holds the string denoting the dehashed_api_key field in the database.
FieldDehashedAPIKey = "dehashed_api_key"
// FieldSearches holds the string denoting the searches field in the database.
FieldSearches = "searches"
// Table holds the table name of the settings in the database.
Table = "settings"
)
// Columns holds all SQL columns for settings fields.
var Columns = []string{
FieldID,
FieldHibpAPIKey,
FieldDehashedAPIKey,
FieldSearches,
}
// 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 (
// DefaultSearches holds the default value on creation for the "searches" field.
DefaultSearches uint64
// DefaultID holds the default value on creation for the "id" field.
DefaultID func() uuid.UUID
)
// OrderOption defines the ordering options for the Settings 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()
}
// ByHibpAPIKey orders the results by the hibp_api_key field.
func ByHibpAPIKey(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHibpAPIKey, opts...).ToFunc()
}
// ByDehashedAPIKey orders the results by the dehashed_api_key field.
func ByDehashedAPIKey(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDehashedAPIKey, opts...).ToFunc()
}
// BySearches orders the results by the searches field.
func BySearches(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSearches, opts...).ToFunc()
}