Files
MonkeyCode/backend/db/license/license.go
2025-08-07 22:04:00 +08:00

76 lines
2.1 KiB
Go

// Code generated by ent, DO NOT EDIT.
package license
import (
"time"
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the license type in the database.
Label = "license"
// 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"
// FieldData holds the string denoting the data field in the database.
FieldData = "data"
// FieldCode holds the string denoting the code field in the database.
FieldCode = "code"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the license in the database.
Table = "license"
)
// Columns holds all SQL columns for license fields.
var Columns = []string{
FieldID,
FieldType,
FieldData,
FieldCode,
FieldCreatedAt,
}
// 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 (
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
// IDValidator is a validator for the "id" field. It is called by the builders before save.
IDValidator func(int) error
)
// OrderOption defines the ordering options for the License 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()
}
// ByCode orders the results by the code field.
func ByCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCode, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}