mirror of
https://github.com/netbirdio/dex.git
synced 2026-05-22 18:43:53 -07:00
107 lines
3.6 KiB
Go
107 lines
3.6 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package password
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the password type in the database.
|
|
Label = "password"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldEmail holds the string denoting the email field in the database.
|
|
FieldEmail = "email"
|
|
// FieldHash holds the string denoting the hash field in the database.
|
|
FieldHash = "hash"
|
|
// FieldUsername holds the string denoting the username field in the database.
|
|
FieldUsername = "username"
|
|
// FieldName holds the string denoting the name field in the database.
|
|
FieldName = "name"
|
|
// FieldPreferredUsername holds the string denoting the preferred_username field in the database.
|
|
FieldPreferredUsername = "preferred_username"
|
|
// FieldEmailVerified holds the string denoting the email_verified field in the database.
|
|
FieldEmailVerified = "email_verified"
|
|
// FieldUserID holds the string denoting the user_id field in the database.
|
|
FieldUserID = "user_id"
|
|
// FieldGroups holds the string denoting the groups field in the database.
|
|
FieldGroups = "groups"
|
|
// Table holds the table name of the password in the database.
|
|
Table = "passwords"
|
|
)
|
|
|
|
// Columns holds all SQL columns for password fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldEmail,
|
|
FieldHash,
|
|
FieldUsername,
|
|
FieldName,
|
|
FieldPreferredUsername,
|
|
FieldEmailVerified,
|
|
FieldUserID,
|
|
FieldGroups,
|
|
}
|
|
|
|
// 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 (
|
|
// EmailValidator is a validator for the "email" field. It is called by the builders before save.
|
|
EmailValidator func(string) error
|
|
// UsernameValidator is a validator for the "username" field. It is called by the builders before save.
|
|
UsernameValidator func(string) error
|
|
// DefaultName holds the default value on creation for the "name" field.
|
|
DefaultName string
|
|
// DefaultPreferredUsername holds the default value on creation for the "preferred_username" field.
|
|
DefaultPreferredUsername string
|
|
// UserIDValidator is a validator for the "user_id" field. It is called by the builders before save.
|
|
UserIDValidator func(string) error
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the Password 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()
|
|
}
|
|
|
|
// ByEmail orders the results by the email field.
|
|
func ByEmail(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldEmail, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUsername orders the results by the username field.
|
|
func ByUsername(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUsername, opts...).ToFunc()
|
|
}
|
|
|
|
// ByName orders the results by the name field.
|
|
func ByName(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldName, opts...).ToFunc()
|
|
}
|
|
|
|
// ByPreferredUsername orders the results by the preferred_username field.
|
|
func ByPreferredUsername(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldPreferredUsername, opts...).ToFunc()
|
|
}
|
|
|
|
// ByEmailVerified orders the results by the email_verified field.
|
|
func ByEmailVerified(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldEmailVerified, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUserID orders the results by the user_id field.
|
|
func ByUserID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUserID, opts...).ToFunc()
|
|
}
|