86 lines
2.6 KiB
Go
86 lines
2.6 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package wallet
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the wallet type in the database.
|
|
Label = "wallet"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "user_id"
|
|
// FieldBalance holds the string denoting the balance field in the database.
|
|
FieldBalance = "balance"
|
|
// FieldFrozenBalance holds the string denoting the frozen_balance field in the database.
|
|
FieldFrozenBalance = "frozen_balance"
|
|
// FieldVersion holds the string denoting the version field in the database.
|
|
FieldVersion = "version"
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
FieldUpdatedAt = "updated_at"
|
|
// Table holds the table name of the wallet in the database.
|
|
Table = "wallets"
|
|
)
|
|
|
|
// Columns holds all SQL columns for wallet fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldBalance,
|
|
FieldFrozenBalance,
|
|
FieldVersion,
|
|
FieldUpdatedAt,
|
|
}
|
|
|
|
// 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 (
|
|
// DefaultBalance holds the default value on creation for the "balance" field.
|
|
DefaultBalance decimal.Decimal
|
|
// DefaultFrozenBalance holds the default value on creation for the "frozen_balance" field.
|
|
DefaultFrozenBalance decimal.Decimal
|
|
// DefaultVersion holds the default value on creation for the "version" field.
|
|
DefaultVersion int
|
|
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
|
DefaultUpdatedAt func() time.Time
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the Wallet 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()
|
|
}
|
|
|
|
// ByBalance orders the results by the balance field.
|
|
func ByBalance(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldBalance, opts...).ToFunc()
|
|
}
|
|
|
|
// ByFrozenBalance orders the results by the frozen_balance field.
|
|
func ByFrozenBalance(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldFrozenBalance, opts...).ToFunc()
|
|
}
|
|
|
|
// ByVersion orders the results by the version field.
|
|
func ByVersion(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldVersion, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUpdatedAt orders the results by the updated_at field.
|
|
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
|
}
|