TinySkin/db/ent/usertoken/usertoken.go
2023-09-03 17:00:10 +08:00

48 lines
1.2 KiB
Go

// Code generated by ent, DO NOT EDIT.
package usertoken
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the usertoken type in the database.
Label = "user_token"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldTokenID holds the string denoting the token_id field in the database.
FieldTokenID = "token_id"
// Table holds the table name of the usertoken in the database.
Table = "user_tokens"
)
// Columns holds all SQL columns for usertoken fields.
var Columns = []string{
FieldID,
FieldTokenID,
}
// 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
}
// OrderOption defines the ordering options for the UserToken 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()
}
// ByTokenID orders the results by the token_id field.
func ByTokenID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTokenID, opts...).ToFunc()
}