Files
bj_power/bj_power_mes/ent/sysconfig/sysconfig.go
T

73 lines
2.1 KiB
Go
Raw Normal View History

// Code generated by ent, DO NOT EDIT.
package sysconfig
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the sysconfig type in the database.
Label = "sys_config"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldKey holds the string denoting the key field in the database.
FieldKey = "key"
// FieldValue holds the string denoting the value field in the database.
FieldValue = "value"
// FieldRemark holds the string denoting the remark field in the database.
FieldRemark = "remark"
// Table holds the table name of the sysconfig in the database.
Table = "sys_config"
)
// Columns holds all SQL columns for sysconfig fields.
var Columns = []string{
FieldID,
FieldKey,
FieldValue,
FieldRemark,
}
// 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 (
// KeyValidator is a validator for the "key" field. It is called by the builders before save.
KeyValidator func(string) error
// ValueValidator is a validator for the "value" field. It is called by the builders before save.
ValueValidator func(string) error
// RemarkValidator is a validator for the "remark" field. It is called by the builders before save.
RemarkValidator func(string) error
)
// OrderOption defines the ordering options for the SysConfig 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()
}
// ByKey orders the results by the key field.
func ByKey(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldKey, opts...).ToFunc()
}
// ByValue orders the results by the value field.
func ByValue(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldValue, opts...).ToFunc()
}
// ByRemark orders the results by the remark field.
func ByRemark(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRemark, opts...).ToFunc()
}