| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- // Code generated by ent, DO NOT EDIT.
- package securitypolicykeyword
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
- // Label holds the string label denoting the securitypolicykeyword type in the database.
- Label = "security_policy_keyword"
- // FieldID holds the string denoting the id field in the database.
- FieldID = "id"
- // FieldCreatedAt holds the string denoting the created_at field in the database.
- FieldCreatedAt = "created_at"
- // FieldUpdatedAt holds the string denoting the updated_at field in the database.
- FieldUpdatedAt = "updated_at"
- // FieldDeletedAt holds the string denoting the deleted_at field in the database.
- FieldDeletedAt = "deleted_at"
- // FieldGroupID holds the string denoting the group_id field in the database.
- FieldGroupID = "group_id"
- // FieldKeyword holds the string denoting the keyword field in the database.
- FieldKeyword = "keyword"
- // FieldCategory holds the string denoting the category field in the database.
- FieldCategory = "category"
- // FieldEnabled holds the string denoting the enabled field in the database.
- FieldEnabled = "enabled"
- // EdgeGroup holds the string denoting the group edge name in mutations.
- EdgeGroup = "group"
- // Table holds the table name of the securitypolicykeyword in the database.
- Table = "security_policy_keywords"
- // GroupTable is the table that holds the group relation/edge.
- GroupTable = "security_policy_keywords"
- // GroupInverseTable is the table name for the Group entity.
- // It exists in this package in order to avoid circular dependency with the "group" package.
- GroupInverseTable = "groups"
- // GroupColumn is the table column denoting the group relation/edge.
- GroupColumn = "group_id"
- )
- // Columns holds all SQL columns for securitypolicykeyword fields.
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldDeletedAt,
- FieldGroupID,
- FieldKeyword,
- FieldCategory,
- FieldEnabled,
- }
- // 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
- }
- // Note that the variables below are initialized by the runtime
- // package on the initialization of the application. Therefore,
- // it should be imported in the main as follows:
- //
- // import _ "github.com/Wei-Shaw/sub2api/ent/runtime"
- var (
- Hooks [1]ent.Hook
- Interceptors [1]ent.Interceptor
- // DefaultCreatedAt holds the default value on creation for the "created_at" field.
- DefaultCreatedAt func() time.Time
- // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
- DefaultUpdatedAt func() time.Time
- // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
- UpdateDefaultUpdatedAt func() time.Time
- // KeywordValidator is a validator for the "keyword" field. It is called by the builders before save.
- KeywordValidator func(string) error
- // DefaultCategory holds the default value on creation for the "category" field.
- DefaultCategory string
- // CategoryValidator is a validator for the "category" field. It is called by the builders before save.
- CategoryValidator func(string) error
- // DefaultEnabled holds the default value on creation for the "enabled" field.
- DefaultEnabled bool
- )
- // OrderOption defines the ordering options for the SecurityPolicyKeyword 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()
- }
- // ByCreatedAt orders the results by the created_at field.
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
- }
- // ByUpdatedAt orders the results by the updated_at field.
- func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
- }
- // ByDeletedAt orders the results by the deleted_at field.
- func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
- }
- // ByGroupID orders the results by the group_id field.
- func ByGroupID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldGroupID, opts...).ToFunc()
- }
- // ByKeyword orders the results by the keyword field.
- func ByKeyword(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldKeyword, opts...).ToFunc()
- }
- // ByCategory orders the results by the category field.
- func ByCategory(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCategory, opts...).ToFunc()
- }
- // ByEnabled orders the results by the enabled field.
- func ByEnabled(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldEnabled, opts...).ToFunc()
- }
- // ByGroupField orders the results by group field.
- func ByGroupField(field string, opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newGroupStep(), sql.OrderByField(field, opts...))
- }
- }
- func newGroupStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(GroupInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, false, GroupTable, GroupColumn),
- )
- }
|