ent

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2023 License: MIT Imports: 29 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeAPI              = "API"
	TypeDepartment       = "Department"
	TypeDictionary       = "Dictionary"
	TypeDictionaryDetail = "DictionaryDetail"
	TypeMenu             = "Menu"
	TypeOauthProvider    = "OauthProvider"
	TypePosition         = "Position"
	TypeRole             = "Role"
	TypeToken            = "Token"
	TypeUser             = "User"
)

Variables

View Source
var DefaultAPIOrder = Desc(api.FieldID)

DefaultAPIOrder is the default ordering of API.

View Source
var DefaultDepartmentOrder = Desc(department.FieldID)

DefaultDepartmentOrder is the default ordering of Department.

View Source
var DefaultDictionaryDetailOrder = Desc(dictionarydetail.FieldID)

DefaultDictionaryDetailOrder is the default ordering of DictionaryDetail.

View Source
var DefaultDictionaryOrder = Desc(dictionary.FieldID)

DefaultDictionaryOrder is the default ordering of Dictionary.

View Source
var DefaultMenuOrder = Desc(menu.FieldID)

DefaultMenuOrder is the default ordering of Menu.

View Source
var DefaultOauthProviderOrder = Desc(oauthprovider.FieldID)

DefaultOauthProviderOrder is the default ordering of OauthProvider.

View Source
var DefaultPositionOrder = Desc(position.FieldID)

DefaultPositionOrder is the default ordering of Position.

View Source
var DefaultRoleOrder = Desc(role.FieldID)

DefaultRoleOrder is the default ordering of Role.

View Source
var DefaultTokenOrder = Desc(token.FieldID)

DefaultTokenOrder is the default ordering of Token.

View Source
var DefaultUserOrder = Desc(user.FieldID)

DefaultUserOrder is the default ordering of User.

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type API

type API struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// API path | API 路径
	Path string `json:"path,omitempty"`
	// API description | API 描述
	Description string `json:"description,omitempty"`
	// API group | API 分组
	APIGroup string `json:"api_group,omitempty"`
	// HTTP method | HTTP 请求类型
	Method string `json:"method,omitempty"`
	// Whether is required | 是否必选
	IsRequired bool `json:"is_required,omitempty"`
	// contains filtered or unexported fields
}

API is the model entity for the API schema.

func (*API) ExecContext added in v1.0.9

func (c *API) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*API) QueryContext added in v1.0.9

func (c *API) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*API) String

func (a *API) String() string

String implements the fmt.Stringer.

func (*API) Unwrap

func (a *API) Unwrap() *API

Unwrap unwraps the API entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*API) Update

func (a *API) Update() *APIUpdateOne

Update returns a builder for updating this API. Note that you need to call API.Unwrap() before calling this method if this API was returned from a transaction, and the transaction was committed or rolled back.

func (*API) Value added in v1.0.0

func (a *API) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the API. This includes values selected through modifiers, order, etc.

type APIClient

type APIClient struct {
	// contains filtered or unexported fields
}

APIClient is a client for the API schema.

func NewAPIClient

func NewAPIClient(c config) *APIClient

NewAPIClient returns a client for the API from the given config.

func (*APIClient) Create

func (c *APIClient) Create() *APICreate

Create returns a builder for creating a API entity.

func (*APIClient) CreateBulk

func (c *APIClient) CreateBulk(builders ...*APICreate) *APICreateBulk

CreateBulk returns a builder for creating a bulk of API entities.

func (*APIClient) Delete

func (c *APIClient) Delete() *APIDelete

Delete returns a delete builder for API.

func (*APIClient) DeleteOne

func (c *APIClient) DeleteOne(a *API) *APIDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*APIClient) DeleteOneID

func (c *APIClient) DeleteOneID(id uint64) *APIDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*APIClient) ExecContext added in v1.0.9

func (c *APIClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*APIClient) Get

func (c *APIClient) Get(ctx context.Context, id uint64) (*API, error)

Get returns a API entity by its id.

func (*APIClient) GetX

func (c *APIClient) GetX(ctx context.Context, id uint64) *API

GetX is like Get, but panics if an error occurs.

func (*APIClient) Hooks

func (c *APIClient) Hooks() []Hook

Hooks returns the client hooks.

func (*APIClient) Intercept

func (c *APIClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `api.Intercept(f(g(h())))`.

func (*APIClient) Interceptors

func (c *APIClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*APIClient) MapCreateBulk added in v1.1.5

func (c *APIClient) MapCreateBulk(slice any, setFunc func(*APICreate, int)) *APICreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*APIClient) Query

func (c *APIClient) Query() *APIQuery

Query returns a query builder for API.

func (*APIClient) QueryContext added in v1.0.9

func (c *APIClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*APIClient) Update

func (c *APIClient) Update() *APIUpdate

Update returns an update builder for API.

func (*APIClient) UpdateOne

func (c *APIClient) UpdateOne(a *API) *APIUpdateOne

UpdateOne returns an update builder for the given entity.

func (*APIClient) UpdateOneID

func (c *APIClient) UpdateOneID(id uint64) *APIUpdateOne

UpdateOneID returns an update builder for the given id.

func (*APIClient) Use

func (c *APIClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `api.Hooks(f(g(h())))`.

type APICreate

type APICreate struct {
	// contains filtered or unexported fields
}

APICreate is the builder for creating a API entity.

func (*APICreate) Exec

func (ac *APICreate) Exec(ctx context.Context) error

Exec executes the query.

func (*APICreate) ExecContext added in v1.0.9

func (c *APICreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*APICreate) ExecX

func (ac *APICreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*APICreate) Mutation

func (ac *APICreate) Mutation() *APIMutation

Mutation returns the APIMutation object of the builder.

func (*APICreate) QueryContext added in v1.0.9

func (c *APICreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*APICreate) Save

func (ac *APICreate) Save(ctx context.Context) (*API, error)

Save creates the API in the database.

func (*APICreate) SaveX

func (ac *APICreate) SaveX(ctx context.Context) *API

SaveX calls Save and panics if Save returns an error.

func (*APICreate) SetAPIGroup

func (ac *APICreate) SetAPIGroup(s string) *APICreate

SetAPIGroup sets the "api_group" field.

func (*APICreate) SetCreatedAt

func (ac *APICreate) SetCreatedAt(t time.Time) *APICreate

SetCreatedAt sets the "created_at" field.

func (*APICreate) SetDescription

func (ac *APICreate) SetDescription(s string) *APICreate

SetDescription sets the "description" field.

func (*APICreate) SetID

func (ac *APICreate) SetID(u uint64) *APICreate

SetID sets the "id" field.

func (*APICreate) SetIsRequired added in v1.0.14

func (ac *APICreate) SetIsRequired(b bool) *APICreate

SetIsRequired sets the "is_required" field.

func (*APICreate) SetMethod

func (ac *APICreate) SetMethod(s string) *APICreate

SetMethod sets the "method" field.

func (*APICreate) SetNillableCreatedAt

func (ac *APICreate) SetNillableCreatedAt(t *time.Time) *APICreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*APICreate) SetNillableIsRequired added in v1.0.14

func (ac *APICreate) SetNillableIsRequired(b *bool) *APICreate

SetNillableIsRequired sets the "is_required" field if the given value is not nil.

func (*APICreate) SetNillableMethod

func (ac *APICreate) SetNillableMethod(s *string) *APICreate

SetNillableMethod sets the "method" field if the given value is not nil.

func (*APICreate) SetNillableUpdatedAt

func (ac *APICreate) SetNillableUpdatedAt(t *time.Time) *APICreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*APICreate) SetNotNilAPIGroup added in v1.0.9

func (a *APICreate) SetNotNilAPIGroup(value *string) *APICreate

set field if value's pointer is not nil.

func (*APICreate) SetNotNilDescription added in v1.0.9

func (a *APICreate) SetNotNilDescription(value *string) *APICreate

set field if value's pointer is not nil.

func (*APICreate) SetNotNilIsRequired added in v1.0.14

func (a *APICreate) SetNotNilIsRequired(value *bool) *APICreate

set field if value's pointer is not nil.

func (*APICreate) SetNotNilMethod added in v1.0.9

func (a *APICreate) SetNotNilMethod(value *string) *APICreate

set field if value's pointer is not nil.

func (*APICreate) SetNotNilPath added in v1.0.9

func (a *APICreate) SetNotNilPath(value *string) *APICreate

set field if value's pointer is not nil.

func (*APICreate) SetNotNilUpdatedAt added in v1.0.9

func (a *APICreate) SetNotNilUpdatedAt(value *time.Time) *APICreate

set field if value's pointer is not nil.

func (*APICreate) SetPath

func (ac *APICreate) SetPath(s string) *APICreate

SetPath sets the "path" field.

func (*APICreate) SetUpdatedAt

func (ac *APICreate) SetUpdatedAt(t time.Time) *APICreate

SetUpdatedAt sets the "updated_at" field.

type APICreateBulk

type APICreateBulk struct {
	// contains filtered or unexported fields
}

APICreateBulk is the builder for creating many API entities in bulk.

func (*APICreateBulk) Exec

func (acb *APICreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*APICreateBulk) ExecContext added in v1.0.9

func (c *APICreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*APICreateBulk) ExecX

func (acb *APICreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*APICreateBulk) QueryContext added in v1.0.9

func (c *APICreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*APICreateBulk) Save

func (acb *APICreateBulk) Save(ctx context.Context) ([]*API, error)

Save creates the API entities in the database.

func (*APICreateBulk) SaveX

func (acb *APICreateBulk) SaveX(ctx context.Context) []*API

SaveX is like Save, but panics if an error occurs.

type APIDelete

type APIDelete struct {
	// contains filtered or unexported fields
}

APIDelete is the builder for deleting a API entity.

func (*APIDelete) Exec

func (ad *APIDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*APIDelete) ExecContext added in v1.0.9

func (c *APIDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*APIDelete) ExecX

func (ad *APIDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*APIDelete) QueryContext added in v1.0.9

func (c *APIDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*APIDelete) Where

func (ad *APIDelete) Where(ps ...predicate.API) *APIDelete

Where appends a list predicates to the APIDelete builder.

type APIDeleteOne

type APIDeleteOne struct {
	// contains filtered or unexported fields
}

APIDeleteOne is the builder for deleting a single API entity.

func (*APIDeleteOne) Exec

func (ado *APIDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*APIDeleteOne) ExecX

func (ado *APIDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*APIDeleteOne) Where

func (ado *APIDeleteOne) Where(ps ...predicate.API) *APIDeleteOne

Where appends a list predicates to the APIDelete builder.

type APIGroupBy

type APIGroupBy struct {
	// contains filtered or unexported fields
}

APIGroupBy is the group-by builder for API entities.

func (*APIGroupBy) Aggregate

func (agb *APIGroupBy) Aggregate(fns ...AggregateFunc) *APIGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*APIGroupBy) Bool

func (s *APIGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*APIGroupBy) BoolX

func (s *APIGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*APIGroupBy) Bools

func (s *APIGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*APIGroupBy) BoolsX

func (s *APIGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*APIGroupBy) Float64

func (s *APIGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*APIGroupBy) Float64X

func (s *APIGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*APIGroupBy) Float64s

func (s *APIGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*APIGroupBy) Float64sX

func (s *APIGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*APIGroupBy) Int

func (s *APIGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*APIGroupBy) IntX

func (s *APIGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*APIGroupBy) Ints

func (s *APIGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*APIGroupBy) IntsX

func (s *APIGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*APIGroupBy) Scan

func (agb *APIGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*APIGroupBy) ScanX

func (s *APIGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*APIGroupBy) String

func (s *APIGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*APIGroupBy) StringX

func (s *APIGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*APIGroupBy) Strings

func (s *APIGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*APIGroupBy) StringsX

func (s *APIGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type APIMutation

type APIMutation struct {
	// contains filtered or unexported fields
}

APIMutation represents an operation that mutates the API nodes in the graph.

func (*APIMutation) APIGroup

func (m *APIMutation) APIGroup() (r string, exists bool)

APIGroup returns the value of the "api_group" field in the mutation.

func (*APIMutation) AddField

func (m *APIMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*APIMutation) AddedEdges

func (m *APIMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*APIMutation) AddedField

func (m *APIMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*APIMutation) AddedFields

func (m *APIMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*APIMutation) AddedIDs

func (m *APIMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*APIMutation) ClearEdge

func (m *APIMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*APIMutation) ClearField

func (m *APIMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*APIMutation) ClearedEdges

func (m *APIMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*APIMutation) ClearedFields

func (m *APIMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (APIMutation) Client

func (m APIMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*APIMutation) CreatedAt

func (m *APIMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*APIMutation) Description

func (m *APIMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*APIMutation) EdgeCleared

func (m *APIMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*APIMutation) ExecContext added in v1.0.9

func (c *APIMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*APIMutation) Field

func (m *APIMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*APIMutation) FieldCleared

func (m *APIMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*APIMutation) Fields

func (m *APIMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*APIMutation) ID

func (m *APIMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*APIMutation) IDs

func (m *APIMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*APIMutation) IsRequired added in v1.0.14

func (m *APIMutation) IsRequired() (r bool, exists bool)

IsRequired returns the value of the "is_required" field in the mutation.

func (*APIMutation) Method

func (m *APIMutation) Method() (r string, exists bool)

Method returns the value of the "method" field in the mutation.

func (*APIMutation) OldAPIGroup

func (m *APIMutation) OldAPIGroup(ctx context.Context) (v string, err error)

OldAPIGroup returns the old "api_group" field's value of the API entity. If the API object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*APIMutation) OldCreatedAt

func (m *APIMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the API entity. If the API object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*APIMutation) OldDescription

func (m *APIMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the API entity. If the API object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*APIMutation) OldField

func (m *APIMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*APIMutation) OldIsRequired added in v1.0.14

func (m *APIMutation) OldIsRequired(ctx context.Context) (v bool, err error)

OldIsRequired returns the old "is_required" field's value of the API entity. If the API object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*APIMutation) OldMethod

func (m *APIMutation) OldMethod(ctx context.Context) (v string, err error)

OldMethod returns the old "method" field's value of the API entity. If the API object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*APIMutation) OldPath

func (m *APIMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the API entity. If the API object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*APIMutation) OldUpdatedAt

func (m *APIMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the API entity. If the API object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*APIMutation) Op

func (m *APIMutation) Op() Op

Op returns the operation name.

func (*APIMutation) Path

func (m *APIMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*APIMutation) QueryContext added in v1.0.9

func (c *APIMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*APIMutation) RemovedEdges

func (m *APIMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*APIMutation) RemovedIDs

func (m *APIMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*APIMutation) ResetAPIGroup

func (m *APIMutation) ResetAPIGroup()

ResetAPIGroup resets all changes to the "api_group" field.

func (*APIMutation) ResetCreatedAt

func (m *APIMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*APIMutation) ResetDescription

func (m *APIMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*APIMutation) ResetEdge

func (m *APIMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*APIMutation) ResetField

func (m *APIMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*APIMutation) ResetIsRequired added in v1.0.14

func (m *APIMutation) ResetIsRequired()

ResetIsRequired resets all changes to the "is_required" field.

func (*APIMutation) ResetMethod

func (m *APIMutation) ResetMethod()

ResetMethod resets all changes to the "method" field.

func (*APIMutation) ResetPath

func (m *APIMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*APIMutation) ResetUpdatedAt

func (m *APIMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*APIMutation) SetAPIGroup

func (m *APIMutation) SetAPIGroup(s string)

SetAPIGroup sets the "api_group" field.

func (*APIMutation) SetCreatedAt

func (m *APIMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*APIMutation) SetDescription

func (m *APIMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*APIMutation) SetField

func (m *APIMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*APIMutation) SetID

func (m *APIMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of API entities.

func (*APIMutation) SetIsRequired added in v1.0.14

func (m *APIMutation) SetIsRequired(b bool)

SetIsRequired sets the "is_required" field.

func (*APIMutation) SetMethod

func (m *APIMutation) SetMethod(s string)

SetMethod sets the "method" field.

func (*APIMutation) SetOp

func (m *APIMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*APIMutation) SetPath

func (m *APIMutation) SetPath(s string)

SetPath sets the "path" field.

func (*APIMutation) SetUpdatedAt

func (m *APIMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (APIMutation) Tx

func (m APIMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*APIMutation) Type

func (m *APIMutation) Type() string

Type returns the node type of this mutation (API).

func (*APIMutation) UpdatedAt

func (m *APIMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*APIMutation) Where

func (m *APIMutation) Where(ps ...predicate.API)

Where appends a list predicates to the APIMutation builder.

func (*APIMutation) WhereP

func (m *APIMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the APIMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type APIPageList

type APIPageList struct {
	List        []*API       `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

APIPageList is API PageList result.

type APIPager

type APIPager struct {
	Order  api.OrderOption
	Filter func(*APIQuery) (*APIQuery, error)
}

func (*APIPager) ApplyFilter

func (p *APIPager) ApplyFilter(query *APIQuery) (*APIQuery, error)

type APIPaginateOption

type APIPaginateOption func(*APIPager)

APIPaginateOption enables pagination customization.

type APIQuery

type APIQuery struct {
	// contains filtered or unexported fields
}

APIQuery is the builder for querying API entities.

func (*APIQuery) Aggregate

func (aq *APIQuery) Aggregate(fns ...AggregateFunc) *APISelect

Aggregate returns a APISelect configured with the given aggregations.

func (*APIQuery) All

func (aq *APIQuery) All(ctx context.Context) ([]*API, error)

All executes the query and returns a list of APIs.

func (*APIQuery) AllX

func (aq *APIQuery) AllX(ctx context.Context) []*API

AllX is like All, but panics if an error occurs.

func (*APIQuery) Clone

func (aq *APIQuery) Clone() *APIQuery

Clone returns a duplicate of the APIQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*APIQuery) Count

func (aq *APIQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*APIQuery) CountX

func (aq *APIQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*APIQuery) ExecContext added in v1.0.9

func (c *APIQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*APIQuery) Exist

func (aq *APIQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*APIQuery) ExistX

func (aq *APIQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*APIQuery) First

func (aq *APIQuery) First(ctx context.Context) (*API, error)

First returns the first API entity from the query. Returns a *NotFoundError when no API was found.

func (*APIQuery) FirstID

func (aq *APIQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first API ID from the query. Returns a *NotFoundError when no API ID was found.

func (*APIQuery) FirstIDX

func (aq *APIQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*APIQuery) FirstX

func (aq *APIQuery) FirstX(ctx context.Context) *API

FirstX is like First, but panics if an error occurs.

func (*APIQuery) GroupBy

func (aq *APIQuery) GroupBy(field string, fields ...string) *APIGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.API.Query().
	GroupBy(api.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*APIQuery) IDs

func (aq *APIQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of API IDs.

func (*APIQuery) IDsX

func (aq *APIQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*APIQuery) Limit

func (aq *APIQuery) Limit(limit int) *APIQuery

Limit the number of records to be returned by this query.

func (*APIQuery) Offset

func (aq *APIQuery) Offset(offset int) *APIQuery

Offset to start from.

func (*APIQuery) Only

func (aq *APIQuery) Only(ctx context.Context) (*API, error)

Only returns a single API entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one API entity is found. Returns a *NotFoundError when no API entities are found.

func (*APIQuery) OnlyID

func (aq *APIQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only API ID in the query. Returns a *NotSingularError when more than one API ID is found. Returns a *NotFoundError when no entities are found.

func (*APIQuery) OnlyIDX

func (aq *APIQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*APIQuery) OnlyX

func (aq *APIQuery) OnlyX(ctx context.Context) *API

OnlyX is like Only, but panics if an error occurs.

func (*APIQuery) Order

func (aq *APIQuery) Order(o ...api.OrderOption) *APIQuery

Order specifies how the records should be ordered.

func (*APIQuery) Page

func (a *APIQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...APIPaginateOption,
) (*APIPageList, error)

func (*APIQuery) QueryContext added in v1.0.9

func (c *APIQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*APIQuery) Select

func (aq *APIQuery) Select(fields ...string) *APISelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.API.Query().
	Select(api.FieldCreatedAt).
	Scan(ctx, &v)

func (*APIQuery) Unique

func (aq *APIQuery) Unique(unique bool) *APIQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*APIQuery) Where

func (aq *APIQuery) Where(ps ...predicate.API) *APIQuery

Where adds a new predicate for the APIQuery builder.

type APISelect

type APISelect struct {
	*APIQuery
	// contains filtered or unexported fields
}

APISelect is the builder for selecting fields of API entities.

func (*APISelect) Aggregate

func (as *APISelect) Aggregate(fns ...AggregateFunc) *APISelect

Aggregate adds the given aggregation functions to the selector query.

func (*APISelect) Bool

func (s *APISelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*APISelect) BoolX

func (s *APISelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*APISelect) Bools

func (s *APISelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*APISelect) BoolsX

func (s *APISelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (APISelect) ExecContext added in v1.0.9

func (c APISelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*APISelect) Float64

func (s *APISelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*APISelect) Float64X

func (s *APISelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*APISelect) Float64s

func (s *APISelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*APISelect) Float64sX

func (s *APISelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*APISelect) Int

func (s *APISelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*APISelect) IntX

func (s *APISelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*APISelect) Ints

func (s *APISelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*APISelect) IntsX

func (s *APISelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (APISelect) QueryContext added in v1.0.9

func (c APISelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*APISelect) Scan

func (as *APISelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*APISelect) ScanX

func (s *APISelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*APISelect) String

func (s *APISelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*APISelect) StringX

func (s *APISelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*APISelect) Strings

func (s *APISelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*APISelect) StringsX

func (s *APISelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type APIUpdate

type APIUpdate struct {
	// contains filtered or unexported fields
}

APIUpdate is the builder for updating API entities.

func (*APIUpdate) Exec

func (au *APIUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*APIUpdate) ExecContext added in v1.0.9

func (c *APIUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*APIUpdate) ExecX

func (au *APIUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*APIUpdate) Mutation

func (au *APIUpdate) Mutation() *APIMutation

Mutation returns the APIMutation object of the builder.

func (*APIUpdate) QueryContext added in v1.0.9

func (c *APIUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*APIUpdate) Save

func (au *APIUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*APIUpdate) SaveX

func (au *APIUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*APIUpdate) SetAPIGroup

func (au *APIUpdate) SetAPIGroup(s string) *APIUpdate

SetAPIGroup sets the "api_group" field.

func (*APIUpdate) SetDescription

func (au *APIUpdate) SetDescription(s string) *APIUpdate

SetDescription sets the "description" field.

func (*APIUpdate) SetIsRequired added in v1.0.14

func (au *APIUpdate) SetIsRequired(b bool) *APIUpdate

SetIsRequired sets the "is_required" field.

func (*APIUpdate) SetMethod

func (au *APIUpdate) SetMethod(s string) *APIUpdate

SetMethod sets the "method" field.

func (*APIUpdate) SetNillableAPIGroup added in v1.2.3

func (au *APIUpdate) SetNillableAPIGroup(s *string) *APIUpdate

SetNillableAPIGroup sets the "api_group" field if the given value is not nil.

func (*APIUpdate) SetNillableDescription added in v1.2.3

func (au *APIUpdate) SetNillableDescription(s *string) *APIUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*APIUpdate) SetNillableIsRequired added in v1.0.14

func (au *APIUpdate) SetNillableIsRequired(b *bool) *APIUpdate

SetNillableIsRequired sets the "is_required" field if the given value is not nil.

func (*APIUpdate) SetNillableMethod

func (au *APIUpdate) SetNillableMethod(s *string) *APIUpdate

SetNillableMethod sets the "method" field if the given value is not nil.

func (*APIUpdate) SetNillablePath added in v1.2.3

func (au *APIUpdate) SetNillablePath(s *string) *APIUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*APIUpdate) SetNotEmptyAPIGroup

func (a *APIUpdate) SetNotEmptyAPIGroup(value string) *APIUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*APIUpdate) SetNotEmptyDescription

func (a *APIUpdate) SetNotEmptyDescription(value string) *APIUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*APIUpdate) SetNotEmptyMethod

func (a *APIUpdate) SetNotEmptyMethod(value string) *APIUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*APIUpdate) SetNotEmptyPath

func (a *APIUpdate) SetNotEmptyPath(value string) *APIUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*APIUpdate) SetNotNilAPIGroup added in v1.0.9

func (a *APIUpdate) SetNotNilAPIGroup(value *string) *APIUpdate

set field if value's pointer is not nil.

func (*APIUpdate) SetNotNilDescription added in v1.0.9

func (a *APIUpdate) SetNotNilDescription(value *string) *APIUpdate

set field if value's pointer is not nil.

func (*APIUpdate) SetNotNilIsRequired added in v1.0.14

func (a *APIUpdate) SetNotNilIsRequired(value *bool) *APIUpdate

set field if value's pointer is not nil.

func (*APIUpdate) SetNotNilMethod added in v1.0.9

func (a *APIUpdate) SetNotNilMethod(value *string) *APIUpdate

set field if value's pointer is not nil.

func (*APIUpdate) SetNotNilPath added in v1.0.9

func (a *APIUpdate) SetNotNilPath(value *string) *APIUpdate

set field if value's pointer is not nil.

func (*APIUpdate) SetNotNilUpdatedAt added in v1.0.9

func (a *APIUpdate) SetNotNilUpdatedAt(value *time.Time) *APIUpdate

set field if value's pointer is not nil.

func (*APIUpdate) SetPath

func (au *APIUpdate) SetPath(s string) *APIUpdate

SetPath sets the "path" field.

func (*APIUpdate) SetUpdatedAt

func (au *APIUpdate) SetUpdatedAt(t time.Time) *APIUpdate

SetUpdatedAt sets the "updated_at" field.

func (*APIUpdate) Where

func (au *APIUpdate) Where(ps ...predicate.API) *APIUpdate

Where appends a list predicates to the APIUpdate builder.

type APIUpdateOne

type APIUpdateOne struct {
	// contains filtered or unexported fields
}

APIUpdateOne is the builder for updating a single API entity.

func (*APIUpdateOne) Exec

func (auo *APIUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*APIUpdateOne) ExecContext added in v1.0.9

func (c *APIUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*APIUpdateOne) ExecX

func (auo *APIUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*APIUpdateOne) Mutation

func (auo *APIUpdateOne) Mutation() *APIMutation

Mutation returns the APIMutation object of the builder.

func (*APIUpdateOne) QueryContext added in v1.0.9

func (c *APIUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*APIUpdateOne) Save

func (auo *APIUpdateOne) Save(ctx context.Context) (*API, error)

Save executes the query and returns the updated API entity.

func (*APIUpdateOne) SaveX

func (auo *APIUpdateOne) SaveX(ctx context.Context) *API

SaveX is like Save, but panics if an error occurs.

func (*APIUpdateOne) Select

func (auo *APIUpdateOne) Select(field string, fields ...string) *APIUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*APIUpdateOne) SetAPIGroup

func (auo *APIUpdateOne) SetAPIGroup(s string) *APIUpdateOne

SetAPIGroup sets the "api_group" field.

func (*APIUpdateOne) SetDescription

func (auo *APIUpdateOne) SetDescription(s string) *APIUpdateOne

SetDescription sets the "description" field.

func (*APIUpdateOne) SetIsRequired added in v1.0.14

func (auo *APIUpdateOne) SetIsRequired(b bool) *APIUpdateOne

SetIsRequired sets the "is_required" field.

func (*APIUpdateOne) SetMethod

func (auo *APIUpdateOne) SetMethod(s string) *APIUpdateOne

SetMethod sets the "method" field.

func (*APIUpdateOne) SetNillableAPIGroup added in v1.2.3

func (auo *APIUpdateOne) SetNillableAPIGroup(s *string) *APIUpdateOne

SetNillableAPIGroup sets the "api_group" field if the given value is not nil.

func (*APIUpdateOne) SetNillableDescription added in v1.2.3

func (auo *APIUpdateOne) SetNillableDescription(s *string) *APIUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*APIUpdateOne) SetNillableIsRequired added in v1.0.14

func (auo *APIUpdateOne) SetNillableIsRequired(b *bool) *APIUpdateOne

SetNillableIsRequired sets the "is_required" field if the given value is not nil.

func (*APIUpdateOne) SetNillableMethod

func (auo *APIUpdateOne) SetNillableMethod(s *string) *APIUpdateOne

SetNillableMethod sets the "method" field if the given value is not nil.

func (*APIUpdateOne) SetNillablePath added in v1.2.3

func (auo *APIUpdateOne) SetNillablePath(s *string) *APIUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*APIUpdateOne) SetNotEmptyAPIGroup

func (a *APIUpdateOne) SetNotEmptyAPIGroup(value string) *APIUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*APIUpdateOne) SetNotEmptyDescription

func (a *APIUpdateOne) SetNotEmptyDescription(value string) *APIUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*APIUpdateOne) SetNotEmptyMethod

func (a *APIUpdateOne) SetNotEmptyMethod(value string) *APIUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*APIUpdateOne) SetNotEmptyPath

func (a *APIUpdateOne) SetNotEmptyPath(value string) *APIUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*APIUpdateOne) SetNotNilAPIGroup added in v1.0.9

func (a *APIUpdateOne) SetNotNilAPIGroup(value *string) *APIUpdateOne

set field if value's pointer is not nil.

func (*APIUpdateOne) SetNotNilDescription added in v1.0.9

func (a *APIUpdateOne) SetNotNilDescription(value *string) *APIUpdateOne

set field if value's pointer is not nil.

func (*APIUpdateOne) SetNotNilIsRequired added in v1.0.14

func (a *APIUpdateOne) SetNotNilIsRequired(value *bool) *APIUpdateOne

set field if value's pointer is not nil.

func (*APIUpdateOne) SetNotNilMethod added in v1.0.9

func (a *APIUpdateOne) SetNotNilMethod(value *string) *APIUpdateOne

set field if value's pointer is not nil.

func (*APIUpdateOne) SetNotNilPath added in v1.0.9

func (a *APIUpdateOne) SetNotNilPath(value *string) *APIUpdateOne

set field if value's pointer is not nil.

func (*APIUpdateOne) SetNotNilUpdatedAt added in v1.0.9

func (a *APIUpdateOne) SetNotNilUpdatedAt(value *time.Time) *APIUpdateOne

set field if value's pointer is not nil.

func (*APIUpdateOne) SetPath

func (auo *APIUpdateOne) SetPath(s string) *APIUpdateOne

SetPath sets the "path" field.

func (*APIUpdateOne) SetUpdatedAt

func (auo *APIUpdateOne) SetUpdatedAt(t time.Time) *APIUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*APIUpdateOne) Where

func (auo *APIUpdateOne) Where(ps ...predicate.API) *APIUpdateOne

Where appends a list predicates to the APIUpdate builder.

type APIs

type APIs []*API

APIs is a parsable slice of API.

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// API is the client for interacting with the API builders.
	API *APIClient
	// Department is the client for interacting with the Department builders.
	Department *DepartmentClient
	// Dictionary is the client for interacting with the Dictionary builders.
	Dictionary *DictionaryClient
	// DictionaryDetail is the client for interacting with the DictionaryDetail builders.
	DictionaryDetail *DictionaryDetailClient
	// Menu is the client for interacting with the Menu builders.
	Menu *MenuClient
	// OauthProvider is the client for interacting with the OauthProvider builders.
	OauthProvider *OauthProviderClient
	// Position is the client for interacting with the Position builders.
	Position *PositionClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// Token is the client for interacting with the Token builders.
	Token *TokenClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	API.
	Query().
	Count(ctx)

func (*Client) ExecContext added in v1.0.9

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) QueryContext added in v1.0.9

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

type ConstraintError struct {
	// contains filtered or unexported fields
}

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Department

type Department struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Sort Number | 排序编号
	Sort uint32 `json:"sort,omitempty"`
	// Department name | 部门名称
	Name string `json:"name,omitempty"`
	// Parents' IDs | 父级列表
	Ancestors string `json:"ancestors,omitempty"`
	// Department leader | 部门负责人
	Leader string `json:"leader,omitempty"`
	// Leader's phone number | 负责人电话
	Phone string `json:"phone,omitempty"`
	// Leader's email | 部门负责人电子邮箱
	Email string `json:"email,omitempty"`
	// Remark | 备注
	Remark string `json:"remark,omitempty"`
	// Parent department ID | 父级部门ID
	ParentID uint64 `json:"parent_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DepartmentQuery when eager-loading is set.
	Edges DepartmentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Department is the model entity for the Department schema.

func (*Department) ExecContext added in v1.0.9

func (c *Department) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Department) QueryChildren

func (d *Department) QueryChildren() *DepartmentQuery

QueryChildren queries the "children" edge of the Department entity.

func (*Department) QueryContext added in v1.0.9

func (c *Department) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Department) QueryParent

func (d *Department) QueryParent() *DepartmentQuery

QueryParent queries the "parent" edge of the Department entity.

func (*Department) QueryUsers

func (d *Department) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Department entity.

func (*Department) String

func (d *Department) String() string

String implements the fmt.Stringer.

func (*Department) Unwrap

func (d *Department) Unwrap() *Department

Unwrap unwraps the Department entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Department) Update

func (d *Department) Update() *DepartmentUpdateOne

Update returns a builder for updating this Department. Note that you need to call Department.Unwrap() before calling this method if this Department was returned from a transaction, and the transaction was committed or rolled back.

func (*Department) Value added in v1.0.0

func (d *Department) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Department. This includes values selected through modifiers, order, etc.

type DepartmentClient

type DepartmentClient struct {
	// contains filtered or unexported fields
}

DepartmentClient is a client for the Department schema.

func NewDepartmentClient

func NewDepartmentClient(c config) *DepartmentClient

NewDepartmentClient returns a client for the Department from the given config.

func (*DepartmentClient) Create

func (c *DepartmentClient) Create() *DepartmentCreate

Create returns a builder for creating a Department entity.

func (*DepartmentClient) CreateBulk

func (c *DepartmentClient) CreateBulk(builders ...*DepartmentCreate) *DepartmentCreateBulk

CreateBulk returns a builder for creating a bulk of Department entities.

func (*DepartmentClient) Delete

func (c *DepartmentClient) Delete() *DepartmentDelete

Delete returns a delete builder for Department.

func (*DepartmentClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DepartmentClient) DeleteOneID

func (c *DepartmentClient) DeleteOneID(id uint64) *DepartmentDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*DepartmentClient) ExecContext added in v1.0.9

func (c *DepartmentClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DepartmentClient) Get

func (c *DepartmentClient) Get(ctx context.Context, id uint64) (*Department, error)

Get returns a Department entity by its id.

func (*DepartmentClient) GetX

func (c *DepartmentClient) GetX(ctx context.Context, id uint64) *Department

GetX is like Get, but panics if an error occurs.

func (*DepartmentClient) Hooks

func (c *DepartmentClient) Hooks() []Hook

Hooks returns the client hooks.

func (*DepartmentClient) Intercept

func (c *DepartmentClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `department.Intercept(f(g(h())))`.

func (*DepartmentClient) Interceptors

func (c *DepartmentClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*DepartmentClient) MapCreateBulk added in v1.1.5

func (c *DepartmentClient) MapCreateBulk(slice any, setFunc func(*DepartmentCreate, int)) *DepartmentCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*DepartmentClient) Query

func (c *DepartmentClient) Query() *DepartmentQuery

Query returns a query builder for Department.

func (*DepartmentClient) QueryChildren

func (c *DepartmentClient) QueryChildren(d *Department) *DepartmentQuery

QueryChildren queries the children edge of a Department.

func (*DepartmentClient) QueryContext added in v1.0.9

func (c *DepartmentClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DepartmentClient) QueryParent

func (c *DepartmentClient) QueryParent(d *Department) *DepartmentQuery

QueryParent queries the parent edge of a Department.

func (*DepartmentClient) QueryUsers

func (c *DepartmentClient) QueryUsers(d *Department) *UserQuery

QueryUsers queries the users edge of a Department.

func (*DepartmentClient) Update

func (c *DepartmentClient) Update() *DepartmentUpdate

Update returns an update builder for Department.

func (*DepartmentClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DepartmentClient) UpdateOneID

func (c *DepartmentClient) UpdateOneID(id uint64) *DepartmentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DepartmentClient) Use

func (c *DepartmentClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `department.Hooks(f(g(h())))`.

type DepartmentCreate

type DepartmentCreate struct {
	// contains filtered or unexported fields
}

DepartmentCreate is the builder for creating a Department entity.

func (*DepartmentCreate) AddChildIDs

func (dc *DepartmentCreate) AddChildIDs(ids ...uint64) *DepartmentCreate

AddChildIDs adds the "children" edge to the Department entity by IDs.

func (*DepartmentCreate) AddChildren

func (dc *DepartmentCreate) AddChildren(d ...*Department) *DepartmentCreate

AddChildren adds the "children" edges to the Department entity.

func (*DepartmentCreate) AddUserIDs

func (dc *DepartmentCreate) AddUserIDs(ids ...uuid.UUID) *DepartmentCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*DepartmentCreate) AddUsers

func (dc *DepartmentCreate) AddUsers(u ...*User) *DepartmentCreate

AddUsers adds the "users" edges to the User entity.

func (*DepartmentCreate) Exec

func (dc *DepartmentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DepartmentCreate) ExecContext added in v1.0.9

func (c *DepartmentCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DepartmentCreate) ExecX

func (dc *DepartmentCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentCreate) Mutation

func (dc *DepartmentCreate) Mutation() *DepartmentMutation

Mutation returns the DepartmentMutation object of the builder.

func (*DepartmentCreate) QueryContext added in v1.0.9

func (c *DepartmentCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DepartmentCreate) Save

func (dc *DepartmentCreate) Save(ctx context.Context) (*Department, error)

Save creates the Department in the database.

func (*DepartmentCreate) SaveX

func (dc *DepartmentCreate) SaveX(ctx context.Context) *Department

SaveX calls Save and panics if Save returns an error.

func (*DepartmentCreate) SetAncestors

func (dc *DepartmentCreate) SetAncestors(s string) *DepartmentCreate

SetAncestors sets the "ancestors" field.

func (*DepartmentCreate) SetCreatedAt

func (dc *DepartmentCreate) SetCreatedAt(t time.Time) *DepartmentCreate

SetCreatedAt sets the "created_at" field.

func (*DepartmentCreate) SetEmail

func (dc *DepartmentCreate) SetEmail(s string) *DepartmentCreate

SetEmail sets the "email" field.

func (*DepartmentCreate) SetID

SetID sets the "id" field.

func (*DepartmentCreate) SetLeader

func (dc *DepartmentCreate) SetLeader(s string) *DepartmentCreate

SetLeader sets the "leader" field.

func (*DepartmentCreate) SetName

func (dc *DepartmentCreate) SetName(s string) *DepartmentCreate

SetName sets the "name" field.

func (*DepartmentCreate) SetNillableAncestors added in v1.0.13

func (dc *DepartmentCreate) SetNillableAncestors(s *string) *DepartmentCreate

SetNillableAncestors sets the "ancestors" field if the given value is not nil.

func (*DepartmentCreate) SetNillableCreatedAt

func (dc *DepartmentCreate) SetNillableCreatedAt(t *time.Time) *DepartmentCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*DepartmentCreate) SetNillableParentID

func (dc *DepartmentCreate) SetNillableParentID(u *uint64) *DepartmentCreate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*DepartmentCreate) SetNillableRemark added in v1.0.13

func (dc *DepartmentCreate) SetNillableRemark(s *string) *DepartmentCreate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*DepartmentCreate) SetNillableSort

func (dc *DepartmentCreate) SetNillableSort(u *uint32) *DepartmentCreate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*DepartmentCreate) SetNillableStatus

func (dc *DepartmentCreate) SetNillableStatus(u *uint8) *DepartmentCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*DepartmentCreate) SetNillableUpdatedAt

func (dc *DepartmentCreate) SetNillableUpdatedAt(t *time.Time) *DepartmentCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*DepartmentCreate) SetNotNilAncestors added in v1.0.9

func (d *DepartmentCreate) SetNotNilAncestors(value *string) *DepartmentCreate

set field if value's pointer is not nil.

func (*DepartmentCreate) SetNotNilEmail added in v1.0.9

func (d *DepartmentCreate) SetNotNilEmail(value *string) *DepartmentCreate

set field if value's pointer is not nil.

func (*DepartmentCreate) SetNotNilLeader added in v1.0.9

func (d *DepartmentCreate) SetNotNilLeader(value *string) *DepartmentCreate

set field if value's pointer is not nil.

func (*DepartmentCreate) SetNotNilName added in v1.0.9

func (d *DepartmentCreate) SetNotNilName(value *string) *DepartmentCreate

set field if value's pointer is not nil.

func (*DepartmentCreate) SetNotNilParentID added in v1.0.9

func (d *DepartmentCreate) SetNotNilParentID(value *uint64) *DepartmentCreate

set field if value's pointer is not nil.

func (*DepartmentCreate) SetNotNilPhone added in v1.0.9

func (d *DepartmentCreate) SetNotNilPhone(value *string) *DepartmentCreate

set field if value's pointer is not nil.

func (*DepartmentCreate) SetNotNilRemark added in v1.0.9

func (d *DepartmentCreate) SetNotNilRemark(value *string) *DepartmentCreate

set field if value's pointer is not nil.

func (*DepartmentCreate) SetNotNilSort added in v1.0.9

func (d *DepartmentCreate) SetNotNilSort(value *uint32) *DepartmentCreate

set field if value's pointer is not nil.

func (*DepartmentCreate) SetNotNilStatus added in v1.0.9

func (d *DepartmentCreate) SetNotNilStatus(value *uint8) *DepartmentCreate

set field if value's pointer is not nil.

func (*DepartmentCreate) SetNotNilUpdatedAt added in v1.0.9

func (d *DepartmentCreate) SetNotNilUpdatedAt(value *time.Time) *DepartmentCreate

set field if value's pointer is not nil.

func (*DepartmentCreate) SetParent

func (dc *DepartmentCreate) SetParent(d *Department) *DepartmentCreate

SetParent sets the "parent" edge to the Department entity.

func (*DepartmentCreate) SetParentID

func (dc *DepartmentCreate) SetParentID(u uint64) *DepartmentCreate

SetParentID sets the "parent_id" field.

func (*DepartmentCreate) SetPhone

func (dc *DepartmentCreate) SetPhone(s string) *DepartmentCreate

SetPhone sets the "phone" field.

func (*DepartmentCreate) SetRemark

func (dc *DepartmentCreate) SetRemark(s string) *DepartmentCreate

SetRemark sets the "remark" field.

func (*DepartmentCreate) SetSort

func (dc *DepartmentCreate) SetSort(u uint32) *DepartmentCreate

SetSort sets the "sort" field.

func (*DepartmentCreate) SetStatus

func (dc *DepartmentCreate) SetStatus(u uint8) *DepartmentCreate

SetStatus sets the "status" field.

func (*DepartmentCreate) SetUpdatedAt

func (dc *DepartmentCreate) SetUpdatedAt(t time.Time) *DepartmentCreate

SetUpdatedAt sets the "updated_at" field.

type DepartmentCreateBulk

type DepartmentCreateBulk struct {
	// contains filtered or unexported fields
}

DepartmentCreateBulk is the builder for creating many Department entities in bulk.

func (*DepartmentCreateBulk) Exec

func (dcb *DepartmentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DepartmentCreateBulk) ExecContext added in v1.0.9

func (c *DepartmentCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DepartmentCreateBulk) ExecX

func (dcb *DepartmentCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentCreateBulk) QueryContext added in v1.0.9

func (c *DepartmentCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DepartmentCreateBulk) Save

func (dcb *DepartmentCreateBulk) Save(ctx context.Context) ([]*Department, error)

Save creates the Department entities in the database.

func (*DepartmentCreateBulk) SaveX

func (dcb *DepartmentCreateBulk) SaveX(ctx context.Context) []*Department

SaveX is like Save, but panics if an error occurs.

type DepartmentDelete

type DepartmentDelete struct {
	// contains filtered or unexported fields
}

DepartmentDelete is the builder for deleting a Department entity.

func (*DepartmentDelete) Exec

func (dd *DepartmentDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*DepartmentDelete) ExecContext added in v1.0.9

func (c *DepartmentDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DepartmentDelete) ExecX

func (dd *DepartmentDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentDelete) QueryContext added in v1.0.9

func (c *DepartmentDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DepartmentDelete) Where

Where appends a list predicates to the DepartmentDelete builder.

type DepartmentDeleteOne

type DepartmentDeleteOne struct {
	// contains filtered or unexported fields
}

DepartmentDeleteOne is the builder for deleting a single Department entity.

func (*DepartmentDeleteOne) Exec

func (ddo *DepartmentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DepartmentDeleteOne) ExecX

func (ddo *DepartmentDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentDeleteOne) Where

Where appends a list predicates to the DepartmentDelete builder.

type DepartmentEdges

type DepartmentEdges struct {
	// Parent holds the value of the parent edge.
	Parent *Department `json:"parent,omitempty"`
	// Children holds the value of the children edge.
	Children []*Department `json:"children,omitempty"`
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// contains filtered or unexported fields
}

DepartmentEdges holds the relations/edges for other nodes in the graph.

func (DepartmentEdges) ChildrenOrErr

func (e DepartmentEdges) ChildrenOrErr() ([]*Department, error)

ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.

func (DepartmentEdges) ParentOrErr

func (e DepartmentEdges) ParentOrErr() (*Department, error)

ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (DepartmentEdges) UsersOrErr

func (e DepartmentEdges) UsersOrErr() ([]*User, error)

UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.

type DepartmentGroupBy

type DepartmentGroupBy struct {
	// contains filtered or unexported fields
}

DepartmentGroupBy is the group-by builder for Department entities.

func (*DepartmentGroupBy) Aggregate

func (dgb *DepartmentGroupBy) Aggregate(fns ...AggregateFunc) *DepartmentGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*DepartmentGroupBy) Bool

func (s *DepartmentGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) BoolX

func (s *DepartmentGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DepartmentGroupBy) Bools

func (s *DepartmentGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) BoolsX

func (s *DepartmentGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DepartmentGroupBy) Float64

func (s *DepartmentGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) Float64X

func (s *DepartmentGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DepartmentGroupBy) Float64s

func (s *DepartmentGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) Float64sX

func (s *DepartmentGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DepartmentGroupBy) Int

func (s *DepartmentGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) IntX

func (s *DepartmentGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DepartmentGroupBy) Ints

func (s *DepartmentGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) IntsX

func (s *DepartmentGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DepartmentGroupBy) Scan

func (dgb *DepartmentGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DepartmentGroupBy) ScanX

func (s *DepartmentGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DepartmentGroupBy) String

func (s *DepartmentGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) StringX

func (s *DepartmentGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DepartmentGroupBy) Strings

func (s *DepartmentGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DepartmentGroupBy) StringsX

func (s *DepartmentGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DepartmentMutation

type DepartmentMutation struct {
	// contains filtered or unexported fields
}

DepartmentMutation represents an operation that mutates the Department nodes in the graph.

func (*DepartmentMutation) AddChildIDs

func (m *DepartmentMutation) AddChildIDs(ids ...uint64)

AddChildIDs adds the "children" edge to the Department entity by ids.

func (*DepartmentMutation) AddField

func (m *DepartmentMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DepartmentMutation) AddSort

func (m *DepartmentMutation) AddSort(u int32)

AddSort adds u to the "sort" field.

func (*DepartmentMutation) AddStatus

func (m *DepartmentMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*DepartmentMutation) AddUserIDs

func (m *DepartmentMutation) AddUserIDs(ids ...uuid.UUID)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*DepartmentMutation) AddedEdges

func (m *DepartmentMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DepartmentMutation) AddedField

func (m *DepartmentMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DepartmentMutation) AddedFields

func (m *DepartmentMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DepartmentMutation) AddedIDs

func (m *DepartmentMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DepartmentMutation) AddedSort

func (m *DepartmentMutation) AddedSort() (r int32, exists bool)

AddedSort returns the value that was added to the "sort" field in this mutation.

func (*DepartmentMutation) AddedStatus

func (m *DepartmentMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*DepartmentMutation) Ancestors

func (m *DepartmentMutation) Ancestors() (r string, exists bool)

Ancestors returns the value of the "ancestors" field in the mutation.

func (*DepartmentMutation) AncestorsCleared added in v1.0.13

func (m *DepartmentMutation) AncestorsCleared() bool

AncestorsCleared returns if the "ancestors" field was cleared in this mutation.

func (*DepartmentMutation) ChildrenCleared

func (m *DepartmentMutation) ChildrenCleared() bool

ChildrenCleared reports if the "children" edge to the Department entity was cleared.

func (*DepartmentMutation) ChildrenIDs

func (m *DepartmentMutation) ChildrenIDs() (ids []uint64)

ChildrenIDs returns the "children" edge IDs in the mutation.

func (*DepartmentMutation) ClearAncestors added in v1.0.13

func (m *DepartmentMutation) ClearAncestors()

ClearAncestors clears the value of the "ancestors" field.

func (*DepartmentMutation) ClearChildren

func (m *DepartmentMutation) ClearChildren()

ClearChildren clears the "children" edge to the Department entity.

func (*DepartmentMutation) ClearEdge

func (m *DepartmentMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*DepartmentMutation) ClearField

func (m *DepartmentMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*DepartmentMutation) ClearParent

func (m *DepartmentMutation) ClearParent()

ClearParent clears the "parent" edge to the Department entity.

func (*DepartmentMutation) ClearParentID

func (m *DepartmentMutation) ClearParentID()

ClearParentID clears the value of the "parent_id" field.

func (*DepartmentMutation) ClearRemark added in v1.0.13

func (m *DepartmentMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*DepartmentMutation) ClearStatus

func (m *DepartmentMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*DepartmentMutation) ClearUsers

func (m *DepartmentMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*DepartmentMutation) ClearedEdges

func (m *DepartmentMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DepartmentMutation) ClearedFields

func (m *DepartmentMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DepartmentMutation) Client

func (m DepartmentMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*DepartmentMutation) CreatedAt

func (m *DepartmentMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*DepartmentMutation) EdgeCleared

func (m *DepartmentMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DepartmentMutation) Email

func (m *DepartmentMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*DepartmentMutation) ExecContext added in v1.0.9

func (c *DepartmentMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DepartmentMutation) Field

func (m *DepartmentMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DepartmentMutation) FieldCleared

func (m *DepartmentMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DepartmentMutation) Fields

func (m *DepartmentMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*DepartmentMutation) ID

func (m *DepartmentMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*DepartmentMutation) IDs

func (m *DepartmentMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*DepartmentMutation) Leader

func (m *DepartmentMutation) Leader() (r string, exists bool)

Leader returns the value of the "leader" field in the mutation.

func (*DepartmentMutation) Name

func (m *DepartmentMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*DepartmentMutation) OldAncestors

func (m *DepartmentMutation) OldAncestors(ctx context.Context) (v string, err error)

OldAncestors returns the old "ancestors" field's value of the Department entity. If the Department object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DepartmentMutation) OldCreatedAt

func (m *DepartmentMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Department entity. If the Department object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DepartmentMutation) OldEmail

func (m *DepartmentMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the Department entity. If the Department object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DepartmentMutation) OldField

func (m *DepartmentMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*DepartmentMutation) OldLeader

func (m *DepartmentMutation) OldLeader(ctx context.Context) (v string, err error)

OldLeader returns the old "leader" field's value of the Department entity. If the Department object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DepartmentMutation) OldName

func (m *DepartmentMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Department entity. If the Department object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DepartmentMutation) OldParentID

func (m *DepartmentMutation) OldParentID(ctx context.Context) (v uint64, err error)

OldParentID returns the old "parent_id" field's value of the Department entity. If the Department object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DepartmentMutation) OldPhone

func (m *DepartmentMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" field's value of the Department entity. If the Department object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DepartmentMutation) OldRemark

func (m *DepartmentMutation) OldRemark(ctx context.Context) (v string, err error)

OldRemark returns the old "remark" field's value of the Department entity. If the Department object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DepartmentMutation) OldSort

func (m *DepartmentMutation) OldSort(ctx context.Context) (v uint32, err error)

OldSort returns the old "sort" field's value of the Department entity. If the Department object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DepartmentMutation) OldStatus

func (m *DepartmentMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the Department entity. If the Department object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DepartmentMutation) OldUpdatedAt

func (m *DepartmentMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Department entity. If the Department object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DepartmentMutation) Op

func (m *DepartmentMutation) Op() Op

Op returns the operation name.

func (*DepartmentMutation) ParentCleared

func (m *DepartmentMutation) ParentCleared() bool

ParentCleared reports if the "parent" edge to the Department entity was cleared.

func (*DepartmentMutation) ParentID

func (m *DepartmentMutation) ParentID() (r uint64, exists bool)

ParentID returns the value of the "parent_id" field in the mutation.

func (*DepartmentMutation) ParentIDCleared

func (m *DepartmentMutation) ParentIDCleared() bool

ParentIDCleared returns if the "parent_id" field was cleared in this mutation.

func (*DepartmentMutation) ParentIDs

func (m *DepartmentMutation) ParentIDs() (ids []uint64)

ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.

func (*DepartmentMutation) Phone

func (m *DepartmentMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*DepartmentMutation) QueryContext added in v1.0.9

func (c *DepartmentMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DepartmentMutation) Remark

func (m *DepartmentMutation) Remark() (r string, exists bool)

Remark returns the value of the "remark" field in the mutation.

func (*DepartmentMutation) RemarkCleared added in v1.0.13

func (m *DepartmentMutation) RemarkCleared() bool

RemarkCleared returns if the "remark" field was cleared in this mutation.

func (*DepartmentMutation) RemoveChildIDs

func (m *DepartmentMutation) RemoveChildIDs(ids ...uint64)

RemoveChildIDs removes the "children" edge to the Department entity by IDs.

func (*DepartmentMutation) RemoveUserIDs

func (m *DepartmentMutation) RemoveUserIDs(ids ...uuid.UUID)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*DepartmentMutation) RemovedChildrenIDs

func (m *DepartmentMutation) RemovedChildrenIDs() (ids []uint64)

RemovedChildren returns the removed IDs of the "children" edge to the Department entity.

func (*DepartmentMutation) RemovedEdges

func (m *DepartmentMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DepartmentMutation) RemovedIDs

func (m *DepartmentMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*DepartmentMutation) RemovedUsersIDs

func (m *DepartmentMutation) RemovedUsersIDs() (ids []uuid.UUID)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*DepartmentMutation) ResetAncestors

func (m *DepartmentMutation) ResetAncestors()

ResetAncestors resets all changes to the "ancestors" field.

func (*DepartmentMutation) ResetChildren

func (m *DepartmentMutation) ResetChildren()

ResetChildren resets all changes to the "children" edge.

func (*DepartmentMutation) ResetCreatedAt

func (m *DepartmentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DepartmentMutation) ResetEdge

func (m *DepartmentMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*DepartmentMutation) ResetEmail

func (m *DepartmentMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*DepartmentMutation) ResetField

func (m *DepartmentMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*DepartmentMutation) ResetLeader

func (m *DepartmentMutation) ResetLeader()

ResetLeader resets all changes to the "leader" field.

func (*DepartmentMutation) ResetName

func (m *DepartmentMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DepartmentMutation) ResetParent

func (m *DepartmentMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (*DepartmentMutation) ResetParentID

func (m *DepartmentMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (*DepartmentMutation) ResetPhone

func (m *DepartmentMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*DepartmentMutation) ResetRemark

func (m *DepartmentMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*DepartmentMutation) ResetSort

func (m *DepartmentMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*DepartmentMutation) ResetStatus

func (m *DepartmentMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*DepartmentMutation) ResetUpdatedAt

func (m *DepartmentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DepartmentMutation) ResetUsers

func (m *DepartmentMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*DepartmentMutation) SetAncestors

func (m *DepartmentMutation) SetAncestors(s string)

SetAncestors sets the "ancestors" field.

func (*DepartmentMutation) SetCreatedAt

func (m *DepartmentMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*DepartmentMutation) SetEmail

func (m *DepartmentMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*DepartmentMutation) SetField

func (m *DepartmentMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DepartmentMutation) SetID

func (m *DepartmentMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Department entities.

func (*DepartmentMutation) SetLeader

func (m *DepartmentMutation) SetLeader(s string)

SetLeader sets the "leader" field.

func (*DepartmentMutation) SetName

func (m *DepartmentMutation) SetName(s string)

SetName sets the "name" field.

func (*DepartmentMutation) SetOp

func (m *DepartmentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DepartmentMutation) SetParentID

func (m *DepartmentMutation) SetParentID(u uint64)

SetParentID sets the "parent_id" field.

func (*DepartmentMutation) SetPhone

func (m *DepartmentMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*DepartmentMutation) SetRemark

func (m *DepartmentMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*DepartmentMutation) SetSort

func (m *DepartmentMutation) SetSort(u uint32)

SetSort sets the "sort" field.

func (*DepartmentMutation) SetStatus

func (m *DepartmentMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*DepartmentMutation) SetUpdatedAt

func (m *DepartmentMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*DepartmentMutation) Sort

func (m *DepartmentMutation) Sort() (r uint32, exists bool)

Sort returns the value of the "sort" field in the mutation.

func (*DepartmentMutation) Status

func (m *DepartmentMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*DepartmentMutation) StatusCleared

func (m *DepartmentMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (DepartmentMutation) Tx

func (m DepartmentMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DepartmentMutation) Type

func (m *DepartmentMutation) Type() string

Type returns the node type of this mutation (Department).

func (*DepartmentMutation) UpdatedAt

func (m *DepartmentMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*DepartmentMutation) UsersCleared

func (m *DepartmentMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*DepartmentMutation) UsersIDs

func (m *DepartmentMutation) UsersIDs() (ids []uuid.UUID)

UsersIDs returns the "users" edge IDs in the mutation.

func (*DepartmentMutation) Where

func (m *DepartmentMutation) Where(ps ...predicate.Department)

Where appends a list predicates to the DepartmentMutation builder.

func (*DepartmentMutation) WhereP

func (m *DepartmentMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the DepartmentMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type DepartmentPageList

type DepartmentPageList struct {
	List        []*Department `json:"list"`
	PageDetails *PageDetails  `json:"pageDetails"`
}

DepartmentPageList is Department PageList result.

type DepartmentPager

type DepartmentPager struct {
	Order  department.OrderOption
	Filter func(*DepartmentQuery) (*DepartmentQuery, error)
}

func (*DepartmentPager) ApplyFilter

func (p *DepartmentPager) ApplyFilter(query *DepartmentQuery) (*DepartmentQuery, error)

type DepartmentPaginateOption

type DepartmentPaginateOption func(*DepartmentPager)

DepartmentPaginateOption enables pagination customization.

type DepartmentQuery

type DepartmentQuery struct {
	// contains filtered or unexported fields
}

DepartmentQuery is the builder for querying Department entities.

func (*DepartmentQuery) Aggregate

func (dq *DepartmentQuery) Aggregate(fns ...AggregateFunc) *DepartmentSelect

Aggregate returns a DepartmentSelect configured with the given aggregations.

func (*DepartmentQuery) All

func (dq *DepartmentQuery) All(ctx context.Context) ([]*Department, error)

All executes the query and returns a list of Departments.

func (*DepartmentQuery) AllX

func (dq *DepartmentQuery) AllX(ctx context.Context) []*Department

AllX is like All, but panics if an error occurs.

func (*DepartmentQuery) Clone

func (dq *DepartmentQuery) Clone() *DepartmentQuery

Clone returns a duplicate of the DepartmentQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DepartmentQuery) Count

func (dq *DepartmentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DepartmentQuery) CountX

func (dq *DepartmentQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DepartmentQuery) ExecContext added in v1.0.9

func (c *DepartmentQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DepartmentQuery) Exist

func (dq *DepartmentQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DepartmentQuery) ExistX

func (dq *DepartmentQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DepartmentQuery) First

func (dq *DepartmentQuery) First(ctx context.Context) (*Department, error)

First returns the first Department entity from the query. Returns a *NotFoundError when no Department was found.

func (*DepartmentQuery) FirstID

func (dq *DepartmentQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Department ID from the query. Returns a *NotFoundError when no Department ID was found.

func (*DepartmentQuery) FirstIDX

func (dq *DepartmentQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*DepartmentQuery) FirstX

func (dq *DepartmentQuery) FirstX(ctx context.Context) *Department

FirstX is like First, but panics if an error occurs.

func (*DepartmentQuery) GroupBy

func (dq *DepartmentQuery) GroupBy(field string, fields ...string) *DepartmentGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Department.Query().
	GroupBy(department.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DepartmentQuery) IDs

func (dq *DepartmentQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Department IDs.

func (*DepartmentQuery) IDsX

func (dq *DepartmentQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*DepartmentQuery) Limit

func (dq *DepartmentQuery) Limit(limit int) *DepartmentQuery

Limit the number of records to be returned by this query.

func (*DepartmentQuery) Offset

func (dq *DepartmentQuery) Offset(offset int) *DepartmentQuery

Offset to start from.

func (*DepartmentQuery) Only

func (dq *DepartmentQuery) Only(ctx context.Context) (*Department, error)

Only returns a single Department entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Department entity is found. Returns a *NotFoundError when no Department entities are found.

func (*DepartmentQuery) OnlyID

func (dq *DepartmentQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Department ID in the query. Returns a *NotSingularError when more than one Department ID is found. Returns a *NotFoundError when no entities are found.

func (*DepartmentQuery) OnlyIDX

func (dq *DepartmentQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DepartmentQuery) OnlyX

func (dq *DepartmentQuery) OnlyX(ctx context.Context) *Department

OnlyX is like Only, but panics if an error occurs.

func (*DepartmentQuery) Order

Order specifies how the records should be ordered.

func (*DepartmentQuery) Page

func (d *DepartmentQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...DepartmentPaginateOption,
) (*DepartmentPageList, error)

func (*DepartmentQuery) QueryChildren

func (dq *DepartmentQuery) QueryChildren() *DepartmentQuery

QueryChildren chains the current query on the "children" edge.

func (*DepartmentQuery) QueryContext added in v1.0.9

func (c *DepartmentQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DepartmentQuery) QueryParent

func (dq *DepartmentQuery) QueryParent() *DepartmentQuery

QueryParent chains the current query on the "parent" edge.

func (*DepartmentQuery) QueryUsers

func (dq *DepartmentQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*DepartmentQuery) Select

func (dq *DepartmentQuery) Select(fields ...string) *DepartmentSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Department.Query().
	Select(department.FieldCreatedAt).
	Scan(ctx, &v)

func (*DepartmentQuery) Unique

func (dq *DepartmentQuery) Unique(unique bool) *DepartmentQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*DepartmentQuery) Where

Where adds a new predicate for the DepartmentQuery builder.

func (*DepartmentQuery) WithChildren

func (dq *DepartmentQuery) WithChildren(opts ...func(*DepartmentQuery)) *DepartmentQuery

WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.

func (*DepartmentQuery) WithParent

func (dq *DepartmentQuery) WithParent(opts ...func(*DepartmentQuery)) *DepartmentQuery

WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.

func (*DepartmentQuery) WithUsers

func (dq *DepartmentQuery) WithUsers(opts ...func(*UserQuery)) *DepartmentQuery

WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.

type DepartmentSelect

type DepartmentSelect struct {
	*DepartmentQuery
	// contains filtered or unexported fields
}

DepartmentSelect is the builder for selecting fields of Department entities.

func (*DepartmentSelect) Aggregate

func (ds *DepartmentSelect) Aggregate(fns ...AggregateFunc) *DepartmentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DepartmentSelect) Bool

func (s *DepartmentSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) BoolX

func (s *DepartmentSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DepartmentSelect) Bools

func (s *DepartmentSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) BoolsX

func (s *DepartmentSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (DepartmentSelect) ExecContext added in v1.0.9

func (c DepartmentSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DepartmentSelect) Float64

func (s *DepartmentSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) Float64X

func (s *DepartmentSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DepartmentSelect) Float64s

func (s *DepartmentSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) Float64sX

func (s *DepartmentSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DepartmentSelect) Int

func (s *DepartmentSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) IntX

func (s *DepartmentSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DepartmentSelect) Ints

func (s *DepartmentSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) IntsX

func (s *DepartmentSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (DepartmentSelect) QueryContext added in v1.0.9

func (c DepartmentSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DepartmentSelect) Scan

func (ds *DepartmentSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DepartmentSelect) ScanX

func (s *DepartmentSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DepartmentSelect) String

func (s *DepartmentSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) StringX

func (s *DepartmentSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DepartmentSelect) Strings

func (s *DepartmentSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DepartmentSelect) StringsX

func (s *DepartmentSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DepartmentUpdate

type DepartmentUpdate struct {
	// contains filtered or unexported fields
}

DepartmentUpdate is the builder for updating Department entities.

func (*DepartmentUpdate) AddChildIDs

func (du *DepartmentUpdate) AddChildIDs(ids ...uint64) *DepartmentUpdate

AddChildIDs adds the "children" edge to the Department entity by IDs.

func (*DepartmentUpdate) AddChildren

func (du *DepartmentUpdate) AddChildren(d ...*Department) *DepartmentUpdate

AddChildren adds the "children" edges to the Department entity.

func (*DepartmentUpdate) AddSort

func (du *DepartmentUpdate) AddSort(u int32) *DepartmentUpdate

AddSort adds u to the "sort" field.

func (*DepartmentUpdate) AddStatus

func (du *DepartmentUpdate) AddStatus(u int8) *DepartmentUpdate

AddStatus adds u to the "status" field.

func (*DepartmentUpdate) AddUserIDs

func (du *DepartmentUpdate) AddUserIDs(ids ...uuid.UUID) *DepartmentUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*DepartmentUpdate) AddUsers

func (du *DepartmentUpdate) AddUsers(u ...*User) *DepartmentUpdate

AddUsers adds the "users" edges to the User entity.

func (*DepartmentUpdate) ClearAncestors added in v1.0.13

func (du *DepartmentUpdate) ClearAncestors() *DepartmentUpdate

ClearAncestors clears the value of the "ancestors" field.

func (*DepartmentUpdate) ClearChildren

func (du *DepartmentUpdate) ClearChildren() *DepartmentUpdate

ClearChildren clears all "children" edges to the Department entity.

func (*DepartmentUpdate) ClearParent

func (du *DepartmentUpdate) ClearParent() *DepartmentUpdate

ClearParent clears the "parent" edge to the Department entity.

func (*DepartmentUpdate) ClearParentID

func (du *DepartmentUpdate) ClearParentID() *DepartmentUpdate

ClearParentID clears the value of the "parent_id" field.

func (*DepartmentUpdate) ClearRemark added in v1.0.13

func (du *DepartmentUpdate) ClearRemark() *DepartmentUpdate

ClearRemark clears the value of the "remark" field.

func (*DepartmentUpdate) ClearStatus

func (du *DepartmentUpdate) ClearStatus() *DepartmentUpdate

ClearStatus clears the value of the "status" field.

func (*DepartmentUpdate) ClearUsers

func (du *DepartmentUpdate) ClearUsers() *DepartmentUpdate

ClearUsers clears all "users" edges to the User entity.

func (*DepartmentUpdate) Exec

func (du *DepartmentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DepartmentUpdate) ExecContext added in v1.0.9

func (c *DepartmentUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DepartmentUpdate) ExecX

func (du *DepartmentUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentUpdate) Mutation

func (du *DepartmentUpdate) Mutation() *DepartmentMutation

Mutation returns the DepartmentMutation object of the builder.

func (*DepartmentUpdate) QueryContext added in v1.0.9

func (c *DepartmentUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DepartmentUpdate) RemoveChildIDs

func (du *DepartmentUpdate) RemoveChildIDs(ids ...uint64) *DepartmentUpdate

RemoveChildIDs removes the "children" edge to Department entities by IDs.

func (*DepartmentUpdate) RemoveChildren

func (du *DepartmentUpdate) RemoveChildren(d ...*Department) *DepartmentUpdate

RemoveChildren removes "children" edges to Department entities.

func (*DepartmentUpdate) RemoveUserIDs

func (du *DepartmentUpdate) RemoveUserIDs(ids ...uuid.UUID) *DepartmentUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*DepartmentUpdate) RemoveUsers

func (du *DepartmentUpdate) RemoveUsers(u ...*User) *DepartmentUpdate

RemoveUsers removes "users" edges to User entities.

func (*DepartmentUpdate) Save

func (du *DepartmentUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DepartmentUpdate) SaveX

func (du *DepartmentUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DepartmentUpdate) SetAncestors

func (du *DepartmentUpdate) SetAncestors(s string) *DepartmentUpdate

SetAncestors sets the "ancestors" field.

func (*DepartmentUpdate) SetEmail

func (du *DepartmentUpdate) SetEmail(s string) *DepartmentUpdate

SetEmail sets the "email" field.

func (*DepartmentUpdate) SetLeader

func (du *DepartmentUpdate) SetLeader(s string) *DepartmentUpdate

SetLeader sets the "leader" field.

func (*DepartmentUpdate) SetName

func (du *DepartmentUpdate) SetName(s string) *DepartmentUpdate

SetName sets the "name" field.

func (*DepartmentUpdate) SetNillableAncestors added in v1.0.13

func (du *DepartmentUpdate) SetNillableAncestors(s *string) *DepartmentUpdate

SetNillableAncestors sets the "ancestors" field if the given value is not nil.

func (*DepartmentUpdate) SetNillableEmail added in v1.2.3

func (du *DepartmentUpdate) SetNillableEmail(s *string) *DepartmentUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*DepartmentUpdate) SetNillableLeader added in v1.2.3

func (du *DepartmentUpdate) SetNillableLeader(s *string) *DepartmentUpdate

SetNillableLeader sets the "leader" field if the given value is not nil.

func (*DepartmentUpdate) SetNillableName added in v1.2.3

func (du *DepartmentUpdate) SetNillableName(s *string) *DepartmentUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*DepartmentUpdate) SetNillableParentID

func (du *DepartmentUpdate) SetNillableParentID(u *uint64) *DepartmentUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*DepartmentUpdate) SetNillablePhone added in v1.2.3

func (du *DepartmentUpdate) SetNillablePhone(s *string) *DepartmentUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*DepartmentUpdate) SetNillableRemark added in v1.0.13

func (du *DepartmentUpdate) SetNillableRemark(s *string) *DepartmentUpdate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*DepartmentUpdate) SetNillableSort

func (du *DepartmentUpdate) SetNillableSort(u *uint32) *DepartmentUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*DepartmentUpdate) SetNillableStatus

func (du *DepartmentUpdate) SetNillableStatus(u *uint8) *DepartmentUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*DepartmentUpdate) SetNotEmptyAncestors

func (d *DepartmentUpdate) SetNotEmptyAncestors(value string) *DepartmentUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdate) SetNotEmptyEmail

func (d *DepartmentUpdate) SetNotEmptyEmail(value string) *DepartmentUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdate) SetNotEmptyLeader

func (d *DepartmentUpdate) SetNotEmptyLeader(value string) *DepartmentUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdate) SetNotEmptyName

func (d *DepartmentUpdate) SetNotEmptyName(value string) *DepartmentUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdate) SetNotEmptyParentID

func (d *DepartmentUpdate) SetNotEmptyParentID(value uint64) *DepartmentUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdate) SetNotEmptyPhone

func (d *DepartmentUpdate) SetNotEmptyPhone(value string) *DepartmentUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdate) SetNotEmptyRemark

func (d *DepartmentUpdate) SetNotEmptyRemark(value string) *DepartmentUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdate) SetNotEmptySort

func (d *DepartmentUpdate) SetNotEmptySort(value uint32) *DepartmentUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdate) SetNotEmptyStatus

func (d *DepartmentUpdate) SetNotEmptyStatus(value uint8) *DepartmentUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdate) SetNotNilAncestors added in v1.0.9

func (d *DepartmentUpdate) SetNotNilAncestors(value *string) *DepartmentUpdate

set field if value's pointer is not nil.

func (*DepartmentUpdate) SetNotNilEmail added in v1.0.9

func (d *DepartmentUpdate) SetNotNilEmail(value *string) *DepartmentUpdate

set field if value's pointer is not nil.

func (*DepartmentUpdate) SetNotNilLeader added in v1.0.9

func (d *DepartmentUpdate) SetNotNilLeader(value *string) *DepartmentUpdate

set field if value's pointer is not nil.

func (*DepartmentUpdate) SetNotNilName added in v1.0.9

func (d *DepartmentUpdate) SetNotNilName(value *string) *DepartmentUpdate

set field if value's pointer is not nil.

func (*DepartmentUpdate) SetNotNilParentID added in v1.0.9

func (d *DepartmentUpdate) SetNotNilParentID(value *uint64) *DepartmentUpdate

set field if value's pointer is not nil.

func (*DepartmentUpdate) SetNotNilPhone added in v1.0.9

func (d *DepartmentUpdate) SetNotNilPhone(value *string) *DepartmentUpdate

set field if value's pointer is not nil.

func (*DepartmentUpdate) SetNotNilRemark added in v1.0.9

func (d *DepartmentUpdate) SetNotNilRemark(value *string) *DepartmentUpdate

set field if value's pointer is not nil.

func (*DepartmentUpdate) SetNotNilSort added in v1.0.9

func (d *DepartmentUpdate) SetNotNilSort(value *uint32) *DepartmentUpdate

set field if value's pointer is not nil.

func (*DepartmentUpdate) SetNotNilStatus added in v1.0.9

func (d *DepartmentUpdate) SetNotNilStatus(value *uint8) *DepartmentUpdate

set field if value's pointer is not nil.

func (*DepartmentUpdate) SetNotNilUpdatedAt added in v1.0.9

func (d *DepartmentUpdate) SetNotNilUpdatedAt(value *time.Time) *DepartmentUpdate

set field if value's pointer is not nil.

func (*DepartmentUpdate) SetParent

func (du *DepartmentUpdate) SetParent(d *Department) *DepartmentUpdate

SetParent sets the "parent" edge to the Department entity.

func (*DepartmentUpdate) SetParentID

func (du *DepartmentUpdate) SetParentID(u uint64) *DepartmentUpdate

SetParentID sets the "parent_id" field.

func (*DepartmentUpdate) SetPhone

func (du *DepartmentUpdate) SetPhone(s string) *DepartmentUpdate

SetPhone sets the "phone" field.

func (*DepartmentUpdate) SetRemark

func (du *DepartmentUpdate) SetRemark(s string) *DepartmentUpdate

SetRemark sets the "remark" field.

func (*DepartmentUpdate) SetSort

func (du *DepartmentUpdate) SetSort(u uint32) *DepartmentUpdate

SetSort sets the "sort" field.

func (*DepartmentUpdate) SetStatus

func (du *DepartmentUpdate) SetStatus(u uint8) *DepartmentUpdate

SetStatus sets the "status" field.

func (*DepartmentUpdate) SetUpdatedAt

func (du *DepartmentUpdate) SetUpdatedAt(t time.Time) *DepartmentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DepartmentUpdate) Where

Where appends a list predicates to the DepartmentUpdate builder.

type DepartmentUpdateOne

type DepartmentUpdateOne struct {
	// contains filtered or unexported fields
}

DepartmentUpdateOne is the builder for updating a single Department entity.

func (*DepartmentUpdateOne) AddChildIDs

func (duo *DepartmentUpdateOne) AddChildIDs(ids ...uint64) *DepartmentUpdateOne

AddChildIDs adds the "children" edge to the Department entity by IDs.

func (*DepartmentUpdateOne) AddChildren

func (duo *DepartmentUpdateOne) AddChildren(d ...*Department) *DepartmentUpdateOne

AddChildren adds the "children" edges to the Department entity.

func (*DepartmentUpdateOne) AddSort

AddSort adds u to the "sort" field.

func (*DepartmentUpdateOne) AddStatus

func (duo *DepartmentUpdateOne) AddStatus(u int8) *DepartmentUpdateOne

AddStatus adds u to the "status" field.

func (*DepartmentUpdateOne) AddUserIDs

func (duo *DepartmentUpdateOne) AddUserIDs(ids ...uuid.UUID) *DepartmentUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*DepartmentUpdateOne) AddUsers

func (duo *DepartmentUpdateOne) AddUsers(u ...*User) *DepartmentUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*DepartmentUpdateOne) ClearAncestors added in v1.0.13

func (duo *DepartmentUpdateOne) ClearAncestors() *DepartmentUpdateOne

ClearAncestors clears the value of the "ancestors" field.

func (*DepartmentUpdateOne) ClearChildren

func (duo *DepartmentUpdateOne) ClearChildren() *DepartmentUpdateOne

ClearChildren clears all "children" edges to the Department entity.

func (*DepartmentUpdateOne) ClearParent

func (duo *DepartmentUpdateOne) ClearParent() *DepartmentUpdateOne

ClearParent clears the "parent" edge to the Department entity.

func (*DepartmentUpdateOne) ClearParentID

func (duo *DepartmentUpdateOne) ClearParentID() *DepartmentUpdateOne

ClearParentID clears the value of the "parent_id" field.

func (*DepartmentUpdateOne) ClearRemark added in v1.0.13

func (duo *DepartmentUpdateOne) ClearRemark() *DepartmentUpdateOne

ClearRemark clears the value of the "remark" field.

func (*DepartmentUpdateOne) ClearStatus

func (duo *DepartmentUpdateOne) ClearStatus() *DepartmentUpdateOne

ClearStatus clears the value of the "status" field.

func (*DepartmentUpdateOne) ClearUsers

func (duo *DepartmentUpdateOne) ClearUsers() *DepartmentUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*DepartmentUpdateOne) Exec

func (duo *DepartmentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DepartmentUpdateOne) ExecContext added in v1.0.9

func (c *DepartmentUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DepartmentUpdateOne) ExecX

func (duo *DepartmentUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DepartmentUpdateOne) Mutation

func (duo *DepartmentUpdateOne) Mutation() *DepartmentMutation

Mutation returns the DepartmentMutation object of the builder.

func (*DepartmentUpdateOne) QueryContext added in v1.0.9

func (c *DepartmentUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DepartmentUpdateOne) RemoveChildIDs

func (duo *DepartmentUpdateOne) RemoveChildIDs(ids ...uint64) *DepartmentUpdateOne

RemoveChildIDs removes the "children" edge to Department entities by IDs.

func (*DepartmentUpdateOne) RemoveChildren

func (duo *DepartmentUpdateOne) RemoveChildren(d ...*Department) *DepartmentUpdateOne

RemoveChildren removes "children" edges to Department entities.

func (*DepartmentUpdateOne) RemoveUserIDs

func (duo *DepartmentUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *DepartmentUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*DepartmentUpdateOne) RemoveUsers

func (duo *DepartmentUpdateOne) RemoveUsers(u ...*User) *DepartmentUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*DepartmentUpdateOne) Save

func (duo *DepartmentUpdateOne) Save(ctx context.Context) (*Department, error)

Save executes the query and returns the updated Department entity.

func (*DepartmentUpdateOne) SaveX

func (duo *DepartmentUpdateOne) SaveX(ctx context.Context) *Department

SaveX is like Save, but panics if an error occurs.

func (*DepartmentUpdateOne) Select

func (duo *DepartmentUpdateOne) Select(field string, fields ...string) *DepartmentUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DepartmentUpdateOne) SetAncestors

func (duo *DepartmentUpdateOne) SetAncestors(s string) *DepartmentUpdateOne

SetAncestors sets the "ancestors" field.

func (*DepartmentUpdateOne) SetEmail

SetEmail sets the "email" field.

func (*DepartmentUpdateOne) SetLeader

func (duo *DepartmentUpdateOne) SetLeader(s string) *DepartmentUpdateOne

SetLeader sets the "leader" field.

func (*DepartmentUpdateOne) SetName

SetName sets the "name" field.

func (*DepartmentUpdateOne) SetNillableAncestors added in v1.0.13

func (duo *DepartmentUpdateOne) SetNillableAncestors(s *string) *DepartmentUpdateOne

SetNillableAncestors sets the "ancestors" field if the given value is not nil.

func (*DepartmentUpdateOne) SetNillableEmail added in v1.2.3

func (duo *DepartmentUpdateOne) SetNillableEmail(s *string) *DepartmentUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*DepartmentUpdateOne) SetNillableLeader added in v1.2.3

func (duo *DepartmentUpdateOne) SetNillableLeader(s *string) *DepartmentUpdateOne

SetNillableLeader sets the "leader" field if the given value is not nil.

func (*DepartmentUpdateOne) SetNillableName added in v1.2.3

func (duo *DepartmentUpdateOne) SetNillableName(s *string) *DepartmentUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*DepartmentUpdateOne) SetNillableParentID

func (duo *DepartmentUpdateOne) SetNillableParentID(u *uint64) *DepartmentUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (*DepartmentUpdateOne) SetNillablePhone added in v1.2.3

func (duo *DepartmentUpdateOne) SetNillablePhone(s *string) *DepartmentUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*DepartmentUpdateOne) SetNillableRemark added in v1.0.13

func (duo *DepartmentUpdateOne) SetNillableRemark(s *string) *DepartmentUpdateOne

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*DepartmentUpdateOne) SetNillableSort

func (duo *DepartmentUpdateOne) SetNillableSort(u *uint32) *DepartmentUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (*DepartmentUpdateOne) SetNillableStatus

func (duo *DepartmentUpdateOne) SetNillableStatus(u *uint8) *DepartmentUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*DepartmentUpdateOne) SetNotEmptyAncestors

func (d *DepartmentUpdateOne) SetNotEmptyAncestors(value string) *DepartmentUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdateOne) SetNotEmptyEmail

func (d *DepartmentUpdateOne) SetNotEmptyEmail(value string) *DepartmentUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdateOne) SetNotEmptyLeader

func (d *DepartmentUpdateOne) SetNotEmptyLeader(value string) *DepartmentUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdateOne) SetNotEmptyName

func (d *DepartmentUpdateOne) SetNotEmptyName(value string) *DepartmentUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdateOne) SetNotEmptyParentID

func (d *DepartmentUpdateOne) SetNotEmptyParentID(value uint64) *DepartmentUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdateOne) SetNotEmptyPhone

func (d *DepartmentUpdateOne) SetNotEmptyPhone(value string) *DepartmentUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdateOne) SetNotEmptyRemark

func (d *DepartmentUpdateOne) SetNotEmptyRemark(value string) *DepartmentUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdateOne) SetNotEmptySort

func (d *DepartmentUpdateOne) SetNotEmptySort(value uint32) *DepartmentUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdateOne) SetNotEmptyStatus

func (d *DepartmentUpdateOne) SetNotEmptyStatus(value uint8) *DepartmentUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DepartmentUpdateOne) SetNotNilAncestors added in v1.0.9

func (d *DepartmentUpdateOne) SetNotNilAncestors(value *string) *DepartmentUpdateOne

set field if value's pointer is not nil.

func (*DepartmentUpdateOne) SetNotNilEmail added in v1.0.9

func (d *DepartmentUpdateOne) SetNotNilEmail(value *string) *DepartmentUpdateOne

set field if value's pointer is not nil.

func (*DepartmentUpdateOne) SetNotNilLeader added in v1.0.9

func (d *DepartmentUpdateOne) SetNotNilLeader(value *string) *DepartmentUpdateOne

set field if value's pointer is not nil.

func (*DepartmentUpdateOne) SetNotNilName added in v1.0.9

func (d *DepartmentUpdateOne) SetNotNilName(value *string) *DepartmentUpdateOne

set field if value's pointer is not nil.

func (*DepartmentUpdateOne) SetNotNilParentID added in v1.0.9

func (d *DepartmentUpdateOne) SetNotNilParentID(value *uint64) *DepartmentUpdateOne

set field if value's pointer is not nil.

func (*DepartmentUpdateOne) SetNotNilPhone added in v1.0.9

func (d *DepartmentUpdateOne) SetNotNilPhone(value *string) *DepartmentUpdateOne

set field if value's pointer is not nil.

func (*DepartmentUpdateOne) SetNotNilRemark added in v1.0.9

func (d *DepartmentUpdateOne) SetNotNilRemark(value *string) *DepartmentUpdateOne

set field if value's pointer is not nil.

func (*DepartmentUpdateOne) SetNotNilSort added in v1.0.9

func (d *DepartmentUpdateOne) SetNotNilSort(value *uint32) *DepartmentUpdateOne

set field if value's pointer is not nil.

func (*DepartmentUpdateOne) SetNotNilStatus added in v1.0.9

func (d *DepartmentUpdateOne) SetNotNilStatus(value *uint8) *DepartmentUpdateOne

set field if value's pointer is not nil.

func (*DepartmentUpdateOne) SetNotNilUpdatedAt added in v1.0.9

func (d *DepartmentUpdateOne) SetNotNilUpdatedAt(value *time.Time) *DepartmentUpdateOne

set field if value's pointer is not nil.

func (*DepartmentUpdateOne) SetParent

SetParent sets the "parent" edge to the Department entity.

func (*DepartmentUpdateOne) SetParentID

func (duo *DepartmentUpdateOne) SetParentID(u uint64) *DepartmentUpdateOne

SetParentID sets the "parent_id" field.

func (*DepartmentUpdateOne) SetPhone

SetPhone sets the "phone" field.

func (*DepartmentUpdateOne) SetRemark

func (duo *DepartmentUpdateOne) SetRemark(s string) *DepartmentUpdateOne

SetRemark sets the "remark" field.

func (*DepartmentUpdateOne) SetSort

SetSort sets the "sort" field.

func (*DepartmentUpdateOne) SetStatus

func (duo *DepartmentUpdateOne) SetStatus(u uint8) *DepartmentUpdateOne

SetStatus sets the "status" field.

func (*DepartmentUpdateOne) SetUpdatedAt

func (duo *DepartmentUpdateOne) SetUpdatedAt(t time.Time) *DepartmentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*DepartmentUpdateOne) Where

Where appends a list predicates to the DepartmentUpdate builder.

type Departments

type Departments []*Department

Departments is a parsable slice of Department.

type Dictionaries

type Dictionaries []*Dictionary

Dictionaries is a parsable slice of Dictionary.

type Dictionary

type Dictionary struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// The title shown in the ui | 展示名称 (建议配合i18n)
	Title string `json:"title,omitempty"`
	// The name of dictionary for search | 字典搜索名称
	Name string `json:"name,omitempty"`
	// The description of dictionary | 字典的描述
	Desc string `json:"desc,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DictionaryQuery when eager-loading is set.
	Edges DictionaryEdges `json:"edges"`
	// contains filtered or unexported fields
}

Dictionary is the model entity for the Dictionary schema.

func (*Dictionary) ExecContext added in v1.0.9

func (c *Dictionary) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Dictionary) QueryContext added in v1.0.9

func (c *Dictionary) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Dictionary) QueryDictionaryDetails

func (d *Dictionary) QueryDictionaryDetails() *DictionaryDetailQuery

QueryDictionaryDetails queries the "dictionary_details" edge of the Dictionary entity.

func (*Dictionary) String

func (d *Dictionary) String() string

String implements the fmt.Stringer.

func (*Dictionary) Unwrap

func (d *Dictionary) Unwrap() *Dictionary

Unwrap unwraps the Dictionary entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Dictionary) Update

func (d *Dictionary) Update() *DictionaryUpdateOne

Update returns a builder for updating this Dictionary. Note that you need to call Dictionary.Unwrap() before calling this method if this Dictionary was returned from a transaction, and the transaction was committed or rolled back.

func (*Dictionary) Value added in v1.0.0

func (d *Dictionary) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Dictionary. This includes values selected through modifiers, order, etc.

type DictionaryClient

type DictionaryClient struct {
	// contains filtered or unexported fields
}

DictionaryClient is a client for the Dictionary schema.

func NewDictionaryClient

func NewDictionaryClient(c config) *DictionaryClient

NewDictionaryClient returns a client for the Dictionary from the given config.

func (*DictionaryClient) Create

func (c *DictionaryClient) Create() *DictionaryCreate

Create returns a builder for creating a Dictionary entity.

func (*DictionaryClient) CreateBulk

func (c *DictionaryClient) CreateBulk(builders ...*DictionaryCreate) *DictionaryCreateBulk

CreateBulk returns a builder for creating a bulk of Dictionary entities.

func (*DictionaryClient) Delete

func (c *DictionaryClient) Delete() *DictionaryDelete

Delete returns a delete builder for Dictionary.

func (*DictionaryClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DictionaryClient) DeleteOneID

func (c *DictionaryClient) DeleteOneID(id uint64) *DictionaryDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*DictionaryClient) ExecContext added in v1.0.9

func (c *DictionaryClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryClient) Get

func (c *DictionaryClient) Get(ctx context.Context, id uint64) (*Dictionary, error)

Get returns a Dictionary entity by its id.

func (*DictionaryClient) GetX

func (c *DictionaryClient) GetX(ctx context.Context, id uint64) *Dictionary

GetX is like Get, but panics if an error occurs.

func (*DictionaryClient) Hooks

func (c *DictionaryClient) Hooks() []Hook

Hooks returns the client hooks.

func (*DictionaryClient) Intercept

func (c *DictionaryClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `dictionary.Intercept(f(g(h())))`.

func (*DictionaryClient) Interceptors

func (c *DictionaryClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*DictionaryClient) MapCreateBulk added in v1.1.5

func (c *DictionaryClient) MapCreateBulk(slice any, setFunc func(*DictionaryCreate, int)) *DictionaryCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*DictionaryClient) Query

func (c *DictionaryClient) Query() *DictionaryQuery

Query returns a query builder for Dictionary.

func (*DictionaryClient) QueryContext added in v1.0.9

func (c *DictionaryClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryClient) QueryDictionaryDetails

func (c *DictionaryClient) QueryDictionaryDetails(d *Dictionary) *DictionaryDetailQuery

QueryDictionaryDetails queries the dictionary_details edge of a Dictionary.

func (*DictionaryClient) Update

func (c *DictionaryClient) Update() *DictionaryUpdate

Update returns an update builder for Dictionary.

func (*DictionaryClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DictionaryClient) UpdateOneID

func (c *DictionaryClient) UpdateOneID(id uint64) *DictionaryUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DictionaryClient) Use

func (c *DictionaryClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `dictionary.Hooks(f(g(h())))`.

type DictionaryCreate

type DictionaryCreate struct {
	// contains filtered or unexported fields
}

DictionaryCreate is the builder for creating a Dictionary entity.

func (*DictionaryCreate) AddDictionaryDetailIDs

func (dc *DictionaryCreate) AddDictionaryDetailIDs(ids ...uint64) *DictionaryCreate

AddDictionaryDetailIDs adds the "dictionary_details" edge to the DictionaryDetail entity by IDs.

func (*DictionaryCreate) AddDictionaryDetails

func (dc *DictionaryCreate) AddDictionaryDetails(d ...*DictionaryDetail) *DictionaryCreate

AddDictionaryDetails adds the "dictionary_details" edges to the DictionaryDetail entity.

func (*DictionaryCreate) Exec

func (dc *DictionaryCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DictionaryCreate) ExecContext added in v1.0.9

func (c *DictionaryCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryCreate) ExecX

func (dc *DictionaryCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryCreate) Mutation

func (dc *DictionaryCreate) Mutation() *DictionaryMutation

Mutation returns the DictionaryMutation object of the builder.

func (*DictionaryCreate) QueryContext added in v1.0.9

func (c *DictionaryCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryCreate) Save

func (dc *DictionaryCreate) Save(ctx context.Context) (*Dictionary, error)

Save creates the Dictionary in the database.

func (*DictionaryCreate) SaveX

func (dc *DictionaryCreate) SaveX(ctx context.Context) *Dictionary

SaveX calls Save and panics if Save returns an error.

func (*DictionaryCreate) SetCreatedAt

func (dc *DictionaryCreate) SetCreatedAt(t time.Time) *DictionaryCreate

SetCreatedAt sets the "created_at" field.

func (*DictionaryCreate) SetDesc

func (dc *DictionaryCreate) SetDesc(s string) *DictionaryCreate

SetDesc sets the "desc" field.

func (*DictionaryCreate) SetID

SetID sets the "id" field.

func (*DictionaryCreate) SetName

func (dc *DictionaryCreate) SetName(s string) *DictionaryCreate

SetName sets the "name" field.

func (*DictionaryCreate) SetNillableCreatedAt

func (dc *DictionaryCreate) SetNillableCreatedAt(t *time.Time) *DictionaryCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*DictionaryCreate) SetNillableDesc added in v1.0.10

func (dc *DictionaryCreate) SetNillableDesc(s *string) *DictionaryCreate

SetNillableDesc sets the "desc" field if the given value is not nil.

func (*DictionaryCreate) SetNillableStatus

func (dc *DictionaryCreate) SetNillableStatus(u *uint8) *DictionaryCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*DictionaryCreate) SetNillableUpdatedAt

func (dc *DictionaryCreate) SetNillableUpdatedAt(t *time.Time) *DictionaryCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*DictionaryCreate) SetNotNilDesc added in v1.0.9

func (d *DictionaryCreate) SetNotNilDesc(value *string) *DictionaryCreate

set field if value's pointer is not nil.

func (*DictionaryCreate) SetNotNilName added in v1.0.9

func (d *DictionaryCreate) SetNotNilName(value *string) *DictionaryCreate

set field if value's pointer is not nil.

func (*DictionaryCreate) SetNotNilStatus added in v1.0.9

func (d *DictionaryCreate) SetNotNilStatus(value *uint8) *DictionaryCreate

set field if value's pointer is not nil.

func (*DictionaryCreate) SetNotNilTitle added in v1.0.9

func (d *DictionaryCreate) SetNotNilTitle(value *string) *DictionaryCreate

set field if value's pointer is not nil.

func (*DictionaryCreate) SetNotNilUpdatedAt added in v1.0.9

func (d *DictionaryCreate) SetNotNilUpdatedAt(value *time.Time) *DictionaryCreate

set field if value's pointer is not nil.

func (*DictionaryCreate) SetStatus

func (dc *DictionaryCreate) SetStatus(u uint8) *DictionaryCreate

SetStatus sets the "status" field.

func (*DictionaryCreate) SetTitle

func (dc *DictionaryCreate) SetTitle(s string) *DictionaryCreate

SetTitle sets the "title" field.

func (*DictionaryCreate) SetUpdatedAt

func (dc *DictionaryCreate) SetUpdatedAt(t time.Time) *DictionaryCreate

SetUpdatedAt sets the "updated_at" field.

type DictionaryCreateBulk

type DictionaryCreateBulk struct {
	// contains filtered or unexported fields
}

DictionaryCreateBulk is the builder for creating many Dictionary entities in bulk.

func (*DictionaryCreateBulk) Exec

func (dcb *DictionaryCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DictionaryCreateBulk) ExecContext added in v1.0.9

func (c *DictionaryCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryCreateBulk) ExecX

func (dcb *DictionaryCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryCreateBulk) QueryContext added in v1.0.9

func (c *DictionaryCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryCreateBulk) Save

func (dcb *DictionaryCreateBulk) Save(ctx context.Context) ([]*Dictionary, error)

Save creates the Dictionary entities in the database.

func (*DictionaryCreateBulk) SaveX

func (dcb *DictionaryCreateBulk) SaveX(ctx context.Context) []*Dictionary

SaveX is like Save, but panics if an error occurs.

type DictionaryDelete

type DictionaryDelete struct {
	// contains filtered or unexported fields
}

DictionaryDelete is the builder for deleting a Dictionary entity.

func (*DictionaryDelete) Exec

func (dd *DictionaryDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*DictionaryDelete) ExecContext added in v1.0.9

func (c *DictionaryDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryDelete) ExecX

func (dd *DictionaryDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryDelete) QueryContext added in v1.0.9

func (c *DictionaryDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryDelete) Where

Where appends a list predicates to the DictionaryDelete builder.

type DictionaryDeleteOne

type DictionaryDeleteOne struct {
	// contains filtered or unexported fields
}

DictionaryDeleteOne is the builder for deleting a single Dictionary entity.

func (*DictionaryDeleteOne) Exec

func (ddo *DictionaryDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DictionaryDeleteOne) ExecX

func (ddo *DictionaryDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryDeleteOne) Where

Where appends a list predicates to the DictionaryDelete builder.

type DictionaryDetail

type DictionaryDetail struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Sort Number | 排序编号
	Sort uint32 `json:"sort,omitempty"`
	// The title shown in the ui | 展示名称 (建议配合i18n)
	Title string `json:"title,omitempty"`
	// key | 键
	Key string `json:"key,omitempty"`
	// value | 值
	Value string `json:"value,omitempty"`
	// Dictionary ID | 字典ID
	DictionaryID uint64 `json:"dictionary_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DictionaryDetailQuery when eager-loading is set.
	Edges DictionaryDetailEdges `json:"edges"`
	// contains filtered or unexported fields
}

DictionaryDetail is the model entity for the DictionaryDetail schema.

func (*DictionaryDetail) ExecContext added in v1.0.9

func (c *DictionaryDetail) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryDetail) GetValue added in v1.0.0

func (dd *DictionaryDetail) GetValue(name string) (ent.Value, error)

GetValue returns the ent.Value that was dynamically selected and assigned to the DictionaryDetail. This includes values selected through modifiers, order, etc.

func (*DictionaryDetail) QueryContext added in v1.0.9

func (c *DictionaryDetail) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryDetail) QueryDictionaries

func (dd *DictionaryDetail) QueryDictionaries() *DictionaryQuery

QueryDictionaries queries the "dictionaries" edge of the DictionaryDetail entity.

func (*DictionaryDetail) String

func (dd *DictionaryDetail) String() string

String implements the fmt.Stringer.

func (*DictionaryDetail) Unwrap

func (dd *DictionaryDetail) Unwrap() *DictionaryDetail

Unwrap unwraps the DictionaryDetail entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*DictionaryDetail) Update

Update returns a builder for updating this DictionaryDetail. Note that you need to call DictionaryDetail.Unwrap() before calling this method if this DictionaryDetail was returned from a transaction, and the transaction was committed or rolled back.

type DictionaryDetailClient

type DictionaryDetailClient struct {
	// contains filtered or unexported fields
}

DictionaryDetailClient is a client for the DictionaryDetail schema.

func NewDictionaryDetailClient

func NewDictionaryDetailClient(c config) *DictionaryDetailClient

NewDictionaryDetailClient returns a client for the DictionaryDetail from the given config.

func (*DictionaryDetailClient) Create

Create returns a builder for creating a DictionaryDetail entity.

func (*DictionaryDetailClient) CreateBulk

CreateBulk returns a builder for creating a bulk of DictionaryDetail entities.

func (*DictionaryDetailClient) Delete

Delete returns a delete builder for DictionaryDetail.

func (*DictionaryDetailClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DictionaryDetailClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*DictionaryDetailClient) ExecContext added in v1.0.9

func (c *DictionaryDetailClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryDetailClient) Get

Get returns a DictionaryDetail entity by its id.

func (*DictionaryDetailClient) GetX

GetX is like Get, but panics if an error occurs.

func (*DictionaryDetailClient) Hooks

func (c *DictionaryDetailClient) Hooks() []Hook

Hooks returns the client hooks.

func (*DictionaryDetailClient) Intercept

func (c *DictionaryDetailClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `dictionarydetail.Intercept(f(g(h())))`.

func (*DictionaryDetailClient) Interceptors

func (c *DictionaryDetailClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*DictionaryDetailClient) MapCreateBulk added in v1.1.5

func (c *DictionaryDetailClient) MapCreateBulk(slice any, setFunc func(*DictionaryDetailCreate, int)) *DictionaryDetailCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*DictionaryDetailClient) Query

Query returns a query builder for DictionaryDetail.

func (*DictionaryDetailClient) QueryContext added in v1.0.9

func (c *DictionaryDetailClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryDetailClient) QueryDictionaries

func (c *DictionaryDetailClient) QueryDictionaries(dd *DictionaryDetail) *DictionaryQuery

QueryDictionaries queries the dictionaries edge of a DictionaryDetail.

func (*DictionaryDetailClient) Update

Update returns an update builder for DictionaryDetail.

func (*DictionaryDetailClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*DictionaryDetailClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*DictionaryDetailClient) Use

func (c *DictionaryDetailClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `dictionarydetail.Hooks(f(g(h())))`.

type DictionaryDetailCreate

type DictionaryDetailCreate struct {
	// contains filtered or unexported fields
}

DictionaryDetailCreate is the builder for creating a DictionaryDetail entity.

func (*DictionaryDetailCreate) Exec

Exec executes the query.

func (*DictionaryDetailCreate) ExecContext added in v1.0.9

func (c *DictionaryDetailCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryDetailCreate) ExecX

func (ddc *DictionaryDetailCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryDetailCreate) Mutation

Mutation returns the DictionaryDetailMutation object of the builder.

func (*DictionaryDetailCreate) QueryContext added in v1.0.9

func (c *DictionaryDetailCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryDetailCreate) Save

Save creates the DictionaryDetail in the database.

func (*DictionaryDetailCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*DictionaryDetailCreate) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*DictionaryDetailCreate) SetDictionaries

func (ddc *DictionaryDetailCreate) SetDictionaries(d *Dictionary) *DictionaryDetailCreate

SetDictionaries sets the "dictionaries" edge to the Dictionary entity.

func (*DictionaryDetailCreate) SetDictionariesID

func (ddc *DictionaryDetailCreate) SetDictionariesID(id uint64) *DictionaryDetailCreate

SetDictionariesID sets the "dictionaries" edge to the Dictionary entity by ID.

func (*DictionaryDetailCreate) SetDictionaryID

func (ddc *DictionaryDetailCreate) SetDictionaryID(u uint64) *DictionaryDetailCreate

SetDictionaryID sets the "dictionary_id" field.

func (*DictionaryDetailCreate) SetID

SetID sets the "id" field.

func (*DictionaryDetailCreate) SetKey

SetKey sets the "key" field.

func (*DictionaryDetailCreate) SetNillableCreatedAt

func (ddc *DictionaryDetailCreate) SetNillableCreatedAt(t *time.Time) *DictionaryDetailCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*DictionaryDetailCreate) SetNillableDictionariesID

func (ddc *DictionaryDetailCreate) SetNillableDictionariesID(id *uint64) *DictionaryDetailCreate

SetNillableDictionariesID sets the "dictionaries" edge to the Dictionary entity by ID if the given value is not nil.

func (*DictionaryDetailCreate) SetNillableDictionaryID

func (ddc *DictionaryDetailCreate) SetNillableDictionaryID(u *uint64) *DictionaryDetailCreate

SetNillableDictionaryID sets the "dictionary_id" field if the given value is not nil.

func (*DictionaryDetailCreate) SetNillableSort

func (ddc *DictionaryDetailCreate) SetNillableSort(u *uint32) *DictionaryDetailCreate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*DictionaryDetailCreate) SetNillableStatus

func (ddc *DictionaryDetailCreate) SetNillableStatus(u *uint8) *DictionaryDetailCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*DictionaryDetailCreate) SetNillableUpdatedAt

func (ddc *DictionaryDetailCreate) SetNillableUpdatedAt(t *time.Time) *DictionaryDetailCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*DictionaryDetailCreate) SetNotNilDictionaryID added in v1.0.9

func (dd *DictionaryDetailCreate) SetNotNilDictionaryID(value *uint64) *DictionaryDetailCreate

set field if value's pointer is not nil.

func (*DictionaryDetailCreate) SetNotNilKey added in v1.0.9

func (dd *DictionaryDetailCreate) SetNotNilKey(value *string) *DictionaryDetailCreate

set field if value's pointer is not nil.

func (*DictionaryDetailCreate) SetNotNilSort added in v1.0.9

func (dd *DictionaryDetailCreate) SetNotNilSort(value *uint32) *DictionaryDetailCreate

set field if value's pointer is not nil.

func (*DictionaryDetailCreate) SetNotNilStatus added in v1.0.9

func (dd *DictionaryDetailCreate) SetNotNilStatus(value *uint8) *DictionaryDetailCreate

set field if value's pointer is not nil.

func (*DictionaryDetailCreate) SetNotNilTitle added in v1.0.9

func (dd *DictionaryDetailCreate) SetNotNilTitle(value *string) *DictionaryDetailCreate

set field if value's pointer is not nil.

func (*DictionaryDetailCreate) SetNotNilUpdatedAt added in v1.0.9

func (dd *DictionaryDetailCreate) SetNotNilUpdatedAt(value *time.Time) *DictionaryDetailCreate

set field if value's pointer is not nil.

func (*DictionaryDetailCreate) SetNotNilValue added in v1.0.9

func (dd *DictionaryDetailCreate) SetNotNilValue(value *string) *DictionaryDetailCreate

set field if value's pointer is not nil.

func (*DictionaryDetailCreate) SetSort

SetSort sets the "sort" field.

func (*DictionaryDetailCreate) SetStatus

SetStatus sets the "status" field.

func (*DictionaryDetailCreate) SetTitle

SetTitle sets the "title" field.

func (*DictionaryDetailCreate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*DictionaryDetailCreate) SetValue

SetValue sets the "value" field.

type DictionaryDetailCreateBulk

type DictionaryDetailCreateBulk struct {
	// contains filtered or unexported fields
}

DictionaryDetailCreateBulk is the builder for creating many DictionaryDetail entities in bulk.

func (*DictionaryDetailCreateBulk) Exec

Exec executes the query.

func (*DictionaryDetailCreateBulk) ExecContext added in v1.0.9

func (c *DictionaryDetailCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryDetailCreateBulk) ExecX

func (ddcb *DictionaryDetailCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryDetailCreateBulk) QueryContext added in v1.0.9

func (c *DictionaryDetailCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryDetailCreateBulk) Save

Save creates the DictionaryDetail entities in the database.

func (*DictionaryDetailCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type DictionaryDetailDelete

type DictionaryDetailDelete struct {
	// contains filtered or unexported fields
}

DictionaryDetailDelete is the builder for deleting a DictionaryDetail entity.

func (*DictionaryDetailDelete) Exec

func (ddd *DictionaryDetailDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*DictionaryDetailDelete) ExecContext added in v1.0.9

func (c *DictionaryDetailDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryDetailDelete) ExecX

func (ddd *DictionaryDetailDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryDetailDelete) QueryContext added in v1.0.9

func (c *DictionaryDetailDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryDetailDelete) Where

Where appends a list predicates to the DictionaryDetailDelete builder.

type DictionaryDetailDeleteOne

type DictionaryDetailDeleteOne struct {
	// contains filtered or unexported fields
}

DictionaryDetailDeleteOne is the builder for deleting a single DictionaryDetail entity.

func (*DictionaryDetailDeleteOne) Exec

Exec executes the deletion query.

func (*DictionaryDetailDeleteOne) ExecX

func (dddo *DictionaryDetailDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryDetailDeleteOne) Where

Where appends a list predicates to the DictionaryDetailDelete builder.

type DictionaryDetailEdges

type DictionaryDetailEdges struct {
	// Dictionaries holds the value of the dictionaries edge.
	Dictionaries *Dictionary `json:"dictionaries,omitempty"`
	// contains filtered or unexported fields
}

DictionaryDetailEdges holds the relations/edges for other nodes in the graph.

func (DictionaryDetailEdges) DictionariesOrErr

func (e DictionaryDetailEdges) DictionariesOrErr() (*Dictionary, error)

DictionariesOrErr returns the Dictionaries value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type DictionaryDetailGroupBy

type DictionaryDetailGroupBy struct {
	// contains filtered or unexported fields
}

DictionaryDetailGroupBy is the group-by builder for DictionaryDetail entities.

func (*DictionaryDetailGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*DictionaryDetailGroupBy) Bool

func (s *DictionaryDetailGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailGroupBy) BoolX

func (s *DictionaryDetailGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DictionaryDetailGroupBy) Bools

func (s *DictionaryDetailGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailGroupBy) BoolsX

func (s *DictionaryDetailGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DictionaryDetailGroupBy) Float64

func (s *DictionaryDetailGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailGroupBy) Float64X

func (s *DictionaryDetailGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DictionaryDetailGroupBy) Float64s

func (s *DictionaryDetailGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailGroupBy) Float64sX

func (s *DictionaryDetailGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DictionaryDetailGroupBy) Int

func (s *DictionaryDetailGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailGroupBy) IntX

func (s *DictionaryDetailGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DictionaryDetailGroupBy) Ints

func (s *DictionaryDetailGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailGroupBy) IntsX

func (s *DictionaryDetailGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DictionaryDetailGroupBy) Scan

func (ddgb *DictionaryDetailGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DictionaryDetailGroupBy) ScanX

func (s *DictionaryDetailGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DictionaryDetailGroupBy) String

func (s *DictionaryDetailGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailGroupBy) StringX

func (s *DictionaryDetailGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DictionaryDetailGroupBy) Strings

func (s *DictionaryDetailGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailGroupBy) StringsX

func (s *DictionaryDetailGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DictionaryDetailMutation

type DictionaryDetailMutation struct {
	// contains filtered or unexported fields
}

DictionaryDetailMutation represents an operation that mutates the DictionaryDetail nodes in the graph.

func (*DictionaryDetailMutation) AddField

func (m *DictionaryDetailMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DictionaryDetailMutation) AddSort

func (m *DictionaryDetailMutation) AddSort(u int32)

AddSort adds u to the "sort" field.

func (*DictionaryDetailMutation) AddStatus

func (m *DictionaryDetailMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*DictionaryDetailMutation) AddedEdges

func (m *DictionaryDetailMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DictionaryDetailMutation) AddedField

func (m *DictionaryDetailMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DictionaryDetailMutation) AddedFields

func (m *DictionaryDetailMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DictionaryDetailMutation) AddedIDs

func (m *DictionaryDetailMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DictionaryDetailMutation) AddedSort

func (m *DictionaryDetailMutation) AddedSort() (r int32, exists bool)

AddedSort returns the value that was added to the "sort" field in this mutation.

func (*DictionaryDetailMutation) AddedStatus

func (m *DictionaryDetailMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*DictionaryDetailMutation) ClearDictionaries

func (m *DictionaryDetailMutation) ClearDictionaries()

ClearDictionaries clears the "dictionaries" edge to the Dictionary entity.

func (*DictionaryDetailMutation) ClearDictionaryID

func (m *DictionaryDetailMutation) ClearDictionaryID()

ClearDictionaryID clears the value of the "dictionary_id" field.

func (*DictionaryDetailMutation) ClearEdge

func (m *DictionaryDetailMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*DictionaryDetailMutation) ClearField

func (m *DictionaryDetailMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*DictionaryDetailMutation) ClearStatus

func (m *DictionaryDetailMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*DictionaryDetailMutation) ClearedEdges

func (m *DictionaryDetailMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DictionaryDetailMutation) ClearedFields

func (m *DictionaryDetailMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DictionaryDetailMutation) Client

func (m DictionaryDetailMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*DictionaryDetailMutation) CreatedAt

func (m *DictionaryDetailMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*DictionaryDetailMutation) DictionariesCleared

func (m *DictionaryDetailMutation) DictionariesCleared() bool

DictionariesCleared reports if the "dictionaries" edge to the Dictionary entity was cleared.

func (*DictionaryDetailMutation) DictionariesID

func (m *DictionaryDetailMutation) DictionariesID() (id uint64, exists bool)

DictionariesID returns the "dictionaries" edge ID in the mutation.

func (*DictionaryDetailMutation) DictionariesIDs

func (m *DictionaryDetailMutation) DictionariesIDs() (ids []uint64)

DictionariesIDs returns the "dictionaries" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DictionariesID instead. It exists only for internal usage by the builders.

func (*DictionaryDetailMutation) DictionaryID

func (m *DictionaryDetailMutation) DictionaryID() (r uint64, exists bool)

DictionaryID returns the value of the "dictionary_id" field in the mutation.

func (*DictionaryDetailMutation) DictionaryIDCleared

func (m *DictionaryDetailMutation) DictionaryIDCleared() bool

DictionaryIDCleared returns if the "dictionary_id" field was cleared in this mutation.

func (*DictionaryDetailMutation) EdgeCleared

func (m *DictionaryDetailMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DictionaryDetailMutation) ExecContext added in v1.0.9

func (c *DictionaryDetailMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryDetailMutation) Field

func (m *DictionaryDetailMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DictionaryDetailMutation) FieldCleared

func (m *DictionaryDetailMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DictionaryDetailMutation) Fields

func (m *DictionaryDetailMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*DictionaryDetailMutation) ID

func (m *DictionaryDetailMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*DictionaryDetailMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*DictionaryDetailMutation) Key

func (m *DictionaryDetailMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*DictionaryDetailMutation) OldCreatedAt

func (m *DictionaryDetailMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the DictionaryDetail entity. If the DictionaryDetail object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryDetailMutation) OldDictionaryID

func (m *DictionaryDetailMutation) OldDictionaryID(ctx context.Context) (v uint64, err error)

OldDictionaryID returns the old "dictionary_id" field's value of the DictionaryDetail entity. If the DictionaryDetail object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryDetailMutation) OldField

func (m *DictionaryDetailMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*DictionaryDetailMutation) OldKey

func (m *DictionaryDetailMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the DictionaryDetail entity. If the DictionaryDetail object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryDetailMutation) OldSort

func (m *DictionaryDetailMutation) OldSort(ctx context.Context) (v uint32, err error)

OldSort returns the old "sort" field's value of the DictionaryDetail entity. If the DictionaryDetail object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryDetailMutation) OldStatus

func (m *DictionaryDetailMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the DictionaryDetail entity. If the DictionaryDetail object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryDetailMutation) OldTitle

func (m *DictionaryDetailMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the DictionaryDetail entity. If the DictionaryDetail object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryDetailMutation) OldUpdatedAt

func (m *DictionaryDetailMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the DictionaryDetail entity. If the DictionaryDetail object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryDetailMutation) OldValue

func (m *DictionaryDetailMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the DictionaryDetail entity. If the DictionaryDetail object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryDetailMutation) Op

func (m *DictionaryDetailMutation) Op() Op

Op returns the operation name.

func (*DictionaryDetailMutation) QueryContext added in v1.0.9

func (c *DictionaryDetailMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryDetailMutation) RemovedEdges

func (m *DictionaryDetailMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DictionaryDetailMutation) RemovedIDs

func (m *DictionaryDetailMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*DictionaryDetailMutation) ResetCreatedAt

func (m *DictionaryDetailMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DictionaryDetailMutation) ResetDictionaries

func (m *DictionaryDetailMutation) ResetDictionaries()

ResetDictionaries resets all changes to the "dictionaries" edge.

func (*DictionaryDetailMutation) ResetDictionaryID

func (m *DictionaryDetailMutation) ResetDictionaryID()

ResetDictionaryID resets all changes to the "dictionary_id" field.

func (*DictionaryDetailMutation) ResetEdge

func (m *DictionaryDetailMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*DictionaryDetailMutation) ResetField

func (m *DictionaryDetailMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*DictionaryDetailMutation) ResetKey

func (m *DictionaryDetailMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*DictionaryDetailMutation) ResetSort

func (m *DictionaryDetailMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*DictionaryDetailMutation) ResetStatus

func (m *DictionaryDetailMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*DictionaryDetailMutation) ResetTitle

func (m *DictionaryDetailMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*DictionaryDetailMutation) ResetUpdatedAt

func (m *DictionaryDetailMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DictionaryDetailMutation) ResetValue

func (m *DictionaryDetailMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*DictionaryDetailMutation) SetCreatedAt

func (m *DictionaryDetailMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*DictionaryDetailMutation) SetDictionariesID

func (m *DictionaryDetailMutation) SetDictionariesID(id uint64)

SetDictionariesID sets the "dictionaries" edge to the Dictionary entity by id.

func (*DictionaryDetailMutation) SetDictionaryID

func (m *DictionaryDetailMutation) SetDictionaryID(u uint64)

SetDictionaryID sets the "dictionary_id" field.

func (*DictionaryDetailMutation) SetField

func (m *DictionaryDetailMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DictionaryDetailMutation) SetID

func (m *DictionaryDetailMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of DictionaryDetail entities.

func (*DictionaryDetailMutation) SetKey

func (m *DictionaryDetailMutation) SetKey(s string)

SetKey sets the "key" field.

func (*DictionaryDetailMutation) SetOp

func (m *DictionaryDetailMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DictionaryDetailMutation) SetSort

func (m *DictionaryDetailMutation) SetSort(u uint32)

SetSort sets the "sort" field.

func (*DictionaryDetailMutation) SetStatus

func (m *DictionaryDetailMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*DictionaryDetailMutation) SetTitle

func (m *DictionaryDetailMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*DictionaryDetailMutation) SetUpdatedAt

func (m *DictionaryDetailMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*DictionaryDetailMutation) SetValue

func (m *DictionaryDetailMutation) SetValue(s string)

SetValue sets the "value" field.

func (*DictionaryDetailMutation) Sort

func (m *DictionaryDetailMutation) Sort() (r uint32, exists bool)

Sort returns the value of the "sort" field in the mutation.

func (*DictionaryDetailMutation) Status

func (m *DictionaryDetailMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*DictionaryDetailMutation) StatusCleared

func (m *DictionaryDetailMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (*DictionaryDetailMutation) Title

func (m *DictionaryDetailMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (DictionaryDetailMutation) Tx

func (m DictionaryDetailMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DictionaryDetailMutation) Type

func (m *DictionaryDetailMutation) Type() string

Type returns the node type of this mutation (DictionaryDetail).

func (*DictionaryDetailMutation) UpdatedAt

func (m *DictionaryDetailMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*DictionaryDetailMutation) Value

func (m *DictionaryDetailMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*DictionaryDetailMutation) Where

Where appends a list predicates to the DictionaryDetailMutation builder.

func (*DictionaryDetailMutation) WhereP

func (m *DictionaryDetailMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the DictionaryDetailMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type DictionaryDetailPageList

type DictionaryDetailPageList struct {
	List        []*DictionaryDetail `json:"list"`
	PageDetails *PageDetails        `json:"pageDetails"`
}

DictionaryDetailPageList is DictionaryDetail PageList result.

type DictionaryDetailPager

type DictionaryDetailPager struct {
	Order  dictionarydetail.OrderOption
	Filter func(*DictionaryDetailQuery) (*DictionaryDetailQuery, error)
}

func (*DictionaryDetailPager) ApplyFilter

type DictionaryDetailPaginateOption

type DictionaryDetailPaginateOption func(*DictionaryDetailPager)

DictionaryDetailPaginateOption enables pagination customization.

type DictionaryDetailQuery

type DictionaryDetailQuery struct {
	// contains filtered or unexported fields
}

DictionaryDetailQuery is the builder for querying DictionaryDetail entities.

func (*DictionaryDetailQuery) Aggregate

Aggregate returns a DictionaryDetailSelect configured with the given aggregations.

func (*DictionaryDetailQuery) All

All executes the query and returns a list of DictionaryDetails.

func (*DictionaryDetailQuery) AllX

AllX is like All, but panics if an error occurs.

func (*DictionaryDetailQuery) Clone

Clone returns a duplicate of the DictionaryDetailQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DictionaryDetailQuery) Count

func (ddq *DictionaryDetailQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DictionaryDetailQuery) CountX

func (ddq *DictionaryDetailQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DictionaryDetailQuery) ExecContext added in v1.0.9

func (c *DictionaryDetailQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryDetailQuery) Exist

func (ddq *DictionaryDetailQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DictionaryDetailQuery) ExistX

func (ddq *DictionaryDetailQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DictionaryDetailQuery) First

First returns the first DictionaryDetail entity from the query. Returns a *NotFoundError when no DictionaryDetail was found.

func (*DictionaryDetailQuery) FirstID

func (ddq *DictionaryDetailQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first DictionaryDetail ID from the query. Returns a *NotFoundError when no DictionaryDetail ID was found.

func (*DictionaryDetailQuery) FirstIDX

func (ddq *DictionaryDetailQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*DictionaryDetailQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*DictionaryDetailQuery) GroupBy

func (ddq *DictionaryDetailQuery) GroupBy(field string, fields ...string) *DictionaryDetailGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DictionaryDetail.Query().
	GroupBy(dictionarydetail.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DictionaryDetailQuery) IDs

func (ddq *DictionaryDetailQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of DictionaryDetail IDs.

func (*DictionaryDetailQuery) IDsX

func (ddq *DictionaryDetailQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*DictionaryDetailQuery) Limit

func (ddq *DictionaryDetailQuery) Limit(limit int) *DictionaryDetailQuery

Limit the number of records to be returned by this query.

func (*DictionaryDetailQuery) Offset

func (ddq *DictionaryDetailQuery) Offset(offset int) *DictionaryDetailQuery

Offset to start from.

func (*DictionaryDetailQuery) Only

Only returns a single DictionaryDetail entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one DictionaryDetail entity is found. Returns a *NotFoundError when no DictionaryDetail entities are found.

func (*DictionaryDetailQuery) OnlyID

func (ddq *DictionaryDetailQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only DictionaryDetail ID in the query. Returns a *NotSingularError when more than one DictionaryDetail ID is found. Returns a *NotFoundError when no entities are found.

func (*DictionaryDetailQuery) OnlyIDX

func (ddq *DictionaryDetailQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DictionaryDetailQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*DictionaryDetailQuery) Order

Order specifies how the records should be ordered.

func (*DictionaryDetailQuery) Page

func (*DictionaryDetailQuery) QueryContext added in v1.0.9

func (c *DictionaryDetailQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryDetailQuery) QueryDictionaries

func (ddq *DictionaryDetailQuery) QueryDictionaries() *DictionaryQuery

QueryDictionaries chains the current query on the "dictionaries" edge.

func (*DictionaryDetailQuery) Select

func (ddq *DictionaryDetailQuery) Select(fields ...string) *DictionaryDetailSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.DictionaryDetail.Query().
	Select(dictionarydetail.FieldCreatedAt).
	Scan(ctx, &v)

func (*DictionaryDetailQuery) Unique

func (ddq *DictionaryDetailQuery) Unique(unique bool) *DictionaryDetailQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*DictionaryDetailQuery) Where

Where adds a new predicate for the DictionaryDetailQuery builder.

func (*DictionaryDetailQuery) WithDictionaries

func (ddq *DictionaryDetailQuery) WithDictionaries(opts ...func(*DictionaryQuery)) *DictionaryDetailQuery

WithDictionaries tells the query-builder to eager-load the nodes that are connected to the "dictionaries" edge. The optional arguments are used to configure the query builder of the edge.

type DictionaryDetailSelect

type DictionaryDetailSelect struct {
	*DictionaryDetailQuery
	// contains filtered or unexported fields
}

DictionaryDetailSelect is the builder for selecting fields of DictionaryDetail entities.

func (*DictionaryDetailSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*DictionaryDetailSelect) Bool

func (s *DictionaryDetailSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailSelect) BoolX

func (s *DictionaryDetailSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DictionaryDetailSelect) Bools

func (s *DictionaryDetailSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailSelect) BoolsX

func (s *DictionaryDetailSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (DictionaryDetailSelect) ExecContext added in v1.0.9

func (c DictionaryDetailSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryDetailSelect) Float64

func (s *DictionaryDetailSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailSelect) Float64X

func (s *DictionaryDetailSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DictionaryDetailSelect) Float64s

func (s *DictionaryDetailSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailSelect) Float64sX

func (s *DictionaryDetailSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DictionaryDetailSelect) Int

func (s *DictionaryDetailSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailSelect) IntX

func (s *DictionaryDetailSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DictionaryDetailSelect) Ints

func (s *DictionaryDetailSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailSelect) IntsX

func (s *DictionaryDetailSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (DictionaryDetailSelect) QueryContext added in v1.0.9

func (c DictionaryDetailSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryDetailSelect) Scan

func (dds *DictionaryDetailSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DictionaryDetailSelect) ScanX

func (s *DictionaryDetailSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DictionaryDetailSelect) String

func (s *DictionaryDetailSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailSelect) StringX

func (s *DictionaryDetailSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DictionaryDetailSelect) Strings

func (s *DictionaryDetailSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DictionaryDetailSelect) StringsX

func (s *DictionaryDetailSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DictionaryDetailUpdate

type DictionaryDetailUpdate struct {
	// contains filtered or unexported fields
}

DictionaryDetailUpdate is the builder for updating DictionaryDetail entities.

func (*DictionaryDetailUpdate) AddSort

AddSort adds u to the "sort" field.

func (*DictionaryDetailUpdate) AddStatus

AddStatus adds u to the "status" field.

func (*DictionaryDetailUpdate) ClearDictionaries

func (ddu *DictionaryDetailUpdate) ClearDictionaries() *DictionaryDetailUpdate

ClearDictionaries clears the "dictionaries" edge to the Dictionary entity.

func (*DictionaryDetailUpdate) ClearDictionaryID

func (ddu *DictionaryDetailUpdate) ClearDictionaryID() *DictionaryDetailUpdate

ClearDictionaryID clears the value of the "dictionary_id" field.

func (*DictionaryDetailUpdate) ClearStatus

func (ddu *DictionaryDetailUpdate) ClearStatus() *DictionaryDetailUpdate

ClearStatus clears the value of the "status" field.

func (*DictionaryDetailUpdate) Exec

Exec executes the query.

func (*DictionaryDetailUpdate) ExecContext added in v1.0.9

func (c *DictionaryDetailUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryDetailUpdate) ExecX

func (ddu *DictionaryDetailUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryDetailUpdate) Mutation

Mutation returns the DictionaryDetailMutation object of the builder.

func (*DictionaryDetailUpdate) QueryContext added in v1.0.9

func (c *DictionaryDetailUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryDetailUpdate) Save

func (ddu *DictionaryDetailUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DictionaryDetailUpdate) SaveX

func (ddu *DictionaryDetailUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DictionaryDetailUpdate) SetDictionaries

func (ddu *DictionaryDetailUpdate) SetDictionaries(d *Dictionary) *DictionaryDetailUpdate

SetDictionaries sets the "dictionaries" edge to the Dictionary entity.

func (*DictionaryDetailUpdate) SetDictionariesID

func (ddu *DictionaryDetailUpdate) SetDictionariesID(id uint64) *DictionaryDetailUpdate

SetDictionariesID sets the "dictionaries" edge to the Dictionary entity by ID.

func (*DictionaryDetailUpdate) SetDictionaryID

func (ddu *DictionaryDetailUpdate) SetDictionaryID(u uint64) *DictionaryDetailUpdate

SetDictionaryID sets the "dictionary_id" field.

func (*DictionaryDetailUpdate) SetKey

SetKey sets the "key" field.

func (*DictionaryDetailUpdate) SetNillableDictionariesID

func (ddu *DictionaryDetailUpdate) SetNillableDictionariesID(id *uint64) *DictionaryDetailUpdate

SetNillableDictionariesID sets the "dictionaries" edge to the Dictionary entity by ID if the given value is not nil.

func (*DictionaryDetailUpdate) SetNillableDictionaryID

func (ddu *DictionaryDetailUpdate) SetNillableDictionaryID(u *uint64) *DictionaryDetailUpdate

SetNillableDictionaryID sets the "dictionary_id" field if the given value is not nil.

func (*DictionaryDetailUpdate) SetNillableKey added in v1.2.3

func (ddu *DictionaryDetailUpdate) SetNillableKey(s *string) *DictionaryDetailUpdate

SetNillableKey sets the "key" field if the given value is not nil.

func (*DictionaryDetailUpdate) SetNillableSort

func (ddu *DictionaryDetailUpdate) SetNillableSort(u *uint32) *DictionaryDetailUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*DictionaryDetailUpdate) SetNillableStatus

func (ddu *DictionaryDetailUpdate) SetNillableStatus(u *uint8) *DictionaryDetailUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*DictionaryDetailUpdate) SetNillableTitle added in v1.2.3

func (ddu *DictionaryDetailUpdate) SetNillableTitle(s *string) *DictionaryDetailUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*DictionaryDetailUpdate) SetNillableValue added in v1.2.3

func (ddu *DictionaryDetailUpdate) SetNillableValue(s *string) *DictionaryDetailUpdate

SetNillableValue sets the "value" field if the given value is not nil.

func (*DictionaryDetailUpdate) SetNotEmptyDictionaryID

func (dd *DictionaryDetailUpdate) SetNotEmptyDictionaryID(value uint64) *DictionaryDetailUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdate) SetNotEmptyKey

func (dd *DictionaryDetailUpdate) SetNotEmptyKey(value string) *DictionaryDetailUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdate) SetNotEmptySort

func (dd *DictionaryDetailUpdate) SetNotEmptySort(value uint32) *DictionaryDetailUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdate) SetNotEmptyStatus

func (dd *DictionaryDetailUpdate) SetNotEmptyStatus(value uint8) *DictionaryDetailUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdate) SetNotEmptyTitle

func (dd *DictionaryDetailUpdate) SetNotEmptyTitle(value string) *DictionaryDetailUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdate) SetNotEmptyValue

func (dd *DictionaryDetailUpdate) SetNotEmptyValue(value string) *DictionaryDetailUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdate) SetNotNilDictionaryID added in v1.0.9

func (dd *DictionaryDetailUpdate) SetNotNilDictionaryID(value *uint64) *DictionaryDetailUpdate

set field if value's pointer is not nil.

func (*DictionaryDetailUpdate) SetNotNilKey added in v1.0.9

func (dd *DictionaryDetailUpdate) SetNotNilKey(value *string) *DictionaryDetailUpdate

set field if value's pointer is not nil.

func (*DictionaryDetailUpdate) SetNotNilSort added in v1.0.9

func (dd *DictionaryDetailUpdate) SetNotNilSort(value *uint32) *DictionaryDetailUpdate

set field if value's pointer is not nil.

func (*DictionaryDetailUpdate) SetNotNilStatus added in v1.0.9

func (dd *DictionaryDetailUpdate) SetNotNilStatus(value *uint8) *DictionaryDetailUpdate

set field if value's pointer is not nil.

func (*DictionaryDetailUpdate) SetNotNilTitle added in v1.0.9

func (dd *DictionaryDetailUpdate) SetNotNilTitle(value *string) *DictionaryDetailUpdate

set field if value's pointer is not nil.

func (*DictionaryDetailUpdate) SetNotNilUpdatedAt added in v1.0.9

func (dd *DictionaryDetailUpdate) SetNotNilUpdatedAt(value *time.Time) *DictionaryDetailUpdate

set field if value's pointer is not nil.

func (*DictionaryDetailUpdate) SetNotNilValue added in v1.0.9

func (dd *DictionaryDetailUpdate) SetNotNilValue(value *string) *DictionaryDetailUpdate

set field if value's pointer is not nil.

func (*DictionaryDetailUpdate) SetSort

SetSort sets the "sort" field.

func (*DictionaryDetailUpdate) SetStatus

SetStatus sets the "status" field.

func (*DictionaryDetailUpdate) SetTitle

SetTitle sets the "title" field.

func (*DictionaryDetailUpdate) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*DictionaryDetailUpdate) SetValue

SetValue sets the "value" field.

func (*DictionaryDetailUpdate) Where

Where appends a list predicates to the DictionaryDetailUpdate builder.

type DictionaryDetailUpdateOne

type DictionaryDetailUpdateOne struct {
	// contains filtered or unexported fields
}

DictionaryDetailUpdateOne is the builder for updating a single DictionaryDetail entity.

func (*DictionaryDetailUpdateOne) AddSort

AddSort adds u to the "sort" field.

func (*DictionaryDetailUpdateOne) AddStatus

AddStatus adds u to the "status" field.

func (*DictionaryDetailUpdateOne) ClearDictionaries

func (dduo *DictionaryDetailUpdateOne) ClearDictionaries() *DictionaryDetailUpdateOne

ClearDictionaries clears the "dictionaries" edge to the Dictionary entity.

func (*DictionaryDetailUpdateOne) ClearDictionaryID

func (dduo *DictionaryDetailUpdateOne) ClearDictionaryID() *DictionaryDetailUpdateOne

ClearDictionaryID clears the value of the "dictionary_id" field.

func (*DictionaryDetailUpdateOne) ClearStatus

ClearStatus clears the value of the "status" field.

func (*DictionaryDetailUpdateOne) Exec

Exec executes the query on the entity.

func (*DictionaryDetailUpdateOne) ExecContext added in v1.0.9

func (c *DictionaryDetailUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryDetailUpdateOne) ExecX

func (dduo *DictionaryDetailUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryDetailUpdateOne) Mutation

Mutation returns the DictionaryDetailMutation object of the builder.

func (*DictionaryDetailUpdateOne) QueryContext added in v1.0.9

func (c *DictionaryDetailUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryDetailUpdateOne) Save

Save executes the query and returns the updated DictionaryDetail entity.

func (*DictionaryDetailUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*DictionaryDetailUpdateOne) Select

func (dduo *DictionaryDetailUpdateOne) Select(field string, fields ...string) *DictionaryDetailUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DictionaryDetailUpdateOne) SetDictionaries

SetDictionaries sets the "dictionaries" edge to the Dictionary entity.

func (*DictionaryDetailUpdateOne) SetDictionariesID

func (dduo *DictionaryDetailUpdateOne) SetDictionariesID(id uint64) *DictionaryDetailUpdateOne

SetDictionariesID sets the "dictionaries" edge to the Dictionary entity by ID.

func (*DictionaryDetailUpdateOne) SetDictionaryID

SetDictionaryID sets the "dictionary_id" field.

func (*DictionaryDetailUpdateOne) SetKey

SetKey sets the "key" field.

func (*DictionaryDetailUpdateOne) SetNillableDictionariesID

func (dduo *DictionaryDetailUpdateOne) SetNillableDictionariesID(id *uint64) *DictionaryDetailUpdateOne

SetNillableDictionariesID sets the "dictionaries" edge to the Dictionary entity by ID if the given value is not nil.

func (*DictionaryDetailUpdateOne) SetNillableDictionaryID

func (dduo *DictionaryDetailUpdateOne) SetNillableDictionaryID(u *uint64) *DictionaryDetailUpdateOne

SetNillableDictionaryID sets the "dictionary_id" field if the given value is not nil.

func (*DictionaryDetailUpdateOne) SetNillableKey added in v1.2.3

SetNillableKey sets the "key" field if the given value is not nil.

func (*DictionaryDetailUpdateOne) SetNillableSort

func (dduo *DictionaryDetailUpdateOne) SetNillableSort(u *uint32) *DictionaryDetailUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (*DictionaryDetailUpdateOne) SetNillableStatus

func (dduo *DictionaryDetailUpdateOne) SetNillableStatus(u *uint8) *DictionaryDetailUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*DictionaryDetailUpdateOne) SetNillableTitle added in v1.2.3

func (dduo *DictionaryDetailUpdateOne) SetNillableTitle(s *string) *DictionaryDetailUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*DictionaryDetailUpdateOne) SetNillableValue added in v1.2.3

func (dduo *DictionaryDetailUpdateOne) SetNillableValue(s *string) *DictionaryDetailUpdateOne

SetNillableValue sets the "value" field if the given value is not nil.

func (*DictionaryDetailUpdateOne) SetNotEmptyDictionaryID

func (dd *DictionaryDetailUpdateOne) SetNotEmptyDictionaryID(value uint64) *DictionaryDetailUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdateOne) SetNotEmptyKey

func (dd *DictionaryDetailUpdateOne) SetNotEmptyKey(value string) *DictionaryDetailUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdateOne) SetNotEmptySort

func (dd *DictionaryDetailUpdateOne) SetNotEmptySort(value uint32) *DictionaryDetailUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdateOne) SetNotEmptyStatus

func (dd *DictionaryDetailUpdateOne) SetNotEmptyStatus(value uint8) *DictionaryDetailUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdateOne) SetNotEmptyTitle

func (dd *DictionaryDetailUpdateOne) SetNotEmptyTitle(value string) *DictionaryDetailUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdateOne) SetNotEmptyValue

func (dd *DictionaryDetailUpdateOne) SetNotEmptyValue(value string) *DictionaryDetailUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryDetailUpdateOne) SetNotNilDictionaryID added in v1.0.9

func (dd *DictionaryDetailUpdateOne) SetNotNilDictionaryID(value *uint64) *DictionaryDetailUpdateOne

set field if value's pointer is not nil.

func (*DictionaryDetailUpdateOne) SetNotNilKey added in v1.0.9

set field if value's pointer is not nil.

func (*DictionaryDetailUpdateOne) SetNotNilSort added in v1.0.9

func (dd *DictionaryDetailUpdateOne) SetNotNilSort(value *uint32) *DictionaryDetailUpdateOne

set field if value's pointer is not nil.

func (*DictionaryDetailUpdateOne) SetNotNilStatus added in v1.0.9

func (dd *DictionaryDetailUpdateOne) SetNotNilStatus(value *uint8) *DictionaryDetailUpdateOne

set field if value's pointer is not nil.

func (*DictionaryDetailUpdateOne) SetNotNilTitle added in v1.0.9

func (dd *DictionaryDetailUpdateOne) SetNotNilTitle(value *string) *DictionaryDetailUpdateOne

set field if value's pointer is not nil.

func (*DictionaryDetailUpdateOne) SetNotNilUpdatedAt added in v1.0.9

func (dd *DictionaryDetailUpdateOne) SetNotNilUpdatedAt(value *time.Time) *DictionaryDetailUpdateOne

set field if value's pointer is not nil.

func (*DictionaryDetailUpdateOne) SetNotNilValue added in v1.0.9

func (dd *DictionaryDetailUpdateOne) SetNotNilValue(value *string) *DictionaryDetailUpdateOne

set field if value's pointer is not nil.

func (*DictionaryDetailUpdateOne) SetSort

SetSort sets the "sort" field.

func (*DictionaryDetailUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*DictionaryDetailUpdateOne) SetTitle

SetTitle sets the "title" field.

func (*DictionaryDetailUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*DictionaryDetailUpdateOne) SetValue

SetValue sets the "value" field.

func (*DictionaryDetailUpdateOne) Where

Where appends a list predicates to the DictionaryDetailUpdate builder.

type DictionaryDetails

type DictionaryDetails []*DictionaryDetail

DictionaryDetails is a parsable slice of DictionaryDetail.

type DictionaryEdges

type DictionaryEdges struct {
	// DictionaryDetails holds the value of the dictionary_details edge.
	DictionaryDetails []*DictionaryDetail `json:"dictionary_details,omitempty"`
	// contains filtered or unexported fields
}

DictionaryEdges holds the relations/edges for other nodes in the graph.

func (DictionaryEdges) DictionaryDetailsOrErr

func (e DictionaryEdges) DictionaryDetailsOrErr() ([]*DictionaryDetail, error)

DictionaryDetailsOrErr returns the DictionaryDetails value or an error if the edge was not loaded in eager-loading.

type DictionaryGroupBy

type DictionaryGroupBy struct {
	// contains filtered or unexported fields
}

DictionaryGroupBy is the group-by builder for Dictionary entities.

func (*DictionaryGroupBy) Aggregate

func (dgb *DictionaryGroupBy) Aggregate(fns ...AggregateFunc) *DictionaryGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*DictionaryGroupBy) Bool

func (s *DictionaryGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DictionaryGroupBy) BoolX

func (s *DictionaryGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DictionaryGroupBy) Bools

func (s *DictionaryGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DictionaryGroupBy) BoolsX

func (s *DictionaryGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*DictionaryGroupBy) Float64

func (s *DictionaryGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DictionaryGroupBy) Float64X

func (s *DictionaryGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DictionaryGroupBy) Float64s

func (s *DictionaryGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DictionaryGroupBy) Float64sX

func (s *DictionaryGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DictionaryGroupBy) Int

func (s *DictionaryGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DictionaryGroupBy) IntX

func (s *DictionaryGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DictionaryGroupBy) Ints

func (s *DictionaryGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DictionaryGroupBy) IntsX

func (s *DictionaryGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*DictionaryGroupBy) Scan

func (dgb *DictionaryGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DictionaryGroupBy) ScanX

func (s *DictionaryGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DictionaryGroupBy) String

func (s *DictionaryGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DictionaryGroupBy) StringX

func (s *DictionaryGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DictionaryGroupBy) Strings

func (s *DictionaryGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DictionaryGroupBy) StringsX

func (s *DictionaryGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DictionaryMutation

type DictionaryMutation struct {
	// contains filtered or unexported fields
}

DictionaryMutation represents an operation that mutates the Dictionary nodes in the graph.

func (*DictionaryMutation) AddDictionaryDetailIDs

func (m *DictionaryMutation) AddDictionaryDetailIDs(ids ...uint64)

AddDictionaryDetailIDs adds the "dictionary_details" edge to the DictionaryDetail entity by ids.

func (*DictionaryMutation) AddField

func (m *DictionaryMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DictionaryMutation) AddStatus

func (m *DictionaryMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*DictionaryMutation) AddedEdges

func (m *DictionaryMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*DictionaryMutation) AddedField

func (m *DictionaryMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DictionaryMutation) AddedFields

func (m *DictionaryMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*DictionaryMutation) AddedIDs

func (m *DictionaryMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*DictionaryMutation) AddedStatus

func (m *DictionaryMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*DictionaryMutation) ClearDesc added in v1.0.10

func (m *DictionaryMutation) ClearDesc()

ClearDesc clears the value of the "desc" field.

func (*DictionaryMutation) ClearDictionaryDetails

func (m *DictionaryMutation) ClearDictionaryDetails()

ClearDictionaryDetails clears the "dictionary_details" edge to the DictionaryDetail entity.

func (*DictionaryMutation) ClearEdge

func (m *DictionaryMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*DictionaryMutation) ClearField

func (m *DictionaryMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*DictionaryMutation) ClearStatus

func (m *DictionaryMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*DictionaryMutation) ClearedEdges

func (m *DictionaryMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*DictionaryMutation) ClearedFields

func (m *DictionaryMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (DictionaryMutation) Client

func (m DictionaryMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*DictionaryMutation) CreatedAt

func (m *DictionaryMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*DictionaryMutation) Desc

func (m *DictionaryMutation) Desc() (r string, exists bool)

Desc returns the value of the "desc" field in the mutation.

func (*DictionaryMutation) DescCleared added in v1.0.10

func (m *DictionaryMutation) DescCleared() bool

DescCleared returns if the "desc" field was cleared in this mutation.

func (*DictionaryMutation) DictionaryDetailsCleared

func (m *DictionaryMutation) DictionaryDetailsCleared() bool

DictionaryDetailsCleared reports if the "dictionary_details" edge to the DictionaryDetail entity was cleared.

func (*DictionaryMutation) DictionaryDetailsIDs

func (m *DictionaryMutation) DictionaryDetailsIDs() (ids []uint64)

DictionaryDetailsIDs returns the "dictionary_details" edge IDs in the mutation.

func (*DictionaryMutation) EdgeCleared

func (m *DictionaryMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*DictionaryMutation) ExecContext added in v1.0.9

func (c *DictionaryMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryMutation) Field

func (m *DictionaryMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*DictionaryMutation) FieldCleared

func (m *DictionaryMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*DictionaryMutation) Fields

func (m *DictionaryMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*DictionaryMutation) ID

func (m *DictionaryMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*DictionaryMutation) IDs

func (m *DictionaryMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*DictionaryMutation) Name

func (m *DictionaryMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*DictionaryMutation) OldCreatedAt

func (m *DictionaryMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Dictionary entity. If the Dictionary object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryMutation) OldDesc

func (m *DictionaryMutation) OldDesc(ctx context.Context) (v string, err error)

OldDesc returns the old "desc" field's value of the Dictionary entity. If the Dictionary object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryMutation) OldField

func (m *DictionaryMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*DictionaryMutation) OldName

func (m *DictionaryMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Dictionary entity. If the Dictionary object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryMutation) OldStatus

func (m *DictionaryMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the Dictionary entity. If the Dictionary object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryMutation) OldTitle

func (m *DictionaryMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Dictionary entity. If the Dictionary object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryMutation) OldUpdatedAt

func (m *DictionaryMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Dictionary entity. If the Dictionary object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*DictionaryMutation) Op

func (m *DictionaryMutation) Op() Op

Op returns the operation name.

func (*DictionaryMutation) QueryContext added in v1.0.9

func (c *DictionaryMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryMutation) RemoveDictionaryDetailIDs

func (m *DictionaryMutation) RemoveDictionaryDetailIDs(ids ...uint64)

RemoveDictionaryDetailIDs removes the "dictionary_details" edge to the DictionaryDetail entity by IDs.

func (*DictionaryMutation) RemovedDictionaryDetailsIDs

func (m *DictionaryMutation) RemovedDictionaryDetailsIDs() (ids []uint64)

RemovedDictionaryDetails returns the removed IDs of the "dictionary_details" edge to the DictionaryDetail entity.

func (*DictionaryMutation) RemovedEdges

func (m *DictionaryMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*DictionaryMutation) RemovedIDs

func (m *DictionaryMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*DictionaryMutation) ResetCreatedAt

func (m *DictionaryMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DictionaryMutation) ResetDesc

func (m *DictionaryMutation) ResetDesc()

ResetDesc resets all changes to the "desc" field.

func (*DictionaryMutation) ResetDictionaryDetails

func (m *DictionaryMutation) ResetDictionaryDetails()

ResetDictionaryDetails resets all changes to the "dictionary_details" edge.

func (*DictionaryMutation) ResetEdge

func (m *DictionaryMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*DictionaryMutation) ResetField

func (m *DictionaryMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*DictionaryMutation) ResetName

func (m *DictionaryMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DictionaryMutation) ResetStatus

func (m *DictionaryMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*DictionaryMutation) ResetTitle

func (m *DictionaryMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*DictionaryMutation) ResetUpdatedAt

func (m *DictionaryMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DictionaryMutation) SetCreatedAt

func (m *DictionaryMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*DictionaryMutation) SetDesc

func (m *DictionaryMutation) SetDesc(s string)

SetDesc sets the "desc" field.

func (*DictionaryMutation) SetField

func (m *DictionaryMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*DictionaryMutation) SetID

func (m *DictionaryMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Dictionary entities.

func (*DictionaryMutation) SetName

func (m *DictionaryMutation) SetName(s string)

SetName sets the "name" field.

func (*DictionaryMutation) SetOp

func (m *DictionaryMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DictionaryMutation) SetStatus

func (m *DictionaryMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*DictionaryMutation) SetTitle

func (m *DictionaryMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*DictionaryMutation) SetUpdatedAt

func (m *DictionaryMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*DictionaryMutation) Status

func (m *DictionaryMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*DictionaryMutation) StatusCleared

func (m *DictionaryMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (*DictionaryMutation) Title

func (m *DictionaryMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (DictionaryMutation) Tx

func (m DictionaryMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*DictionaryMutation) Type

func (m *DictionaryMutation) Type() string

Type returns the node type of this mutation (Dictionary).

func (*DictionaryMutation) UpdatedAt

func (m *DictionaryMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*DictionaryMutation) Where

func (m *DictionaryMutation) Where(ps ...predicate.Dictionary)

Where appends a list predicates to the DictionaryMutation builder.

func (*DictionaryMutation) WhereP

func (m *DictionaryMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the DictionaryMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type DictionaryPageList

type DictionaryPageList struct {
	List        []*Dictionary `json:"list"`
	PageDetails *PageDetails  `json:"pageDetails"`
}

DictionaryPageList is Dictionary PageList result.

type DictionaryPager

type DictionaryPager struct {
	Order  dictionary.OrderOption
	Filter func(*DictionaryQuery) (*DictionaryQuery, error)
}

func (*DictionaryPager) ApplyFilter

func (p *DictionaryPager) ApplyFilter(query *DictionaryQuery) (*DictionaryQuery, error)

type DictionaryPaginateOption

type DictionaryPaginateOption func(*DictionaryPager)

DictionaryPaginateOption enables pagination customization.

type DictionaryQuery

type DictionaryQuery struct {
	// contains filtered or unexported fields
}

DictionaryQuery is the builder for querying Dictionary entities.

func (*DictionaryQuery) Aggregate

func (dq *DictionaryQuery) Aggregate(fns ...AggregateFunc) *DictionarySelect

Aggregate returns a DictionarySelect configured with the given aggregations.

func (*DictionaryQuery) All

func (dq *DictionaryQuery) All(ctx context.Context) ([]*Dictionary, error)

All executes the query and returns a list of Dictionaries.

func (*DictionaryQuery) AllX

func (dq *DictionaryQuery) AllX(ctx context.Context) []*Dictionary

AllX is like All, but panics if an error occurs.

func (*DictionaryQuery) Clone

func (dq *DictionaryQuery) Clone() *DictionaryQuery

Clone returns a duplicate of the DictionaryQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*DictionaryQuery) Count

func (dq *DictionaryQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DictionaryQuery) CountX

func (dq *DictionaryQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*DictionaryQuery) ExecContext added in v1.0.9

func (c *DictionaryQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryQuery) Exist

func (dq *DictionaryQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*DictionaryQuery) ExistX

func (dq *DictionaryQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*DictionaryQuery) First

func (dq *DictionaryQuery) First(ctx context.Context) (*Dictionary, error)

First returns the first Dictionary entity from the query. Returns a *NotFoundError when no Dictionary was found.

func (*DictionaryQuery) FirstID

func (dq *DictionaryQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Dictionary ID from the query. Returns a *NotFoundError when no Dictionary ID was found.

func (*DictionaryQuery) FirstIDX

func (dq *DictionaryQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*DictionaryQuery) FirstX

func (dq *DictionaryQuery) FirstX(ctx context.Context) *Dictionary

FirstX is like First, but panics if an error occurs.

func (*DictionaryQuery) GroupBy

func (dq *DictionaryQuery) GroupBy(field string, fields ...string) *DictionaryGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Dictionary.Query().
	GroupBy(dictionary.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DictionaryQuery) IDs

func (dq *DictionaryQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Dictionary IDs.

func (*DictionaryQuery) IDsX

func (dq *DictionaryQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*DictionaryQuery) Limit

func (dq *DictionaryQuery) Limit(limit int) *DictionaryQuery

Limit the number of records to be returned by this query.

func (*DictionaryQuery) Offset

func (dq *DictionaryQuery) Offset(offset int) *DictionaryQuery

Offset to start from.

func (*DictionaryQuery) Only

func (dq *DictionaryQuery) Only(ctx context.Context) (*Dictionary, error)

Only returns a single Dictionary entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Dictionary entity is found. Returns a *NotFoundError when no Dictionary entities are found.

func (*DictionaryQuery) OnlyID

func (dq *DictionaryQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Dictionary ID in the query. Returns a *NotSingularError when more than one Dictionary ID is found. Returns a *NotFoundError when no entities are found.

func (*DictionaryQuery) OnlyIDX

func (dq *DictionaryQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*DictionaryQuery) OnlyX

func (dq *DictionaryQuery) OnlyX(ctx context.Context) *Dictionary

OnlyX is like Only, but panics if an error occurs.

func (*DictionaryQuery) Order

Order specifies how the records should be ordered.

func (*DictionaryQuery) Page

func (d *DictionaryQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...DictionaryPaginateOption,
) (*DictionaryPageList, error)

func (*DictionaryQuery) QueryContext added in v1.0.9

func (c *DictionaryQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryQuery) QueryDictionaryDetails

func (dq *DictionaryQuery) QueryDictionaryDetails() *DictionaryDetailQuery

QueryDictionaryDetails chains the current query on the "dictionary_details" edge.

func (*DictionaryQuery) Select

func (dq *DictionaryQuery) Select(fields ...string) *DictionarySelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Dictionary.Query().
	Select(dictionary.FieldCreatedAt).
	Scan(ctx, &v)

func (*DictionaryQuery) Unique

func (dq *DictionaryQuery) Unique(unique bool) *DictionaryQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*DictionaryQuery) Where

Where adds a new predicate for the DictionaryQuery builder.

func (*DictionaryQuery) WithDictionaryDetails

func (dq *DictionaryQuery) WithDictionaryDetails(opts ...func(*DictionaryDetailQuery)) *DictionaryQuery

WithDictionaryDetails tells the query-builder to eager-load the nodes that are connected to the "dictionary_details" edge. The optional arguments are used to configure the query builder of the edge.

type DictionarySelect

type DictionarySelect struct {
	*DictionaryQuery
	// contains filtered or unexported fields
}

DictionarySelect is the builder for selecting fields of Dictionary entities.

func (*DictionarySelect) Aggregate

func (ds *DictionarySelect) Aggregate(fns ...AggregateFunc) *DictionarySelect

Aggregate adds the given aggregation functions to the selector query.

func (*DictionarySelect) Bool

func (s *DictionarySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*DictionarySelect) BoolX

func (s *DictionarySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*DictionarySelect) Bools

func (s *DictionarySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*DictionarySelect) BoolsX

func (s *DictionarySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (DictionarySelect) ExecContext added in v1.0.9

func (c DictionarySelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionarySelect) Float64

func (s *DictionarySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*DictionarySelect) Float64X

func (s *DictionarySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*DictionarySelect) Float64s

func (s *DictionarySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*DictionarySelect) Float64sX

func (s *DictionarySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*DictionarySelect) Int

func (s *DictionarySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*DictionarySelect) IntX

func (s *DictionarySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*DictionarySelect) Ints

func (s *DictionarySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*DictionarySelect) IntsX

func (s *DictionarySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (DictionarySelect) QueryContext added in v1.0.9

func (c DictionarySelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionarySelect) Scan

func (ds *DictionarySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*DictionarySelect) ScanX

func (s *DictionarySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*DictionarySelect) String

func (s *DictionarySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*DictionarySelect) StringX

func (s *DictionarySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*DictionarySelect) Strings

func (s *DictionarySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DictionarySelect) StringsX

func (s *DictionarySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DictionaryUpdate

type DictionaryUpdate struct {
	// contains filtered or unexported fields
}

DictionaryUpdate is the builder for updating Dictionary entities.

func (*DictionaryUpdate) AddDictionaryDetailIDs

func (du *DictionaryUpdate) AddDictionaryDetailIDs(ids ...uint64) *DictionaryUpdate

AddDictionaryDetailIDs adds the "dictionary_details" edge to the DictionaryDetail entity by IDs.

func (*DictionaryUpdate) AddDictionaryDetails

func (du *DictionaryUpdate) AddDictionaryDetails(d ...*DictionaryDetail) *DictionaryUpdate

AddDictionaryDetails adds the "dictionary_details" edges to the DictionaryDetail entity.

func (*DictionaryUpdate) AddStatus

func (du *DictionaryUpdate) AddStatus(u int8) *DictionaryUpdate

AddStatus adds u to the "status" field.

func (*DictionaryUpdate) ClearDesc added in v1.0.10

func (du *DictionaryUpdate) ClearDesc() *DictionaryUpdate

ClearDesc clears the value of the "desc" field.

func (*DictionaryUpdate) ClearDictionaryDetails

func (du *DictionaryUpdate) ClearDictionaryDetails() *DictionaryUpdate

ClearDictionaryDetails clears all "dictionary_details" edges to the DictionaryDetail entity.

func (*DictionaryUpdate) ClearStatus

func (du *DictionaryUpdate) ClearStatus() *DictionaryUpdate

ClearStatus clears the value of the "status" field.

func (*DictionaryUpdate) Exec

func (du *DictionaryUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DictionaryUpdate) ExecContext added in v1.0.9

func (c *DictionaryUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryUpdate) ExecX

func (du *DictionaryUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryUpdate) Mutation

func (du *DictionaryUpdate) Mutation() *DictionaryMutation

Mutation returns the DictionaryMutation object of the builder.

func (*DictionaryUpdate) QueryContext added in v1.0.9

func (c *DictionaryUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryUpdate) RemoveDictionaryDetailIDs

func (du *DictionaryUpdate) RemoveDictionaryDetailIDs(ids ...uint64) *DictionaryUpdate

RemoveDictionaryDetailIDs removes the "dictionary_details" edge to DictionaryDetail entities by IDs.

func (*DictionaryUpdate) RemoveDictionaryDetails

func (du *DictionaryUpdate) RemoveDictionaryDetails(d ...*DictionaryDetail) *DictionaryUpdate

RemoveDictionaryDetails removes "dictionary_details" edges to DictionaryDetail entities.

func (*DictionaryUpdate) Save

func (du *DictionaryUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DictionaryUpdate) SaveX

func (du *DictionaryUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DictionaryUpdate) SetDesc

func (du *DictionaryUpdate) SetDesc(s string) *DictionaryUpdate

SetDesc sets the "desc" field.

func (*DictionaryUpdate) SetName

func (du *DictionaryUpdate) SetName(s string) *DictionaryUpdate

SetName sets the "name" field.

func (*DictionaryUpdate) SetNillableDesc added in v1.0.10

func (du *DictionaryUpdate) SetNillableDesc(s *string) *DictionaryUpdate

SetNillableDesc sets the "desc" field if the given value is not nil.

func (*DictionaryUpdate) SetNillableName added in v1.2.3

func (du *DictionaryUpdate) SetNillableName(s *string) *DictionaryUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*DictionaryUpdate) SetNillableStatus

func (du *DictionaryUpdate) SetNillableStatus(u *uint8) *DictionaryUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*DictionaryUpdate) SetNillableTitle added in v1.2.3

func (du *DictionaryUpdate) SetNillableTitle(s *string) *DictionaryUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*DictionaryUpdate) SetNotEmptyDesc

func (d *DictionaryUpdate) SetNotEmptyDesc(value string) *DictionaryUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryUpdate) SetNotEmptyName

func (d *DictionaryUpdate) SetNotEmptyName(value string) *DictionaryUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryUpdate) SetNotEmptyStatus

func (d *DictionaryUpdate) SetNotEmptyStatus(value uint8) *DictionaryUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryUpdate) SetNotEmptyTitle

func (d *DictionaryUpdate) SetNotEmptyTitle(value string) *DictionaryUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryUpdate) SetNotNilDesc added in v1.0.9

func (d *DictionaryUpdate) SetNotNilDesc(value *string) *DictionaryUpdate

set field if value's pointer is not nil.

func (*DictionaryUpdate) SetNotNilName added in v1.0.9

func (d *DictionaryUpdate) SetNotNilName(value *string) *DictionaryUpdate

set field if value's pointer is not nil.

func (*DictionaryUpdate) SetNotNilStatus added in v1.0.9

func (d *DictionaryUpdate) SetNotNilStatus(value *uint8) *DictionaryUpdate

set field if value's pointer is not nil.

func (*DictionaryUpdate) SetNotNilTitle added in v1.0.9

func (d *DictionaryUpdate) SetNotNilTitle(value *string) *DictionaryUpdate

set field if value's pointer is not nil.

func (*DictionaryUpdate) SetNotNilUpdatedAt added in v1.0.9

func (d *DictionaryUpdate) SetNotNilUpdatedAt(value *time.Time) *DictionaryUpdate

set field if value's pointer is not nil.

func (*DictionaryUpdate) SetStatus

func (du *DictionaryUpdate) SetStatus(u uint8) *DictionaryUpdate

SetStatus sets the "status" field.

func (*DictionaryUpdate) SetTitle

func (du *DictionaryUpdate) SetTitle(s string) *DictionaryUpdate

SetTitle sets the "title" field.

func (*DictionaryUpdate) SetUpdatedAt

func (du *DictionaryUpdate) SetUpdatedAt(t time.Time) *DictionaryUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DictionaryUpdate) Where

Where appends a list predicates to the DictionaryUpdate builder.

type DictionaryUpdateOne

type DictionaryUpdateOne struct {
	// contains filtered or unexported fields
}

DictionaryUpdateOne is the builder for updating a single Dictionary entity.

func (*DictionaryUpdateOne) AddDictionaryDetailIDs

func (duo *DictionaryUpdateOne) AddDictionaryDetailIDs(ids ...uint64) *DictionaryUpdateOne

AddDictionaryDetailIDs adds the "dictionary_details" edge to the DictionaryDetail entity by IDs.

func (*DictionaryUpdateOne) AddDictionaryDetails

func (duo *DictionaryUpdateOne) AddDictionaryDetails(d ...*DictionaryDetail) *DictionaryUpdateOne

AddDictionaryDetails adds the "dictionary_details" edges to the DictionaryDetail entity.

func (*DictionaryUpdateOne) AddStatus

func (duo *DictionaryUpdateOne) AddStatus(u int8) *DictionaryUpdateOne

AddStatus adds u to the "status" field.

func (*DictionaryUpdateOne) ClearDesc added in v1.0.10

func (duo *DictionaryUpdateOne) ClearDesc() *DictionaryUpdateOne

ClearDesc clears the value of the "desc" field.

func (*DictionaryUpdateOne) ClearDictionaryDetails

func (duo *DictionaryUpdateOne) ClearDictionaryDetails() *DictionaryUpdateOne

ClearDictionaryDetails clears all "dictionary_details" edges to the DictionaryDetail entity.

func (*DictionaryUpdateOne) ClearStatus

func (duo *DictionaryUpdateOne) ClearStatus() *DictionaryUpdateOne

ClearStatus clears the value of the "status" field.

func (*DictionaryUpdateOne) Exec

func (duo *DictionaryUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DictionaryUpdateOne) ExecContext added in v1.0.9

func (c *DictionaryUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*DictionaryUpdateOne) ExecX

func (duo *DictionaryUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DictionaryUpdateOne) Mutation

func (duo *DictionaryUpdateOne) Mutation() *DictionaryMutation

Mutation returns the DictionaryMutation object of the builder.

func (*DictionaryUpdateOne) QueryContext added in v1.0.9

func (c *DictionaryUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*DictionaryUpdateOne) RemoveDictionaryDetailIDs

func (duo *DictionaryUpdateOne) RemoveDictionaryDetailIDs(ids ...uint64) *DictionaryUpdateOne

RemoveDictionaryDetailIDs removes the "dictionary_details" edge to DictionaryDetail entities by IDs.

func (*DictionaryUpdateOne) RemoveDictionaryDetails

func (duo *DictionaryUpdateOne) RemoveDictionaryDetails(d ...*DictionaryDetail) *DictionaryUpdateOne

RemoveDictionaryDetails removes "dictionary_details" edges to DictionaryDetail entities.

func (*DictionaryUpdateOne) Save

func (duo *DictionaryUpdateOne) Save(ctx context.Context) (*Dictionary, error)

Save executes the query and returns the updated Dictionary entity.

func (*DictionaryUpdateOne) SaveX

func (duo *DictionaryUpdateOne) SaveX(ctx context.Context) *Dictionary

SaveX is like Save, but panics if an error occurs.

func (*DictionaryUpdateOne) Select

func (duo *DictionaryUpdateOne) Select(field string, fields ...string) *DictionaryUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DictionaryUpdateOne) SetDesc

SetDesc sets the "desc" field.

func (*DictionaryUpdateOne) SetName

SetName sets the "name" field.

func (*DictionaryUpdateOne) SetNillableDesc added in v1.0.10

func (duo *DictionaryUpdateOne) SetNillableDesc(s *string) *DictionaryUpdateOne

SetNillableDesc sets the "desc" field if the given value is not nil.

func (*DictionaryUpdateOne) SetNillableName added in v1.2.3

func (duo *DictionaryUpdateOne) SetNillableName(s *string) *DictionaryUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*DictionaryUpdateOne) SetNillableStatus

func (duo *DictionaryUpdateOne) SetNillableStatus(u *uint8) *DictionaryUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*DictionaryUpdateOne) SetNillableTitle added in v1.2.3

func (duo *DictionaryUpdateOne) SetNillableTitle(s *string) *DictionaryUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*DictionaryUpdateOne) SetNotEmptyDesc

func (d *DictionaryUpdateOne) SetNotEmptyDesc(value string) *DictionaryUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryUpdateOne) SetNotEmptyName

func (d *DictionaryUpdateOne) SetNotEmptyName(value string) *DictionaryUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryUpdateOne) SetNotEmptyStatus

func (d *DictionaryUpdateOne) SetNotEmptyStatus(value uint8) *DictionaryUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryUpdateOne) SetNotEmptyTitle

func (d *DictionaryUpdateOne) SetNotEmptyTitle(value string) *DictionaryUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*DictionaryUpdateOne) SetNotNilDesc added in v1.0.9

func (d *DictionaryUpdateOne) SetNotNilDesc(value *string) *DictionaryUpdateOne

set field if value's pointer is not nil.

func (*DictionaryUpdateOne) SetNotNilName added in v1.0.9

func (d *DictionaryUpdateOne) SetNotNilName(value *string) *DictionaryUpdateOne

set field if value's pointer is not nil.

func (*DictionaryUpdateOne) SetNotNilStatus added in v1.0.9

func (d *DictionaryUpdateOne) SetNotNilStatus(value *uint8) *DictionaryUpdateOne

set field if value's pointer is not nil.

func (*DictionaryUpdateOne) SetNotNilTitle added in v1.0.9

func (d *DictionaryUpdateOne) SetNotNilTitle(value *string) *DictionaryUpdateOne

set field if value's pointer is not nil.

func (*DictionaryUpdateOne) SetNotNilUpdatedAt added in v1.0.9

func (d *DictionaryUpdateOne) SetNotNilUpdatedAt(value *time.Time) *DictionaryUpdateOne

set field if value's pointer is not nil.

func (*DictionaryUpdateOne) SetStatus

func (duo *DictionaryUpdateOne) SetStatus(u uint8) *DictionaryUpdateOne

SetStatus sets the "status" field.

func (*DictionaryUpdateOne) SetTitle

SetTitle sets the "title" field.

func (*DictionaryUpdateOne) SetUpdatedAt

func (duo *DictionaryUpdateOne) SetUpdatedAt(t time.Time) *DictionaryUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*DictionaryUpdateOne) Where

Where appends a list predicates to the DictionaryUpdate builder.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type Menu struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Sort Number | 排序编号
	Sort uint32 `json:"sort,omitempty"`
	// Parent menu ID | 父菜单ID
	ParentID uint64 `json:"parent_id,omitempty"`
	// Menu level | 菜单层级
	MenuLevel uint32 `json:"menu_level,omitempty"`
	// Menu type | 菜单类型 (菜单或目录)0 目录 1 菜单
	MenuType uint32 `json:"menu_type,omitempty"`
	// Index path | 菜单路由路径
	Path string `json:"path,omitempty"`
	// Index name | 菜单名称
	Name string `json:"name,omitempty"`
	// Redirect path | 跳转路径 (外链)
	Redirect string `json:"redirect,omitempty"`
	// The path of vue file | 组件路径
	Component string `json:"component,omitempty"`
	// Disable status | 是否停用
	Disabled bool `json:"disabled,omitempty"`
	// Menu name | 菜单显示标题
	Title string `json:"title,omitempty"`
	// Menu icon | 菜单图标
	Icon string `json:"icon,omitempty"`
	// Hide menu | 是否隐藏菜单
	HideMenu bool `json:"hide_menu,omitempty"`
	// Hide the breadcrumb | 隐藏面包屑
	HideBreadcrumb bool `json:"hide_breadcrumb,omitempty"`
	// Do not keep alive the tab | 取消页面缓存
	IgnoreKeepAlive bool `json:"ignore_keep_alive,omitempty"`
	// Hide the tab header | 隐藏页头
	HideTab bool `json:"hide_tab,omitempty"`
	// Show iframe | 内嵌 iframe
	FrameSrc string `json:"frame_src,omitempty"`
	// The route carries parameters or not | 携带参数
	CarryParam bool `json:"carry_param,omitempty"`
	// Hide children menu or not | 隐藏所有子菜单
	HideChildrenInMenu bool `json:"hide_children_in_menu,omitempty"`
	// Affix tab | Tab 固定
	Affix bool `json:"affix,omitempty"`
	// The maximum number of pages the router can open | 能打开的子TAB数
	DynamicLevel uint32 `json:"dynamic_level,omitempty"`
	// The real path of the route without dynamic part | 菜单路由不包含参数部分
	RealPath string `json:"real_path,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MenuQuery when eager-loading is set.
	Edges MenuEdges `json:"edges"`
	// contains filtered or unexported fields
}

Menu is the model entity for the Menu schema.

func (c *Menu) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (m *Menu) QueryChildren() *MenuQuery

QueryChildren queries the "children" edge of the Menu entity.

func (c *Menu) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (m *Menu) QueryParent() *MenuQuery

QueryParent queries the "parent" edge of the Menu entity.

func (m *Menu) QueryRoles() *RoleQuery

QueryRoles queries the "roles" edge of the Menu entity.

func (m *Menu) String() string

String implements the fmt.Stringer.

func (m *Menu) Unwrap() *Menu

Unwrap unwraps the Menu entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (m *Menu) Update() *MenuUpdateOne

Update returns a builder for updating this Menu. Note that you need to call Menu.Unwrap() before calling this method if this Menu was returned from a transaction, and the transaction was committed or rolled back.

func (m *Menu) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Menu. This includes values selected through modifiers, order, etc.

type MenuClient struct {
	// contains filtered or unexported fields
}

MenuClient is a client for the Menu schema.

func NewMenuClient

func NewMenuClient(c config) *MenuClient

NewMenuClient returns a client for the Menu from the given config.

func (c *MenuClient) Create() *MenuCreate

Create returns a builder for creating a Menu entity.

func (c *MenuClient) CreateBulk(builders ...*MenuCreate) *MenuCreateBulk

CreateBulk returns a builder for creating a bulk of Menu entities.

func (c *MenuClient) Delete() *MenuDelete

Delete returns a delete builder for Menu.

func (c *MenuClient) DeleteOne(m *Menu) *MenuDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (c *MenuClient) DeleteOneID(id uint64) *MenuDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (c *MenuClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (c *MenuClient) Get(ctx context.Context, id uint64) (*Menu, error)

Get returns a Menu entity by its id.

func (c *MenuClient) GetX(ctx context.Context, id uint64) *Menu

GetX is like Get, but panics if an error occurs.

func (c *MenuClient) Hooks() []Hook

Hooks returns the client hooks.

func (c *MenuClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `menu.Intercept(f(g(h())))`.

func (c *MenuClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (c *MenuClient) MapCreateBulk(slice any, setFunc func(*MenuCreate, int)) *MenuCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (c *MenuClient) Query() *MenuQuery

Query returns a query builder for Menu.

func (c *MenuClient) QueryChildren(m *Menu) *MenuQuery

QueryChildren queries the children edge of a Menu.

func (c *MenuClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (c *MenuClient) QueryParent(m *Menu) *MenuQuery

QueryParent queries the parent edge of a Menu.

func (c *MenuClient) QueryRoles(m *Menu) *RoleQuery

QueryRoles queries the roles edge of a Menu.

func (c *MenuClient) Update() *MenuUpdate

Update returns an update builder for Menu.

func (c *MenuClient) UpdateOne(m *Menu) *MenuUpdateOne

UpdateOne returns an update builder for the given entity.

func (c *MenuClient) UpdateOneID(id uint64) *MenuUpdateOne

UpdateOneID returns an update builder for the given id.

func (c *MenuClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `menu.Hooks(f(g(h())))`.

type MenuCreate struct {
	// contains filtered or unexported fields
}

MenuCreate is the builder for creating a Menu entity.

func (mc *MenuCreate) AddChildIDs(ids ...uint64) *MenuCreate

AddChildIDs adds the "children" edge to the Menu entity by IDs.

func (mc *MenuCreate) AddChildren(m ...*Menu) *MenuCreate

AddChildren adds the "children" edges to the Menu entity.

func (mc *MenuCreate) AddRoleIDs(ids ...uint64) *MenuCreate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (mc *MenuCreate) AddRoles(r ...*Role) *MenuCreate

AddRoles adds the "roles" edges to the Role entity.

func (mc *MenuCreate) Exec(ctx context.Context) error

Exec executes the query.

func (c *MenuCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (mc *MenuCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (mc *MenuCreate) Mutation() *MenuMutation

Mutation returns the MenuMutation object of the builder.

func (c *MenuCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (mc *MenuCreate) Save(ctx context.Context) (*Menu, error)

Save creates the Menu in the database.

func (mc *MenuCreate) SaveX(ctx context.Context) *Menu

SaveX calls Save and panics if Save returns an error.

func (mc *MenuCreate) SetAffix(b bool) *MenuCreate

SetAffix sets the "affix" field.

func (mc *MenuCreate) SetCarryParam(b bool) *MenuCreate

SetCarryParam sets the "carry_param" field.

func (mc *MenuCreate) SetComponent(s string) *MenuCreate

SetComponent sets the "component" field.

func (mc *MenuCreate) SetCreatedAt(t time.Time) *MenuCreate

SetCreatedAt sets the "created_at" field.

func (mc *MenuCreate) SetDisabled(b bool) *MenuCreate

SetDisabled sets the "disabled" field.

func (mc *MenuCreate) SetDynamicLevel(u uint32) *MenuCreate

SetDynamicLevel sets the "dynamic_level" field.

func (mc *MenuCreate) SetFrameSrc(s string) *MenuCreate

SetFrameSrc sets the "frame_src" field.

func (mc *MenuCreate) SetHideBreadcrumb(b bool) *MenuCreate

SetHideBreadcrumb sets the "hide_breadcrumb" field.

func (mc *MenuCreate) SetHideChildrenInMenu(b bool) *MenuCreate

SetHideChildrenInMenu sets the "hide_children_in_menu" field.

func (mc *MenuCreate) SetHideMenu(b bool) *MenuCreate

SetHideMenu sets the "hide_menu" field.

func (mc *MenuCreate) SetHideTab(b bool) *MenuCreate

SetHideTab sets the "hide_tab" field.

func (mc *MenuCreate) SetID(u uint64) *MenuCreate

SetID sets the "id" field.

func (mc *MenuCreate) SetIcon(s string) *MenuCreate

SetIcon sets the "icon" field.

func (mc *MenuCreate) SetIgnoreKeepAlive(b bool) *MenuCreate

SetIgnoreKeepAlive sets the "ignore_keep_alive" field.

func (mc *MenuCreate) SetMenuLevel(u uint32) *MenuCreate

SetMenuLevel sets the "menu_level" field.

func (mc *MenuCreate) SetMenuType(u uint32) *MenuCreate

SetMenuType sets the "menu_type" field.

func (mc *MenuCreate) SetName(s string) *MenuCreate

SetName sets the "name" field.

func (mc *MenuCreate) SetNillableAffix(b *bool) *MenuCreate

SetNillableAffix sets the "affix" field if the given value is not nil.

func (mc *MenuCreate) SetNillableCarryParam(b *bool) *MenuCreate

SetNillableCarryParam sets the "carry_param" field if the given value is not nil.

func (mc *MenuCreate) SetNillableComponent(s *string) *MenuCreate

SetNillableComponent sets the "component" field if the given value is not nil.

func (mc *MenuCreate) SetNillableCreatedAt(t *time.Time) *MenuCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (mc *MenuCreate) SetNillableDisabled(b *bool) *MenuCreate

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (mc *MenuCreate) SetNillableDynamicLevel(u *uint32) *MenuCreate

SetNillableDynamicLevel sets the "dynamic_level" field if the given value is not nil.

func (mc *MenuCreate) SetNillableFrameSrc(s *string) *MenuCreate

SetNillableFrameSrc sets the "frame_src" field if the given value is not nil.

func (mc *MenuCreate) SetNillableHideBreadcrumb(b *bool) *MenuCreate

SetNillableHideBreadcrumb sets the "hide_breadcrumb" field if the given value is not nil.

func (mc *MenuCreate) SetNillableHideChildrenInMenu(b *bool) *MenuCreate

SetNillableHideChildrenInMenu sets the "hide_children_in_menu" field if the given value is not nil.

func (mc *MenuCreate) SetNillableHideMenu(b *bool) *MenuCreate

SetNillableHideMenu sets the "hide_menu" field if the given value is not nil.

func (mc *MenuCreate) SetNillableHideTab(b *bool) *MenuCreate

SetNillableHideTab sets the "hide_tab" field if the given value is not nil.

func (mc *MenuCreate) SetNillableIgnoreKeepAlive(b *bool) *MenuCreate

SetNillableIgnoreKeepAlive sets the "ignore_keep_alive" field if the given value is not nil.

func (mc *MenuCreate) SetNillableParentID(u *uint64) *MenuCreate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (mc *MenuCreate) SetNillablePath(s *string) *MenuCreate

SetNillablePath sets the "path" field if the given value is not nil.

func (mc *MenuCreate) SetNillableRealPath(s *string) *MenuCreate

SetNillableRealPath sets the "real_path" field if the given value is not nil.

func (mc *MenuCreate) SetNillableRedirect(s *string) *MenuCreate

SetNillableRedirect sets the "redirect" field if the given value is not nil.

func (mc *MenuCreate) SetNillableSort(u *uint32) *MenuCreate

SetNillableSort sets the "sort" field if the given value is not nil.

func (mc *MenuCreate) SetNillableUpdatedAt(t *time.Time) *MenuCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (m *MenuCreate) SetNotNilAffix(value *bool) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilCarryParam(value *bool) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilComponent(value *string) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilDisabled(value *bool) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilDynamicLevel(value *uint32) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilFrameSrc(value *string) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilHideBreadcrumb(value *bool) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilHideChildrenInMenu(value *bool) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilHideMenu(value *bool) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilHideTab(value *bool) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilIcon(value *string) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilIgnoreKeepAlive(value *bool) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilMenuLevel(value *uint32) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilMenuType(value *uint32) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilName(value *string) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilParentID(value *uint64) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilPath(value *string) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilRealPath(value *string) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilRedirect(value *string) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilSort(value *uint32) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilTitle(value *string) *MenuCreate

set field if value's pointer is not nil.

func (m *MenuCreate) SetNotNilUpdatedAt(value *time.Time) *MenuCreate

set field if value's pointer is not nil.

func (mc *MenuCreate) SetParent(m *Menu) *MenuCreate

SetParent sets the "parent" edge to the Menu entity.

func (mc *MenuCreate) SetParentID(u uint64) *MenuCreate

SetParentID sets the "parent_id" field.

func (mc *MenuCreate) SetPath(s string) *MenuCreate

SetPath sets the "path" field.

func (mc *MenuCreate) SetRealPath(s string) *MenuCreate

SetRealPath sets the "real_path" field.

func (mc *MenuCreate) SetRedirect(s string) *MenuCreate

SetRedirect sets the "redirect" field.

func (mc *MenuCreate) SetSort(u uint32) *MenuCreate

SetSort sets the "sort" field.

func (mc *MenuCreate) SetTitle(s string) *MenuCreate

SetTitle sets the "title" field.

func (mc *MenuCreate) SetUpdatedAt(t time.Time) *MenuCreate

SetUpdatedAt sets the "updated_at" field.

type MenuCreateBulk struct {
	// contains filtered or unexported fields
}

MenuCreateBulk is the builder for creating many Menu entities in bulk.

func (mcb *MenuCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (c *MenuCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (mcb *MenuCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (c *MenuCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (mcb *MenuCreateBulk) Save(ctx context.Context) ([]*Menu, error)

Save creates the Menu entities in the database.

func (mcb *MenuCreateBulk) SaveX(ctx context.Context) []*Menu

SaveX is like Save, but panics if an error occurs.

type MenuDelete struct {
	// contains filtered or unexported fields
}

MenuDelete is the builder for deleting a Menu entity.

func (md *MenuDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (c *MenuDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (md *MenuDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (c *MenuDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (md *MenuDelete) Where(ps ...predicate.Menu) *MenuDelete

Where appends a list predicates to the MenuDelete builder.

type MenuDeleteOne struct {
	// contains filtered or unexported fields
}

MenuDeleteOne is the builder for deleting a single Menu entity.

func (mdo *MenuDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (mdo *MenuDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (mdo *MenuDeleteOne) Where(ps ...predicate.Menu) *MenuDeleteOne

Where appends a list predicates to the MenuDelete builder.

type MenuEdges struct {
	// Roles holds the value of the roles edge.
	Roles []*Role `json:"roles,omitempty"`
	// Parent holds the value of the parent edge.
	Parent *Menu `json:"parent,omitempty"`
	// Children holds the value of the children edge.
	Children []*Menu `json:"children,omitempty"`
	// contains filtered or unexported fields
}

MenuEdges holds the relations/edges for other nodes in the graph.

func (e MenuEdges) ChildrenOrErr() ([]*Menu, error)

ChildrenOrErr returns the Children value or an error if the edge was not loaded in eager-loading.

func (e MenuEdges) ParentOrErr() (*Menu, error)

ParentOrErr returns the Parent value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (e MenuEdges) RolesOrErr() ([]*Role, error)

RolesOrErr returns the Roles value or an error if the edge was not loaded in eager-loading.

type MenuGroupBy struct {
	// contains filtered or unexported fields
}

MenuGroupBy is the group-by builder for Menu entities.

func (mgb *MenuGroupBy) Aggregate(fns ...AggregateFunc) *MenuGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (s *MenuGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (s *MenuGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (s *MenuGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (s *MenuGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (s *MenuGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (s *MenuGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (s *MenuGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (s *MenuGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (s *MenuGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (s *MenuGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (s *MenuGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (s *MenuGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (mgb *MenuGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (s *MenuGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (s *MenuGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (s *MenuGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (s *MenuGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (s *MenuGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MenuMutation struct {
	// contains filtered or unexported fields
}

MenuMutation represents an operation that mutates the Menu nodes in the graph.

func (m *MenuMutation) AddChildIDs(ids ...uint64)

AddChildIDs adds the "children" edge to the Menu entity by ids.

func (m *MenuMutation) AddDynamicLevel(u int32)

AddDynamicLevel adds u to the "dynamic_level" field.

func (m *MenuMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (m *MenuMutation) AddMenuLevel(u int32)

AddMenuLevel adds u to the "menu_level" field.

func (m *MenuMutation) AddMenuType(u int32)

AddMenuType adds u to the "menu_type" field.

func (m *MenuMutation) AddRoleIDs(ids ...uint64)

AddRoleIDs adds the "roles" edge to the Role entity by ids.

func (m *MenuMutation) AddSort(u int32)

AddSort adds u to the "sort" field.

func (m *MenuMutation) AddedDynamicLevel() (r int32, exists bool)

AddedDynamicLevel returns the value that was added to the "dynamic_level" field in this mutation.

func (m *MenuMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (m *MenuMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (m *MenuMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (m *MenuMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (m *MenuMutation) AddedMenuLevel() (r int32, exists bool)

AddedMenuLevel returns the value that was added to the "menu_level" field in this mutation.

func (m *MenuMutation) AddedMenuType() (r int32, exists bool)

AddedMenuType returns the value that was added to the "menu_type" field in this mutation.

func (m *MenuMutation) AddedSort() (r int32, exists bool)

AddedSort returns the value that was added to the "sort" field in this mutation.

func (m *MenuMutation) Affix() (r bool, exists bool)

Affix returns the value of the "affix" field in the mutation.

func (m *MenuMutation) AffixCleared() bool

AffixCleared returns if the "affix" field was cleared in this mutation.

func (m *MenuMutation) CarryParam() (r bool, exists bool)

CarryParam returns the value of the "carry_param" field in the mutation.

func (m *MenuMutation) CarryParamCleared() bool

CarryParamCleared returns if the "carry_param" field was cleared in this mutation.

func (m *MenuMutation) ChildrenCleared() bool

ChildrenCleared reports if the "children" edge to the Menu entity was cleared.

func (m *MenuMutation) ChildrenIDs() (ids []uint64)

ChildrenIDs returns the "children" edge IDs in the mutation.

func (m *MenuMutation) ClearAffix()

ClearAffix clears the value of the "affix" field.

func (m *MenuMutation) ClearCarryParam()

ClearCarryParam clears the value of the "carry_param" field.

func (m *MenuMutation) ClearChildren()

ClearChildren clears the "children" edge to the Menu entity.

func (m *MenuMutation) ClearComponent()

ClearComponent clears the value of the "component" field.

func (m *MenuMutation) ClearDisabled()

ClearDisabled clears the value of the "disabled" field.

func (m *MenuMutation) ClearDynamicLevel()

ClearDynamicLevel clears the value of the "dynamic_level" field.

func (m *MenuMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (m *MenuMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (m *MenuMutation) ClearFrameSrc()

ClearFrameSrc clears the value of the "frame_src" field.

func (m *MenuMutation) ClearHideBreadcrumb()

ClearHideBreadcrumb clears the value of the "hide_breadcrumb" field.

func (m *MenuMutation) ClearHideChildrenInMenu()

ClearHideChildrenInMenu clears the value of the "hide_children_in_menu" field.

func (m *MenuMutation) ClearHideMenu()

ClearHideMenu clears the value of the "hide_menu" field.

func (m *MenuMutation) ClearHideTab()

ClearHideTab clears the value of the "hide_tab" field.

func (m *MenuMutation) ClearIgnoreKeepAlive()

ClearIgnoreKeepAlive clears the value of the "ignore_keep_alive" field.

func (m *MenuMutation) ClearParent()

ClearParent clears the "parent" edge to the Menu entity.

func (m *MenuMutation) ClearParentID()

ClearParentID clears the value of the "parent_id" field.

func (m *MenuMutation) ClearPath()

ClearPath clears the value of the "path" field.

func (m *MenuMutation) ClearRealPath()

ClearRealPath clears the value of the "real_path" field.

func (m *MenuMutation) ClearRedirect()

ClearRedirect clears the value of the "redirect" field.

func (m *MenuMutation) ClearRoles()

ClearRoles clears the "roles" edge to the Role entity.

func (m *MenuMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (m *MenuMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (m MenuMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (m *MenuMutation) Component() (r string, exists bool)

Component returns the value of the "component" field in the mutation.

func (m *MenuMutation) ComponentCleared() bool

ComponentCleared returns if the "component" field was cleared in this mutation.

func (m *MenuMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (m *MenuMutation) Disabled() (r bool, exists bool)

Disabled returns the value of the "disabled" field in the mutation.

func (m *MenuMutation) DisabledCleared() bool

DisabledCleared returns if the "disabled" field was cleared in this mutation.

func (m *MenuMutation) DynamicLevel() (r uint32, exists bool)

DynamicLevel returns the value of the "dynamic_level" field in the mutation.

func (m *MenuMutation) DynamicLevelCleared() bool

DynamicLevelCleared returns if the "dynamic_level" field was cleared in this mutation.

func (m *MenuMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (c *MenuMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (m *MenuMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (m *MenuMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (m *MenuMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (m *MenuMutation) FrameSrc() (r string, exists bool)

FrameSrc returns the value of the "frame_src" field in the mutation.

func (m *MenuMutation) FrameSrcCleared() bool

FrameSrcCleared returns if the "frame_src" field was cleared in this mutation.

func (m *MenuMutation) HideBreadcrumb() (r bool, exists bool)

HideBreadcrumb returns the value of the "hide_breadcrumb" field in the mutation.

func (m *MenuMutation) HideBreadcrumbCleared() bool

HideBreadcrumbCleared returns if the "hide_breadcrumb" field was cleared in this mutation.

func (m *MenuMutation) HideChildrenInMenu() (r bool, exists bool)

HideChildrenInMenu returns the value of the "hide_children_in_menu" field in the mutation.

func (m *MenuMutation) HideChildrenInMenuCleared() bool

HideChildrenInMenuCleared returns if the "hide_children_in_menu" field was cleared in this mutation.

func (m *MenuMutation) HideMenu() (r bool, exists bool)

HideMenu returns the value of the "hide_menu" field in the mutation.

func (m *MenuMutation) HideMenuCleared() bool

HideMenuCleared returns if the "hide_menu" field was cleared in this mutation.

func (m *MenuMutation) HideTab() (r bool, exists bool)

HideTab returns the value of the "hide_tab" field in the mutation.

func (m *MenuMutation) HideTabCleared() bool

HideTabCleared returns if the "hide_tab" field was cleared in this mutation.

func (m *MenuMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (m *MenuMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (m *MenuMutation) Icon() (r string, exists bool)

Icon returns the value of the "icon" field in the mutation.

func (m *MenuMutation) IgnoreKeepAlive() (r bool, exists bool)

IgnoreKeepAlive returns the value of the "ignore_keep_alive" field in the mutation.

func (m *MenuMutation) IgnoreKeepAliveCleared() bool

IgnoreKeepAliveCleared returns if the "ignore_keep_alive" field was cleared in this mutation.

func (m *MenuMutation) MenuLevel() (r uint32, exists bool)

MenuLevel returns the value of the "menu_level" field in the mutation.

func (m *MenuMutation) MenuType() (r uint32, exists bool)

MenuType returns the value of the "menu_type" field in the mutation.

func (m *MenuMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (m *MenuMutation) OldAffix(ctx context.Context) (v bool, err error)

OldAffix returns the old "affix" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldCarryParam(ctx context.Context) (v bool, err error)

OldCarryParam returns the old "carry_param" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldComponent(ctx context.Context) (v string, err error)

OldComponent returns the old "component" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldDisabled(ctx context.Context) (v bool, err error)

OldDisabled returns the old "disabled" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldDynamicLevel(ctx context.Context) (v uint32, err error)

OldDynamicLevel returns the old "dynamic_level" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (m *MenuMutation) OldFrameSrc(ctx context.Context) (v string, err error)

OldFrameSrc returns the old "frame_src" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldHideBreadcrumb(ctx context.Context) (v bool, err error)

OldHideBreadcrumb returns the old "hide_breadcrumb" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldHideChildrenInMenu(ctx context.Context) (v bool, err error)

OldHideChildrenInMenu returns the old "hide_children_in_menu" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldHideMenu(ctx context.Context) (v bool, err error)

OldHideMenu returns the old "hide_menu" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldHideTab(ctx context.Context) (v bool, err error)

OldHideTab returns the old "hide_tab" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldIcon(ctx context.Context) (v string, err error)

OldIcon returns the old "icon" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldIgnoreKeepAlive(ctx context.Context) (v bool, err error)

OldIgnoreKeepAlive returns the old "ignore_keep_alive" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldMenuLevel(ctx context.Context) (v uint32, err error)

OldMenuLevel returns the old "menu_level" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldMenuType(ctx context.Context) (v uint32, err error)

OldMenuType returns the old "menu_type" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldParentID(ctx context.Context) (v uint64, err error)

OldParentID returns the old "parent_id" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldRealPath(ctx context.Context) (v string, err error)

OldRealPath returns the old "real_path" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldRedirect(ctx context.Context) (v string, err error)

OldRedirect returns the old "redirect" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldSort(ctx context.Context) (v uint32, err error)

OldSort returns the old "sort" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Menu entity. If the Menu object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (m *MenuMutation) Op() Op

Op returns the operation name.

func (m *MenuMutation) ParentCleared() bool

ParentCleared reports if the "parent" edge to the Menu entity was cleared.

func (m *MenuMutation) ParentID() (r uint64, exists bool)

ParentID returns the value of the "parent_id" field in the mutation.

func (m *MenuMutation) ParentIDCleared() bool

ParentIDCleared returns if the "parent_id" field was cleared in this mutation.

func (m *MenuMutation) ParentIDs() (ids []uint64)

ParentIDs returns the "parent" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ParentID instead. It exists only for internal usage by the builders.

func (m *MenuMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (m *MenuMutation) PathCleared() bool

PathCleared returns if the "path" field was cleared in this mutation.

func (c *MenuMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (m *MenuMutation) RealPath() (r string, exists bool)

RealPath returns the value of the "real_path" field in the mutation.

func (m *MenuMutation) RealPathCleared() bool

RealPathCleared returns if the "real_path" field was cleared in this mutation.

func (m *MenuMutation) Redirect() (r string, exists bool)

Redirect returns the value of the "redirect" field in the mutation.

func (m *MenuMutation) RedirectCleared() bool

RedirectCleared returns if the "redirect" field was cleared in this mutation.

func (m *MenuMutation) RemoveChildIDs(ids ...uint64)

RemoveChildIDs removes the "children" edge to the Menu entity by IDs.

func (m *MenuMutation) RemoveRoleIDs(ids ...uint64)

RemoveRoleIDs removes the "roles" edge to the Role entity by IDs.

func (m *MenuMutation) RemovedChildrenIDs() (ids []uint64)

RemovedChildren returns the removed IDs of the "children" edge to the Menu entity.

func (m *MenuMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (m *MenuMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (m *MenuMutation) RemovedRolesIDs() (ids []uint64)

RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.

func (m *MenuMutation) ResetAffix()

ResetAffix resets all changes to the "affix" field.

func (m *MenuMutation) ResetCarryParam()

ResetCarryParam resets all changes to the "carry_param" field.

func (m *MenuMutation) ResetChildren()

ResetChildren resets all changes to the "children" edge.

func (m *MenuMutation) ResetComponent()

ResetComponent resets all changes to the "component" field.

func (m *MenuMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (m *MenuMutation) ResetDisabled()

ResetDisabled resets all changes to the "disabled" field.

func (m *MenuMutation) ResetDynamicLevel()

ResetDynamicLevel resets all changes to the "dynamic_level" field.

func (m *MenuMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (m *MenuMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (m *MenuMutation) ResetFrameSrc()

ResetFrameSrc resets all changes to the "frame_src" field.

func (m *MenuMutation) ResetHideBreadcrumb()

ResetHideBreadcrumb resets all changes to the "hide_breadcrumb" field.

func (m *MenuMutation) ResetHideChildrenInMenu()

ResetHideChildrenInMenu resets all changes to the "hide_children_in_menu" field.

func (m *MenuMutation) ResetHideMenu()

ResetHideMenu resets all changes to the "hide_menu" field.

func (m *MenuMutation) ResetHideTab()

ResetHideTab resets all changes to the "hide_tab" field.

func (m *MenuMutation) ResetIcon()

ResetIcon resets all changes to the "icon" field.

func (m *MenuMutation) ResetIgnoreKeepAlive()

ResetIgnoreKeepAlive resets all changes to the "ignore_keep_alive" field.

func (m *MenuMutation) ResetMenuLevel()

ResetMenuLevel resets all changes to the "menu_level" field.

func (m *MenuMutation) ResetMenuType()

ResetMenuType resets all changes to the "menu_type" field.

func (m *MenuMutation) ResetName()

ResetName resets all changes to the "name" field.

func (m *MenuMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (m *MenuMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (m *MenuMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (m *MenuMutation) ResetRealPath()

ResetRealPath resets all changes to the "real_path" field.

func (m *MenuMutation) ResetRedirect()

ResetRedirect resets all changes to the "redirect" field.

func (m *MenuMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (m *MenuMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (m *MenuMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (m *MenuMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (m *MenuMutation) RolesCleared() bool

RolesCleared reports if the "roles" edge to the Role entity was cleared.

func (m *MenuMutation) RolesIDs() (ids []uint64)

RolesIDs returns the "roles" edge IDs in the mutation.

func (m *MenuMutation) SetAffix(b bool)

SetAffix sets the "affix" field.

func (m *MenuMutation) SetCarryParam(b bool)

SetCarryParam sets the "carry_param" field.

func (m *MenuMutation) SetComponent(s string)

SetComponent sets the "component" field.

func (m *MenuMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (m *MenuMutation) SetDisabled(b bool)

SetDisabled sets the "disabled" field.

func (m *MenuMutation) SetDynamicLevel(u uint32)

SetDynamicLevel sets the "dynamic_level" field.

func (m *MenuMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (m *MenuMutation) SetFrameSrc(s string)

SetFrameSrc sets the "frame_src" field.

func (m *MenuMutation) SetHideBreadcrumb(b bool)

SetHideBreadcrumb sets the "hide_breadcrumb" field.

func (m *MenuMutation) SetHideChildrenInMenu(b bool)

SetHideChildrenInMenu sets the "hide_children_in_menu" field.

func (m *MenuMutation) SetHideMenu(b bool)

SetHideMenu sets the "hide_menu" field.

func (m *MenuMutation) SetHideTab(b bool)

SetHideTab sets the "hide_tab" field.

func (m *MenuMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Menu entities.

func (m *MenuMutation) SetIcon(s string)

SetIcon sets the "icon" field.

func (m *MenuMutation) SetIgnoreKeepAlive(b bool)

SetIgnoreKeepAlive sets the "ignore_keep_alive" field.

func (m *MenuMutation) SetMenuLevel(u uint32)

SetMenuLevel sets the "menu_level" field.

func (m *MenuMutation) SetMenuType(u uint32)

SetMenuType sets the "menu_type" field.

func (m *MenuMutation) SetName(s string)

SetName sets the "name" field.

func (m *MenuMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (m *MenuMutation) SetParentID(u uint64)

SetParentID sets the "parent_id" field.

func (m *MenuMutation) SetPath(s string)

SetPath sets the "path" field.

func (m *MenuMutation) SetRealPath(s string)

SetRealPath sets the "real_path" field.

func (m *MenuMutation) SetRedirect(s string)

SetRedirect sets the "redirect" field.

func (m *MenuMutation) SetSort(u uint32)

SetSort sets the "sort" field.

func (m *MenuMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (m *MenuMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (m *MenuMutation) Sort() (r uint32, exists bool)

Sort returns the value of the "sort" field in the mutation.

func (m *MenuMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (m MenuMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (m *MenuMutation) Type() string

Type returns the node type of this mutation (Menu).

func (m *MenuMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (m *MenuMutation) Where(ps ...predicate.Menu)

Where appends a list predicates to the MenuMutation builder.

func (m *MenuMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MenuMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MenuPageList struct {
	List        []*Menu      `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

MenuPageList is Menu PageList result.

type MenuPager struct {
	Order  menu.OrderOption
	Filter func(*MenuQuery) (*MenuQuery, error)
}
func (p *MenuPager) ApplyFilter(query *MenuQuery) (*MenuQuery, error)
type MenuPaginateOption func(*MenuPager)

MenuPaginateOption enables pagination customization.

type MenuQuery struct {
	// contains filtered or unexported fields
}

MenuQuery is the builder for querying Menu entities.

func (mq *MenuQuery) Aggregate(fns ...AggregateFunc) *MenuSelect

Aggregate returns a MenuSelect configured with the given aggregations.

func (mq *MenuQuery) All(ctx context.Context) ([]*Menu, error)

All executes the query and returns a list of Menus.

func (mq *MenuQuery) AllX(ctx context.Context) []*Menu

AllX is like All, but panics if an error occurs.

func (mq *MenuQuery) Clone() *MenuQuery

Clone returns a duplicate of the MenuQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (mq *MenuQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (mq *MenuQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (c *MenuQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (mq *MenuQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (mq *MenuQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (mq *MenuQuery) First(ctx context.Context) (*Menu, error)

First returns the first Menu entity from the query. Returns a *NotFoundError when no Menu was found.

func (mq *MenuQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Menu ID from the query. Returns a *NotFoundError when no Menu ID was found.

func (mq *MenuQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (mq *MenuQuery) FirstX(ctx context.Context) *Menu

FirstX is like First, but panics if an error occurs.

func (mq *MenuQuery) GroupBy(field string, fields ...string) *MenuGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Menu.Query().
	GroupBy(menu.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)
func (mq *MenuQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Menu IDs.

func (mq *MenuQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (mq *MenuQuery) Limit(limit int) *MenuQuery

Limit the number of records to be returned by this query.

func (mq *MenuQuery) Offset(offset int) *MenuQuery

Offset to start from.

func (mq *MenuQuery) Only(ctx context.Context) (*Menu, error)

Only returns a single Menu entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Menu entity is found. Returns a *NotFoundError when no Menu entities are found.

func (mq *MenuQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Menu ID in the query. Returns a *NotSingularError when more than one Menu ID is found. Returns a *NotFoundError when no entities are found.

func (mq *MenuQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (mq *MenuQuery) OnlyX(ctx context.Context) *Menu

OnlyX is like Only, but panics if an error occurs.

func (mq *MenuQuery) Order(o ...menu.OrderOption) *MenuQuery

Order specifies how the records should be ordered.

func (m *MenuQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...MenuPaginateOption,
) (*MenuPageList, error)
func (mq *MenuQuery) QueryChildren() *MenuQuery

QueryChildren chains the current query on the "children" edge.

func (c *MenuQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (mq *MenuQuery) QueryParent() *MenuQuery

QueryParent chains the current query on the "parent" edge.

func (mq *MenuQuery) QueryRoles() *RoleQuery

QueryRoles chains the current query on the "roles" edge.

func (mq *MenuQuery) Select(fields ...string) *MenuSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Menu.Query().
	Select(menu.FieldCreatedAt).
	Scan(ctx, &v)
func (mq *MenuQuery) Unique(unique bool) *MenuQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (mq *MenuQuery) Where(ps ...predicate.Menu) *MenuQuery

Where adds a new predicate for the MenuQuery builder.

func (mq *MenuQuery) WithChildren(opts ...func(*MenuQuery)) *MenuQuery

WithChildren tells the query-builder to eager-load the nodes that are connected to the "children" edge. The optional arguments are used to configure the query builder of the edge.

func (mq *MenuQuery) WithParent(opts ...func(*MenuQuery)) *MenuQuery

WithParent tells the query-builder to eager-load the nodes that are connected to the "parent" edge. The optional arguments are used to configure the query builder of the edge.

func (mq *MenuQuery) WithRoles(opts ...func(*RoleQuery)) *MenuQuery

WithRoles tells the query-builder to eager-load the nodes that are connected to the "roles" edge. The optional arguments are used to configure the query builder of the edge.

type MenuSelect struct {
	*MenuQuery
	// contains filtered or unexported fields
}

MenuSelect is the builder for selecting fields of Menu entities.

func (ms *MenuSelect) Aggregate(fns ...AggregateFunc) *MenuSelect

Aggregate adds the given aggregation functions to the selector query.

func (s *MenuSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (s *MenuSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (s *MenuSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (s *MenuSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (c MenuSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (s *MenuSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (s *MenuSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (s *MenuSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (s *MenuSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (s *MenuSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (s *MenuSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (s *MenuSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (s *MenuSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (c MenuSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (ms *MenuSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (s *MenuSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (s *MenuSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (s *MenuSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (s *MenuSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (s *MenuSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MenuUpdate struct {
	// contains filtered or unexported fields
}

MenuUpdate is the builder for updating Menu entities.

func (mu *MenuUpdate) AddChildIDs(ids ...uint64) *MenuUpdate

AddChildIDs adds the "children" edge to the Menu entity by IDs.

func (mu *MenuUpdate) AddChildren(m ...*Menu) *MenuUpdate

AddChildren adds the "children" edges to the Menu entity.

func (mu *MenuUpdate) AddDynamicLevel(u int32) *MenuUpdate

AddDynamicLevel adds u to the "dynamic_level" field.

func (mu *MenuUpdate) AddMenuLevel(u int32) *MenuUpdate

AddMenuLevel adds u to the "menu_level" field.

func (mu *MenuUpdate) AddMenuType(u int32) *MenuUpdate

AddMenuType adds u to the "menu_type" field.

func (mu *MenuUpdate) AddRoleIDs(ids ...uint64) *MenuUpdate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (mu *MenuUpdate) AddRoles(r ...*Role) *MenuUpdate

AddRoles adds the "roles" edges to the Role entity.

func (mu *MenuUpdate) AddSort(u int32) *MenuUpdate

AddSort adds u to the "sort" field.

func (mu *MenuUpdate) ClearAffix() *MenuUpdate

ClearAffix clears the value of the "affix" field.

func (mu *MenuUpdate) ClearCarryParam() *MenuUpdate

ClearCarryParam clears the value of the "carry_param" field.

func (mu *MenuUpdate) ClearChildren() *MenuUpdate

ClearChildren clears all "children" edges to the Menu entity.

func (mu *MenuUpdate) ClearComponent() *MenuUpdate

ClearComponent clears the value of the "component" field.

func (mu *MenuUpdate) ClearDisabled() *MenuUpdate

ClearDisabled clears the value of the "disabled" field.

func (mu *MenuUpdate) ClearDynamicLevel() *MenuUpdate

ClearDynamicLevel clears the value of the "dynamic_level" field.

func (mu *MenuUpdate) ClearFrameSrc() *MenuUpdate

ClearFrameSrc clears the value of the "frame_src" field.

func (mu *MenuUpdate) ClearHideBreadcrumb() *MenuUpdate

ClearHideBreadcrumb clears the value of the "hide_breadcrumb" field.

func (mu *MenuUpdate) ClearHideChildrenInMenu() *MenuUpdate

ClearHideChildrenInMenu clears the value of the "hide_children_in_menu" field.

func (mu *MenuUpdate) ClearHideMenu() *MenuUpdate

ClearHideMenu clears the value of the "hide_menu" field.

func (mu *MenuUpdate) ClearHideTab() *MenuUpdate

ClearHideTab clears the value of the "hide_tab" field.

func (mu *MenuUpdate) ClearIgnoreKeepAlive() *MenuUpdate

ClearIgnoreKeepAlive clears the value of the "ignore_keep_alive" field.

func (mu *MenuUpdate) ClearParent() *MenuUpdate

ClearParent clears the "parent" edge to the Menu entity.

func (mu *MenuUpdate) ClearParentID() *MenuUpdate

ClearParentID clears the value of the "parent_id" field.

func (mu *MenuUpdate) ClearPath() *MenuUpdate

ClearPath clears the value of the "path" field.

func (mu *MenuUpdate) ClearRealPath() *MenuUpdate

ClearRealPath clears the value of the "real_path" field.

func (mu *MenuUpdate) ClearRedirect() *MenuUpdate

ClearRedirect clears the value of the "redirect" field.

func (mu *MenuUpdate) ClearRoles() *MenuUpdate

ClearRoles clears all "roles" edges to the Role entity.

func (mu *MenuUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (c *MenuUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (mu *MenuUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (mu *MenuUpdate) Mutation() *MenuMutation

Mutation returns the MenuMutation object of the builder.

func (c *MenuUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (mu *MenuUpdate) RemoveChildIDs(ids ...uint64) *MenuUpdate

RemoveChildIDs removes the "children" edge to Menu entities by IDs.

func (mu *MenuUpdate) RemoveChildren(m ...*Menu) *MenuUpdate

RemoveChildren removes "children" edges to Menu entities.

func (mu *MenuUpdate) RemoveRoleIDs(ids ...uint64) *MenuUpdate

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (mu *MenuUpdate) RemoveRoles(r ...*Role) *MenuUpdate

RemoveRoles removes "roles" edges to Role entities.

func (mu *MenuUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (mu *MenuUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (mu *MenuUpdate) SetAffix(b bool) *MenuUpdate

SetAffix sets the "affix" field.

func (mu *MenuUpdate) SetCarryParam(b bool) *MenuUpdate

SetCarryParam sets the "carry_param" field.

func (mu *MenuUpdate) SetComponent(s string) *MenuUpdate

SetComponent sets the "component" field.

func (mu *MenuUpdate) SetDisabled(b bool) *MenuUpdate

SetDisabled sets the "disabled" field.

func (mu *MenuUpdate) SetDynamicLevel(u uint32) *MenuUpdate

SetDynamicLevel sets the "dynamic_level" field.

func (mu *MenuUpdate) SetFrameSrc(s string) *MenuUpdate

SetFrameSrc sets the "frame_src" field.

func (mu *MenuUpdate) SetHideBreadcrumb(b bool) *MenuUpdate

SetHideBreadcrumb sets the "hide_breadcrumb" field.

func (mu *MenuUpdate) SetHideChildrenInMenu(b bool) *MenuUpdate

SetHideChildrenInMenu sets the "hide_children_in_menu" field.

func (mu *MenuUpdate) SetHideMenu(b bool) *MenuUpdate

SetHideMenu sets the "hide_menu" field.

func (mu *MenuUpdate) SetHideTab(b bool) *MenuUpdate

SetHideTab sets the "hide_tab" field.

func (mu *MenuUpdate) SetIcon(s string) *MenuUpdate

SetIcon sets the "icon" field.

func (mu *MenuUpdate) SetIgnoreKeepAlive(b bool) *MenuUpdate

SetIgnoreKeepAlive sets the "ignore_keep_alive" field.

func (mu *MenuUpdate) SetMenuLevel(u uint32) *MenuUpdate

SetMenuLevel sets the "menu_level" field.

func (mu *MenuUpdate) SetMenuType(u uint32) *MenuUpdate

SetMenuType sets the "menu_type" field.

func (mu *MenuUpdate) SetName(s string) *MenuUpdate

SetName sets the "name" field.

func (mu *MenuUpdate) SetNillableAffix(b *bool) *MenuUpdate

SetNillableAffix sets the "affix" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableCarryParam(b *bool) *MenuUpdate

SetNillableCarryParam sets the "carry_param" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableComponent(s *string) *MenuUpdate

SetNillableComponent sets the "component" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableDisabled(b *bool) *MenuUpdate

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableDynamicLevel(u *uint32) *MenuUpdate

SetNillableDynamicLevel sets the "dynamic_level" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableFrameSrc(s *string) *MenuUpdate

SetNillableFrameSrc sets the "frame_src" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableHideBreadcrumb(b *bool) *MenuUpdate

SetNillableHideBreadcrumb sets the "hide_breadcrumb" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableHideChildrenInMenu(b *bool) *MenuUpdate

SetNillableHideChildrenInMenu sets the "hide_children_in_menu" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableHideMenu(b *bool) *MenuUpdate

SetNillableHideMenu sets the "hide_menu" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableHideTab(b *bool) *MenuUpdate

SetNillableHideTab sets the "hide_tab" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableIcon(s *string) *MenuUpdate

SetNillableIcon sets the "icon" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableIgnoreKeepAlive(b *bool) *MenuUpdate

SetNillableIgnoreKeepAlive sets the "ignore_keep_alive" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableMenuLevel(u *uint32) *MenuUpdate

SetNillableMenuLevel sets the "menu_level" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableMenuType(u *uint32) *MenuUpdate

SetNillableMenuType sets the "menu_type" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableName(s *string) *MenuUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableParentID(u *uint64) *MenuUpdate

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (mu *MenuUpdate) SetNillablePath(s *string) *MenuUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableRealPath(s *string) *MenuUpdate

SetNillableRealPath sets the "real_path" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableRedirect(s *string) *MenuUpdate

SetNillableRedirect sets the "redirect" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableSort(u *uint32) *MenuUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableTitle(s *string) *MenuUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (m *MenuUpdate) SetNotEmptyComponent(value string) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptyDynamicLevel(value uint32) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptyFrameSrc(value string) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptyIcon(value string) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptyMenuLevel(value uint32) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptyMenuType(value uint32) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptyName(value string) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptyParentID(value uint64) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptyPath(value string) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptyRealPath(value string) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptyRedirect(value string) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptySort(value uint32) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotEmptyTitle(value string) *MenuUpdate

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdate) SetNotNilAffix(value *bool) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilCarryParam(value *bool) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilComponent(value *string) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilDisabled(value *bool) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilDynamicLevel(value *uint32) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilFrameSrc(value *string) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilHideBreadcrumb(value *bool) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilHideChildrenInMenu(value *bool) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilHideMenu(value *bool) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilHideTab(value *bool) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilIcon(value *string) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilIgnoreKeepAlive(value *bool) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilMenuLevel(value *uint32) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilMenuType(value *uint32) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilName(value *string) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilParentID(value *uint64) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilPath(value *string) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilRealPath(value *string) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilRedirect(value *string) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilSort(value *uint32) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilTitle(value *string) *MenuUpdate

set field if value's pointer is not nil.

func (m *MenuUpdate) SetNotNilUpdatedAt(value *time.Time) *MenuUpdate

set field if value's pointer is not nil.

func (mu *MenuUpdate) SetParent(m *Menu) *MenuUpdate

SetParent sets the "parent" edge to the Menu entity.

func (mu *MenuUpdate) SetParentID(u uint64) *MenuUpdate

SetParentID sets the "parent_id" field.

func (mu *MenuUpdate) SetPath(s string) *MenuUpdate

SetPath sets the "path" field.

func (mu *MenuUpdate) SetRealPath(s string) *MenuUpdate

SetRealPath sets the "real_path" field.

func (mu *MenuUpdate) SetRedirect(s string) *MenuUpdate

SetRedirect sets the "redirect" field.

func (mu *MenuUpdate) SetSort(u uint32) *MenuUpdate

SetSort sets the "sort" field.

func (mu *MenuUpdate) SetTitle(s string) *MenuUpdate

SetTitle sets the "title" field.

func (mu *MenuUpdate) SetUpdatedAt(t time.Time) *MenuUpdate

SetUpdatedAt sets the "updated_at" field.

func (mu *MenuUpdate) Where(ps ...predicate.Menu) *MenuUpdate

Where appends a list predicates to the MenuUpdate builder.

type MenuUpdateOne struct {
	// contains filtered or unexported fields
}

MenuUpdateOne is the builder for updating a single Menu entity.

func (muo *MenuUpdateOne) AddChildIDs(ids ...uint64) *MenuUpdateOne

AddChildIDs adds the "children" edge to the Menu entity by IDs.

func (muo *MenuUpdateOne) AddChildren(m ...*Menu) *MenuUpdateOne

AddChildren adds the "children" edges to the Menu entity.

func (muo *MenuUpdateOne) AddDynamicLevel(u int32) *MenuUpdateOne

AddDynamicLevel adds u to the "dynamic_level" field.

func (muo *MenuUpdateOne) AddMenuLevel(u int32) *MenuUpdateOne

AddMenuLevel adds u to the "menu_level" field.

func (muo *MenuUpdateOne) AddMenuType(u int32) *MenuUpdateOne

AddMenuType adds u to the "menu_type" field.

func (muo *MenuUpdateOne) AddRoleIDs(ids ...uint64) *MenuUpdateOne

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (muo *MenuUpdateOne) AddRoles(r ...*Role) *MenuUpdateOne

AddRoles adds the "roles" edges to the Role entity.

func (muo *MenuUpdateOne) AddSort(u int32) *MenuUpdateOne

AddSort adds u to the "sort" field.

func (muo *MenuUpdateOne) ClearAffix() *MenuUpdateOne

ClearAffix clears the value of the "affix" field.

func (muo *MenuUpdateOne) ClearCarryParam() *MenuUpdateOne

ClearCarryParam clears the value of the "carry_param" field.

func (muo *MenuUpdateOne) ClearChildren() *MenuUpdateOne

ClearChildren clears all "children" edges to the Menu entity.

func (muo *MenuUpdateOne) ClearComponent() *MenuUpdateOne

ClearComponent clears the value of the "component" field.

func (muo *MenuUpdateOne) ClearDisabled() *MenuUpdateOne

ClearDisabled clears the value of the "disabled" field.

func (muo *MenuUpdateOne) ClearDynamicLevel() *MenuUpdateOne

ClearDynamicLevel clears the value of the "dynamic_level" field.

func (muo *MenuUpdateOne) ClearFrameSrc() *MenuUpdateOne

ClearFrameSrc clears the value of the "frame_src" field.

func (muo *MenuUpdateOne) ClearHideBreadcrumb() *MenuUpdateOne

ClearHideBreadcrumb clears the value of the "hide_breadcrumb" field.

func (muo *MenuUpdateOne) ClearHideChildrenInMenu() *MenuUpdateOne

ClearHideChildrenInMenu clears the value of the "hide_children_in_menu" field.

func (muo *MenuUpdateOne) ClearHideMenu() *MenuUpdateOne

ClearHideMenu clears the value of the "hide_menu" field.

func (muo *MenuUpdateOne) ClearHideTab() *MenuUpdateOne

ClearHideTab clears the value of the "hide_tab" field.

func (muo *MenuUpdateOne) ClearIgnoreKeepAlive() *MenuUpdateOne

ClearIgnoreKeepAlive clears the value of the "ignore_keep_alive" field.

func (muo *MenuUpdateOne) ClearParent() *MenuUpdateOne

ClearParent clears the "parent" edge to the Menu entity.

func (muo *MenuUpdateOne) ClearParentID() *MenuUpdateOne

ClearParentID clears the value of the "parent_id" field.

func (muo *MenuUpdateOne) ClearPath() *MenuUpdateOne

ClearPath clears the value of the "path" field.

func (muo *MenuUpdateOne) ClearRealPath() *MenuUpdateOne

ClearRealPath clears the value of the "real_path" field.

func (muo *MenuUpdateOne) ClearRedirect() *MenuUpdateOne

ClearRedirect clears the value of the "redirect" field.

func (muo *MenuUpdateOne) ClearRoles() *MenuUpdateOne

ClearRoles clears all "roles" edges to the Role entity.

func (muo *MenuUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (c *MenuUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (muo *MenuUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (muo *MenuUpdateOne) Mutation() *MenuMutation

Mutation returns the MenuMutation object of the builder.

func (c *MenuUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (muo *MenuUpdateOne) RemoveChildIDs(ids ...uint64) *MenuUpdateOne

RemoveChildIDs removes the "children" edge to Menu entities by IDs.

func (muo *MenuUpdateOne) RemoveChildren(m ...*Menu) *MenuUpdateOne

RemoveChildren removes "children" edges to Menu entities.

func (muo *MenuUpdateOne) RemoveRoleIDs(ids ...uint64) *MenuUpdateOne

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (muo *MenuUpdateOne) RemoveRoles(r ...*Role) *MenuUpdateOne

RemoveRoles removes "roles" edges to Role entities.

func (muo *MenuUpdateOne) Save(ctx context.Context) (*Menu, error)

Save executes the query and returns the updated Menu entity.

func (muo *MenuUpdateOne) SaveX(ctx context.Context) *Menu

SaveX is like Save, but panics if an error occurs.

func (muo *MenuUpdateOne) Select(field string, fields ...string) *MenuUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (muo *MenuUpdateOne) SetAffix(b bool) *MenuUpdateOne

SetAffix sets the "affix" field.

func (muo *MenuUpdateOne) SetCarryParam(b bool) *MenuUpdateOne

SetCarryParam sets the "carry_param" field.

func (muo *MenuUpdateOne) SetComponent(s string) *MenuUpdateOne

SetComponent sets the "component" field.

func (muo *MenuUpdateOne) SetDisabled(b bool) *MenuUpdateOne

SetDisabled sets the "disabled" field.

func (muo *MenuUpdateOne) SetDynamicLevel(u uint32) *MenuUpdateOne

SetDynamicLevel sets the "dynamic_level" field.

func (muo *MenuUpdateOne) SetFrameSrc(s string) *MenuUpdateOne

SetFrameSrc sets the "frame_src" field.

func (muo *MenuUpdateOne) SetHideBreadcrumb(b bool) *MenuUpdateOne

SetHideBreadcrumb sets the "hide_breadcrumb" field.

func (muo *MenuUpdateOne) SetHideChildrenInMenu(b bool) *MenuUpdateOne

SetHideChildrenInMenu sets the "hide_children_in_menu" field.

func (muo *MenuUpdateOne) SetHideMenu(b bool) *MenuUpdateOne

SetHideMenu sets the "hide_menu" field.

func (muo *MenuUpdateOne) SetHideTab(b bool) *MenuUpdateOne

SetHideTab sets the "hide_tab" field.

func (muo *MenuUpdateOne) SetIcon(s string) *MenuUpdateOne

SetIcon sets the "icon" field.

func (muo *MenuUpdateOne) SetIgnoreKeepAlive(b bool) *MenuUpdateOne

SetIgnoreKeepAlive sets the "ignore_keep_alive" field.

func (muo *MenuUpdateOne) SetMenuLevel(u uint32) *MenuUpdateOne

SetMenuLevel sets the "menu_level" field.

func (muo *MenuUpdateOne) SetMenuType(u uint32) *MenuUpdateOne

SetMenuType sets the "menu_type" field.

func (muo *MenuUpdateOne) SetName(s string) *MenuUpdateOne

SetName sets the "name" field.

func (muo *MenuUpdateOne) SetNillableAffix(b *bool) *MenuUpdateOne

SetNillableAffix sets the "affix" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableCarryParam(b *bool) *MenuUpdateOne

SetNillableCarryParam sets the "carry_param" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableComponent(s *string) *MenuUpdateOne

SetNillableComponent sets the "component" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableDisabled(b *bool) *MenuUpdateOne

SetNillableDisabled sets the "disabled" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableDynamicLevel(u *uint32) *MenuUpdateOne

SetNillableDynamicLevel sets the "dynamic_level" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableFrameSrc(s *string) *MenuUpdateOne

SetNillableFrameSrc sets the "frame_src" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableHideBreadcrumb(b *bool) *MenuUpdateOne

SetNillableHideBreadcrumb sets the "hide_breadcrumb" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableHideChildrenInMenu(b *bool) *MenuUpdateOne

SetNillableHideChildrenInMenu sets the "hide_children_in_menu" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableHideMenu(b *bool) *MenuUpdateOne

SetNillableHideMenu sets the "hide_menu" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableHideTab(b *bool) *MenuUpdateOne

SetNillableHideTab sets the "hide_tab" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableIcon(s *string) *MenuUpdateOne

SetNillableIcon sets the "icon" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableIgnoreKeepAlive(b *bool) *MenuUpdateOne

SetNillableIgnoreKeepAlive sets the "ignore_keep_alive" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableMenuLevel(u *uint32) *MenuUpdateOne

SetNillableMenuLevel sets the "menu_level" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableMenuType(u *uint32) *MenuUpdateOne

SetNillableMenuType sets the "menu_type" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableName(s *string) *MenuUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableParentID(u *uint64) *MenuUpdateOne

SetNillableParentID sets the "parent_id" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillablePath(s *string) *MenuUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableRealPath(s *string) *MenuUpdateOne

SetNillableRealPath sets the "real_path" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableRedirect(s *string) *MenuUpdateOne

SetNillableRedirect sets the "redirect" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableSort(u *uint32) *MenuUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableTitle(s *string) *MenuUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (m *MenuUpdateOne) SetNotEmptyComponent(value string) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptyDynamicLevel(value uint32) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptyFrameSrc(value string) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptyIcon(value string) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptyMenuLevel(value uint32) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptyMenuType(value uint32) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptyName(value string) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptyParentID(value uint64) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptyPath(value string) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptyRealPath(value string) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptyRedirect(value string) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptySort(value uint32) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotEmptyTitle(value string) *MenuUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (m *MenuUpdateOne) SetNotNilAffix(value *bool) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilCarryParam(value *bool) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilComponent(value *string) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilDisabled(value *bool) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilDynamicLevel(value *uint32) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilFrameSrc(value *string) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilHideBreadcrumb(value *bool) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilHideChildrenInMenu(value *bool) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilHideMenu(value *bool) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilHideTab(value *bool) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilIcon(value *string) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilIgnoreKeepAlive(value *bool) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilMenuLevel(value *uint32) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilMenuType(value *uint32) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilName(value *string) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilParentID(value *uint64) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilPath(value *string) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilRealPath(value *string) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilRedirect(value *string) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilSort(value *uint32) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilTitle(value *string) *MenuUpdateOne

set field if value's pointer is not nil.

func (m *MenuUpdateOne) SetNotNilUpdatedAt(value *time.Time) *MenuUpdateOne

set field if value's pointer is not nil.

func (muo *MenuUpdateOne) SetParent(m *Menu) *MenuUpdateOne

SetParent sets the "parent" edge to the Menu entity.

func (muo *MenuUpdateOne) SetParentID(u uint64) *MenuUpdateOne

SetParentID sets the "parent_id" field.

func (muo *MenuUpdateOne) SetPath(s string) *MenuUpdateOne

SetPath sets the "path" field.

func (muo *MenuUpdateOne) SetRealPath(s string) *MenuUpdateOne

SetRealPath sets the "real_path" field.

func (muo *MenuUpdateOne) SetRedirect(s string) *MenuUpdateOne

SetRedirect sets the "redirect" field.

func (muo *MenuUpdateOne) SetSort(u uint32) *MenuUpdateOne

SetSort sets the "sort" field.

func (muo *MenuUpdateOne) SetTitle(s string) *MenuUpdateOne

SetTitle sets the "title" field.

func (muo *MenuUpdateOne) SetUpdatedAt(t time.Time) *MenuUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (muo *MenuUpdateOne) Where(ps ...predicate.Menu) *MenuUpdateOne

Where appends a list predicates to the MenuUpdate builder.

type Menus []*Menu

Menus is a parsable slice of Menu.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type OauthProvider

type OauthProvider struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The provider's name | 提供商名称
	Name string `json:"name,omitempty"`
	// The client id | 客户端 id
	ClientID string `json:"client_id,omitempty"`
	// The client secret | 客户端密钥
	ClientSecret string `json:"client_secret,omitempty"`
	// The redirect url | 跳转地址
	RedirectURL string `json:"redirect_url,omitempty"`
	// The scopes | 权限范围
	Scopes string `json:"scopes,omitempty"`
	// The auth url of the provider | 认证地址
	AuthURL string `json:"auth_url,omitempty"`
	// The token url of the provider | 获取 token地址
	TokenURL string `json:"token_url,omitempty"`
	// The auth style, 0: auto detect 1: third party log in 2: log in with username and password | 鉴权方式 0 自动 1 第三方登录 2 使用用户名密码
	AuthStyle uint64 `json:"auth_style,omitempty"`
	// The URL to request user information by token | 用户信息请求地址
	InfoURL string `json:"info_url,omitempty"`
	// contains filtered or unexported fields
}

OauthProvider is the model entity for the OauthProvider schema.

func (*OauthProvider) ExecContext added in v1.0.9

func (c *OauthProvider) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*OauthProvider) QueryContext added in v1.0.9

func (c *OauthProvider) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*OauthProvider) String

func (op *OauthProvider) String() string

String implements the fmt.Stringer.

func (*OauthProvider) Unwrap

func (op *OauthProvider) Unwrap() *OauthProvider

Unwrap unwraps the OauthProvider entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*OauthProvider) Update

func (op *OauthProvider) Update() *OauthProviderUpdateOne

Update returns a builder for updating this OauthProvider. Note that you need to call OauthProvider.Unwrap() before calling this method if this OauthProvider was returned from a transaction, and the transaction was committed or rolled back.

func (*OauthProvider) Value added in v1.0.0

func (op *OauthProvider) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the OauthProvider. This includes values selected through modifiers, order, etc.

type OauthProviderClient

type OauthProviderClient struct {
	// contains filtered or unexported fields
}

OauthProviderClient is a client for the OauthProvider schema.

func NewOauthProviderClient

func NewOauthProviderClient(c config) *OauthProviderClient

NewOauthProviderClient returns a client for the OauthProvider from the given config.

func (*OauthProviderClient) Create

Create returns a builder for creating a OauthProvider entity.

func (*OauthProviderClient) CreateBulk

CreateBulk returns a builder for creating a bulk of OauthProvider entities.

func (*OauthProviderClient) Delete

Delete returns a delete builder for OauthProvider.

func (*OauthProviderClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OauthProviderClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*OauthProviderClient) ExecContext added in v1.0.9

func (c *OauthProviderClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*OauthProviderClient) Get

Get returns a OauthProvider entity by its id.

func (*OauthProviderClient) GetX

GetX is like Get, but panics if an error occurs.

func (*OauthProviderClient) Hooks

func (c *OauthProviderClient) Hooks() []Hook

Hooks returns the client hooks.

func (*OauthProviderClient) Intercept

func (c *OauthProviderClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `oauthprovider.Intercept(f(g(h())))`.

func (*OauthProviderClient) Interceptors

func (c *OauthProviderClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*OauthProviderClient) MapCreateBulk added in v1.1.5

func (c *OauthProviderClient) MapCreateBulk(slice any, setFunc func(*OauthProviderCreate, int)) *OauthProviderCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*OauthProviderClient) Query

Query returns a query builder for OauthProvider.

func (*OauthProviderClient) QueryContext added in v1.0.9

func (c *OauthProviderClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*OauthProviderClient) Update

Update returns an update builder for OauthProvider.

func (*OauthProviderClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OauthProviderClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*OauthProviderClient) Use

func (c *OauthProviderClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `oauthprovider.Hooks(f(g(h())))`.

type OauthProviderCreate

type OauthProviderCreate struct {
	// contains filtered or unexported fields
}

OauthProviderCreate is the builder for creating a OauthProvider entity.

func (*OauthProviderCreate) Exec

func (opc *OauthProviderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OauthProviderCreate) ExecContext added in v1.0.9

func (c *OauthProviderCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*OauthProviderCreate) ExecX

func (opc *OauthProviderCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OauthProviderCreate) Mutation

func (opc *OauthProviderCreate) Mutation() *OauthProviderMutation

Mutation returns the OauthProviderMutation object of the builder.

func (*OauthProviderCreate) QueryContext added in v1.0.9

func (c *OauthProviderCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*OauthProviderCreate) Save

Save creates the OauthProvider in the database.

func (*OauthProviderCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OauthProviderCreate) SetAuthStyle

func (opc *OauthProviderCreate) SetAuthStyle(u uint64) *OauthProviderCreate

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderCreate) SetAuthURL

func (opc *OauthProviderCreate) SetAuthURL(s string) *OauthProviderCreate

SetAuthURL sets the "auth_url" field.

func (*OauthProviderCreate) SetClientID

func (opc *OauthProviderCreate) SetClientID(s string) *OauthProviderCreate

SetClientID sets the "client_id" field.

func (*OauthProviderCreate) SetClientSecret

func (opc *OauthProviderCreate) SetClientSecret(s string) *OauthProviderCreate

SetClientSecret sets the "client_secret" field.

func (*OauthProviderCreate) SetCreatedAt

func (opc *OauthProviderCreate) SetCreatedAt(t time.Time) *OauthProviderCreate

SetCreatedAt sets the "created_at" field.

func (*OauthProviderCreate) SetID

SetID sets the "id" field.

func (*OauthProviderCreate) SetInfoURL

func (opc *OauthProviderCreate) SetInfoURL(s string) *OauthProviderCreate

SetInfoURL sets the "info_url" field.

func (*OauthProviderCreate) SetName

SetName sets the "name" field.

func (*OauthProviderCreate) SetNillableCreatedAt

func (opc *OauthProviderCreate) SetNillableCreatedAt(t *time.Time) *OauthProviderCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*OauthProviderCreate) SetNillableUpdatedAt

func (opc *OauthProviderCreate) SetNillableUpdatedAt(t *time.Time) *OauthProviderCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*OauthProviderCreate) SetNotNilAuthStyle added in v1.0.9

func (op *OauthProviderCreate) SetNotNilAuthStyle(value *uint64) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilAuthURL added in v1.0.9

func (op *OauthProviderCreate) SetNotNilAuthURL(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilClientID added in v1.0.9

func (op *OauthProviderCreate) SetNotNilClientID(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilClientSecret added in v1.0.9

func (op *OauthProviderCreate) SetNotNilClientSecret(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilInfoURL added in v1.0.9

func (op *OauthProviderCreate) SetNotNilInfoURL(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilName added in v1.0.9

func (op *OauthProviderCreate) SetNotNilName(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilRedirectURL added in v1.0.9

func (op *OauthProviderCreate) SetNotNilRedirectURL(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilScopes added in v1.0.9

func (op *OauthProviderCreate) SetNotNilScopes(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilTokenURL added in v1.0.9

func (op *OauthProviderCreate) SetNotNilTokenURL(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilUpdatedAt added in v1.0.9

func (op *OauthProviderCreate) SetNotNilUpdatedAt(value *time.Time) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetRedirectURL

func (opc *OauthProviderCreate) SetRedirectURL(s string) *OauthProviderCreate

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderCreate) SetScopes

func (opc *OauthProviderCreate) SetScopes(s string) *OauthProviderCreate

SetScopes sets the "scopes" field.

func (*OauthProviderCreate) SetTokenURL

func (opc *OauthProviderCreate) SetTokenURL(s string) *OauthProviderCreate

SetTokenURL sets the "token_url" field.

func (*OauthProviderCreate) SetUpdatedAt

func (opc *OauthProviderCreate) SetUpdatedAt(t time.Time) *OauthProviderCreate

SetUpdatedAt sets the "updated_at" field.

type OauthProviderCreateBulk

type OauthProviderCreateBulk struct {
	// contains filtered or unexported fields
}

OauthProviderCreateBulk is the builder for creating many OauthProvider entities in bulk.

func (*OauthProviderCreateBulk) Exec

func (opcb *OauthProviderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OauthProviderCreateBulk) ExecContext added in v1.0.9

func (c *OauthProviderCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*OauthProviderCreateBulk) ExecX

func (opcb *OauthProviderCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OauthProviderCreateBulk) QueryContext added in v1.0.9

func (c *OauthProviderCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*OauthProviderCreateBulk) Save

Save creates the OauthProvider entities in the database.

func (*OauthProviderCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type OauthProviderDelete

type OauthProviderDelete struct {
	// contains filtered or unexported fields
}

OauthProviderDelete is the builder for deleting a OauthProvider entity.

func (*OauthProviderDelete) Exec

func (opd *OauthProviderDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*OauthProviderDelete) ExecContext added in v1.0.9

func (c *OauthProviderDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*OauthProviderDelete) ExecX

func (opd *OauthProviderDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*OauthProviderDelete) QueryContext added in v1.0.9

func (c *OauthProviderDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*OauthProviderDelete) Where

Where appends a list predicates to the OauthProviderDelete builder.

type OauthProviderDeleteOne

type OauthProviderDeleteOne struct {
	// contains filtered or unexported fields
}

OauthProviderDeleteOne is the builder for deleting a single OauthProvider entity.

func (*OauthProviderDeleteOne) Exec

func (opdo *OauthProviderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OauthProviderDeleteOne) ExecX

func (opdo *OauthProviderDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OauthProviderDeleteOne) Where

Where appends a list predicates to the OauthProviderDelete builder.

type OauthProviderGroupBy

type OauthProviderGroupBy struct {
	// contains filtered or unexported fields
}

OauthProviderGroupBy is the group-by builder for OauthProvider entities.

func (*OauthProviderGroupBy) Aggregate

func (opgb *OauthProviderGroupBy) Aggregate(fns ...AggregateFunc) *OauthProviderGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*OauthProviderGroupBy) Bool

func (s *OauthProviderGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OauthProviderGroupBy) BoolX

func (s *OauthProviderGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OauthProviderGroupBy) Bools

func (s *OauthProviderGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OauthProviderGroupBy) BoolsX

func (s *OauthProviderGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*OauthProviderGroupBy) Float64

func (s *OauthProviderGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OauthProviderGroupBy) Float64X

func (s *OauthProviderGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OauthProviderGroupBy) Float64s

func (s *OauthProviderGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OauthProviderGroupBy) Float64sX

func (s *OauthProviderGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OauthProviderGroupBy) Int

func (s *OauthProviderGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OauthProviderGroupBy) IntX

func (s *OauthProviderGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OauthProviderGroupBy) Ints

func (s *OauthProviderGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OauthProviderGroupBy) IntsX

func (s *OauthProviderGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*OauthProviderGroupBy) Scan

func (opgb *OauthProviderGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OauthProviderGroupBy) ScanX

func (s *OauthProviderGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OauthProviderGroupBy) String

func (s *OauthProviderGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OauthProviderGroupBy) StringX

func (s *OauthProviderGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OauthProviderGroupBy) Strings

func (s *OauthProviderGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OauthProviderGroupBy) StringsX

func (s *OauthProviderGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OauthProviderMutation

type OauthProviderMutation struct {
	// contains filtered or unexported fields
}

OauthProviderMutation represents an operation that mutates the OauthProvider nodes in the graph.

func (*OauthProviderMutation) AddAuthStyle

func (m *OauthProviderMutation) AddAuthStyle(u int64)

AddAuthStyle adds u to the "auth_style" field.

func (*OauthProviderMutation) AddField

func (m *OauthProviderMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*OauthProviderMutation) AddedAuthStyle

func (m *OauthProviderMutation) AddedAuthStyle() (r int64, exists bool)

AddedAuthStyle returns the value that was added to the "auth_style" field in this mutation.

func (*OauthProviderMutation) AddedEdges

func (m *OauthProviderMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*OauthProviderMutation) AddedField

func (m *OauthProviderMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*OauthProviderMutation) AddedFields

func (m *OauthProviderMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*OauthProviderMutation) AddedIDs

func (m *OauthProviderMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*OauthProviderMutation) AuthStyle

func (m *OauthProviderMutation) AuthStyle() (r uint64, exists bool)

AuthStyle returns the value of the "auth_style" field in the mutation.

func (*OauthProviderMutation) AuthURL

func (m *OauthProviderMutation) AuthURL() (r string, exists bool)

AuthURL returns the value of the "auth_url" field in the mutation.

func (*OauthProviderMutation) ClearEdge

func (m *OauthProviderMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*OauthProviderMutation) ClearField

func (m *OauthProviderMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*OauthProviderMutation) ClearedEdges

func (m *OauthProviderMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*OauthProviderMutation) ClearedFields

func (m *OauthProviderMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (OauthProviderMutation) Client

func (m OauthProviderMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*OauthProviderMutation) ClientID

func (m *OauthProviderMutation) ClientID() (r string, exists bool)

ClientID returns the value of the "client_id" field in the mutation.

func (*OauthProviderMutation) ClientSecret

func (m *OauthProviderMutation) ClientSecret() (r string, exists bool)

ClientSecret returns the value of the "client_secret" field in the mutation.

func (*OauthProviderMutation) CreatedAt

func (m *OauthProviderMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*OauthProviderMutation) EdgeCleared

func (m *OauthProviderMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*OauthProviderMutation) ExecContext added in v1.0.9

func (c *OauthProviderMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*OauthProviderMutation) Field

func (m *OauthProviderMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*OauthProviderMutation) FieldCleared

func (m *OauthProviderMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*OauthProviderMutation) Fields

func (m *OauthProviderMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*OauthProviderMutation) ID

func (m *OauthProviderMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*OauthProviderMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*OauthProviderMutation) InfoURL

func (m *OauthProviderMutation) InfoURL() (r string, exists bool)

InfoURL returns the value of the "info_url" field in the mutation.

func (*OauthProviderMutation) Name

func (m *OauthProviderMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*OauthProviderMutation) OldAuthStyle

func (m *OauthProviderMutation) OldAuthStyle(ctx context.Context) (v uint64, err error)

OldAuthStyle returns the old "auth_style" field's value of the OauthProvider entity. If the OauthProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OauthProviderMutation) OldAuthURL

func (m *OauthProviderMutation) OldAuthURL(ctx context.Context) (v string, err error)

OldAuthURL returns the old "auth_url" field's value of the OauthProvider entity. If the OauthProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OauthProviderMutation) OldClientID

func (m *OauthProviderMutation) OldClientID(ctx context.Context) (v string, err error)

OldClientID returns the old "client_id" field's value of the OauthProvider entity. If the OauthProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OauthProviderMutation) OldClientSecret

func (m *OauthProviderMutation) OldClientSecret(ctx context.Context) (v string, err error)

OldClientSecret returns the old "client_secret" field's value of the OauthProvider entity. If the OauthProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OauthProviderMutation) OldCreatedAt

func (m *OauthProviderMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the OauthProvider entity. If the OauthProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OauthProviderMutation) OldField

func (m *OauthProviderMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*OauthProviderMutation) OldInfoURL

func (m *OauthProviderMutation) OldInfoURL(ctx context.Context) (v string, err error)

OldInfoURL returns the old "info_url" field's value of the OauthProvider entity. If the OauthProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OauthProviderMutation) OldName

func (m *OauthProviderMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the OauthProvider entity. If the OauthProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OauthProviderMutation) OldRedirectURL

func (m *OauthProviderMutation) OldRedirectURL(ctx context.Context) (v string, err error)

OldRedirectURL returns the old "redirect_url" field's value of the OauthProvider entity. If the OauthProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OauthProviderMutation) OldScopes

func (m *OauthProviderMutation) OldScopes(ctx context.Context) (v string, err error)

OldScopes returns the old "scopes" field's value of the OauthProvider entity. If the OauthProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OauthProviderMutation) OldTokenURL

func (m *OauthProviderMutation) OldTokenURL(ctx context.Context) (v string, err error)

OldTokenURL returns the old "token_url" field's value of the OauthProvider entity. If the OauthProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OauthProviderMutation) OldUpdatedAt

func (m *OauthProviderMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the OauthProvider entity. If the OauthProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*OauthProviderMutation) Op

func (m *OauthProviderMutation) Op() Op

Op returns the operation name.

func (*OauthProviderMutation) QueryContext added in v1.0.9

func (c *OauthProviderMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*OauthProviderMutation) RedirectURL

func (m *OauthProviderMutation) RedirectURL() (r string, exists bool)

RedirectURL returns the value of the "redirect_url" field in the mutation.

func (*OauthProviderMutation) RemovedEdges

func (m *OauthProviderMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*OauthProviderMutation) RemovedIDs

func (m *OauthProviderMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*OauthProviderMutation) ResetAuthStyle

func (m *OauthProviderMutation) ResetAuthStyle()

ResetAuthStyle resets all changes to the "auth_style" field.

func (*OauthProviderMutation) ResetAuthURL

func (m *OauthProviderMutation) ResetAuthURL()

ResetAuthURL resets all changes to the "auth_url" field.

func (*OauthProviderMutation) ResetClientID

func (m *OauthProviderMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*OauthProviderMutation) ResetClientSecret

func (m *OauthProviderMutation) ResetClientSecret()

ResetClientSecret resets all changes to the "client_secret" field.

func (*OauthProviderMutation) ResetCreatedAt

func (m *OauthProviderMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OauthProviderMutation) ResetEdge

func (m *OauthProviderMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*OauthProviderMutation) ResetField

func (m *OauthProviderMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*OauthProviderMutation) ResetInfoURL

func (m *OauthProviderMutation) ResetInfoURL()

ResetInfoURL resets all changes to the "info_url" field.

func (*OauthProviderMutation) ResetName

func (m *OauthProviderMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*OauthProviderMutation) ResetRedirectURL

func (m *OauthProviderMutation) ResetRedirectURL()

ResetRedirectURL resets all changes to the "redirect_url" field.

func (*OauthProviderMutation) ResetScopes

func (m *OauthProviderMutation) ResetScopes()

ResetScopes resets all changes to the "scopes" field.

func (*OauthProviderMutation) ResetTokenURL

func (m *OauthProviderMutation) ResetTokenURL()

ResetTokenURL resets all changes to the "token_url" field.

func (*OauthProviderMutation) ResetUpdatedAt

func (m *OauthProviderMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OauthProviderMutation) Scopes

func (m *OauthProviderMutation) Scopes() (r string, exists bool)

Scopes returns the value of the "scopes" field in the mutation.

func (*OauthProviderMutation) SetAuthStyle

func (m *OauthProviderMutation) SetAuthStyle(u uint64)

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderMutation) SetAuthURL

func (m *OauthProviderMutation) SetAuthURL(s string)

SetAuthURL sets the "auth_url" field.

func (*OauthProviderMutation) SetClientID

func (m *OauthProviderMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*OauthProviderMutation) SetClientSecret

func (m *OauthProviderMutation) SetClientSecret(s string)

SetClientSecret sets the "client_secret" field.

func (*OauthProviderMutation) SetCreatedAt

func (m *OauthProviderMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*OauthProviderMutation) SetField

func (m *OauthProviderMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*OauthProviderMutation) SetID

func (m *OauthProviderMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of OauthProvider entities.

func (*OauthProviderMutation) SetInfoURL

func (m *OauthProviderMutation) SetInfoURL(s string)

SetInfoURL sets the "info_url" field.

func (*OauthProviderMutation) SetName

func (m *OauthProviderMutation) SetName(s string)

SetName sets the "name" field.

func (*OauthProviderMutation) SetOp

func (m *OauthProviderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OauthProviderMutation) SetRedirectURL

func (m *OauthProviderMutation) SetRedirectURL(s string)

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderMutation) SetScopes

func (m *OauthProviderMutation) SetScopes(s string)

SetScopes sets the "scopes" field.

func (*OauthProviderMutation) SetTokenURL

func (m *OauthProviderMutation) SetTokenURL(s string)

SetTokenURL sets the "token_url" field.

func (*OauthProviderMutation) SetUpdatedAt

func (m *OauthProviderMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*OauthProviderMutation) TokenURL

func (m *OauthProviderMutation) TokenURL() (r string, exists bool)

TokenURL returns the value of the "token_url" field in the mutation.

func (OauthProviderMutation) Tx

func (m OauthProviderMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*OauthProviderMutation) Type

func (m *OauthProviderMutation) Type() string

Type returns the node type of this mutation (OauthProvider).

func (*OauthProviderMutation) UpdatedAt

func (m *OauthProviderMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*OauthProviderMutation) Where

Where appends a list predicates to the OauthProviderMutation builder.

func (*OauthProviderMutation) WhereP

func (m *OauthProviderMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the OauthProviderMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type OauthProviderPageList

type OauthProviderPageList struct {
	List        []*OauthProvider `json:"list"`
	PageDetails *PageDetails     `json:"pageDetails"`
}

OauthProviderPageList is OauthProvider PageList result.

type OauthProviderPager

type OauthProviderPager struct {
	Order  oauthprovider.OrderOption
	Filter func(*OauthProviderQuery) (*OauthProviderQuery, error)
}

func (*OauthProviderPager) ApplyFilter

type OauthProviderPaginateOption

type OauthProviderPaginateOption func(*OauthProviderPager)

OauthProviderPaginateOption enables pagination customization.

type OauthProviderQuery

type OauthProviderQuery struct {
	// contains filtered or unexported fields
}

OauthProviderQuery is the builder for querying OauthProvider entities.

func (*OauthProviderQuery) Aggregate

func (opq *OauthProviderQuery) Aggregate(fns ...AggregateFunc) *OauthProviderSelect

Aggregate returns a OauthProviderSelect configured with the given aggregations.

func (*OauthProviderQuery) All

All executes the query and returns a list of OauthProviders.

func (*OauthProviderQuery) AllX

func (opq *OauthProviderQuery) AllX(ctx context.Context) []*OauthProvider

AllX is like All, but panics if an error occurs.

func (*OauthProviderQuery) Clone

func (opq *OauthProviderQuery) Clone() *OauthProviderQuery

Clone returns a duplicate of the OauthProviderQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*OauthProviderQuery) Count

func (opq *OauthProviderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OauthProviderQuery) CountX

func (opq *OauthProviderQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*OauthProviderQuery) ExecContext added in v1.0.9

func (c *OauthProviderQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*OauthProviderQuery) Exist

func (opq *OauthProviderQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*OauthProviderQuery) ExistX

func (opq *OauthProviderQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*OauthProviderQuery) First

First returns the first OauthProvider entity from the query. Returns a *NotFoundError when no OauthProvider was found.

func (*OauthProviderQuery) FirstID

func (opq *OauthProviderQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first OauthProvider ID from the query. Returns a *NotFoundError when no OauthProvider ID was found.

func (*OauthProviderQuery) FirstIDX

func (opq *OauthProviderQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*OauthProviderQuery) FirstX

func (opq *OauthProviderQuery) FirstX(ctx context.Context) *OauthProvider

FirstX is like First, but panics if an error occurs.

func (*OauthProviderQuery) GroupBy

func (opq *OauthProviderQuery) GroupBy(field string, fields ...string) *OauthProviderGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.OauthProvider.Query().
	GroupBy(oauthprovider.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OauthProviderQuery) IDs

func (opq *OauthProviderQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of OauthProvider IDs.

func (*OauthProviderQuery) IDsX

func (opq *OauthProviderQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*OauthProviderQuery) Limit

func (opq *OauthProviderQuery) Limit(limit int) *OauthProviderQuery

Limit the number of records to be returned by this query.

func (*OauthProviderQuery) Offset

func (opq *OauthProviderQuery) Offset(offset int) *OauthProviderQuery

Offset to start from.

func (*OauthProviderQuery) Only

Only returns a single OauthProvider entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one OauthProvider entity is found. Returns a *NotFoundError when no OauthProvider entities are found.

func (*OauthProviderQuery) OnlyID

func (opq *OauthProviderQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only OauthProvider ID in the query. Returns a *NotSingularError when more than one OauthProvider ID is found. Returns a *NotFoundError when no entities are found.

func (*OauthProviderQuery) OnlyIDX

func (opq *OauthProviderQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*OauthProviderQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*OauthProviderQuery) Order

Order specifies how the records should be ordered.

func (*OauthProviderQuery) Page

func (op *OauthProviderQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...OauthProviderPaginateOption,
) (*OauthProviderPageList, error)

func (*OauthProviderQuery) QueryContext added in v1.0.9

func (c *OauthProviderQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*OauthProviderQuery) Select

func (opq *OauthProviderQuery) Select(fields ...string) *OauthProviderSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.OauthProvider.Query().
	Select(oauthprovider.FieldCreatedAt).
	Scan(ctx, &v)

func (*OauthProviderQuery) Unique

func (opq *OauthProviderQuery) Unique(unique bool) *OauthProviderQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*OauthProviderQuery) Where

Where adds a new predicate for the OauthProviderQuery builder.

type OauthProviderSelect

type OauthProviderSelect struct {
	*OauthProviderQuery
	// contains filtered or unexported fields
}

OauthProviderSelect is the builder for selecting fields of OauthProvider entities.

func (*OauthProviderSelect) Aggregate

func (ops *OauthProviderSelect) Aggregate(fns ...AggregateFunc) *OauthProviderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OauthProviderSelect) Bool

func (s *OauthProviderSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*OauthProviderSelect) BoolX

func (s *OauthProviderSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*OauthProviderSelect) Bools

func (s *OauthProviderSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*OauthProviderSelect) BoolsX

func (s *OauthProviderSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (OauthProviderSelect) ExecContext added in v1.0.9

func (c OauthProviderSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*OauthProviderSelect) Float64

func (s *OauthProviderSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*OauthProviderSelect) Float64X

func (s *OauthProviderSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*OauthProviderSelect) Float64s

func (s *OauthProviderSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*OauthProviderSelect) Float64sX

func (s *OauthProviderSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*OauthProviderSelect) Int

func (s *OauthProviderSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*OauthProviderSelect) IntX

func (s *OauthProviderSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*OauthProviderSelect) Ints

func (s *OauthProviderSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*OauthProviderSelect) IntsX

func (s *OauthProviderSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (OauthProviderSelect) QueryContext added in v1.0.9

func (c OauthProviderSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*OauthProviderSelect) Scan

func (ops *OauthProviderSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*OauthProviderSelect) ScanX

func (s *OauthProviderSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*OauthProviderSelect) String

func (s *OauthProviderSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*OauthProviderSelect) StringX

func (s *OauthProviderSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*OauthProviderSelect) Strings

func (s *OauthProviderSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*OauthProviderSelect) StringsX

func (s *OauthProviderSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type OauthProviderUpdate

type OauthProviderUpdate struct {
	// contains filtered or unexported fields
}

OauthProviderUpdate is the builder for updating OauthProvider entities.

func (*OauthProviderUpdate) AddAuthStyle

func (opu *OauthProviderUpdate) AddAuthStyle(u int64) *OauthProviderUpdate

AddAuthStyle adds u to the "auth_style" field.

func (*OauthProviderUpdate) Exec

func (opu *OauthProviderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OauthProviderUpdate) ExecContext added in v1.0.9

func (c *OauthProviderUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*OauthProviderUpdate) ExecX

func (opu *OauthProviderUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OauthProviderUpdate) Mutation

func (opu *OauthProviderUpdate) Mutation() *OauthProviderMutation

Mutation returns the OauthProviderMutation object of the builder.

func (*OauthProviderUpdate) QueryContext added in v1.0.9

func (c *OauthProviderUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*OauthProviderUpdate) Save

func (opu *OauthProviderUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*OauthProviderUpdate) SaveX

func (opu *OauthProviderUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*OauthProviderUpdate) SetAuthStyle

func (opu *OauthProviderUpdate) SetAuthStyle(u uint64) *OauthProviderUpdate

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderUpdate) SetAuthURL

func (opu *OauthProviderUpdate) SetAuthURL(s string) *OauthProviderUpdate

SetAuthURL sets the "auth_url" field.

func (*OauthProviderUpdate) SetClientID

func (opu *OauthProviderUpdate) SetClientID(s string) *OauthProviderUpdate

SetClientID sets the "client_id" field.

func (*OauthProviderUpdate) SetClientSecret

func (opu *OauthProviderUpdate) SetClientSecret(s string) *OauthProviderUpdate

SetClientSecret sets the "client_secret" field.

func (*OauthProviderUpdate) SetInfoURL

func (opu *OauthProviderUpdate) SetInfoURL(s string) *OauthProviderUpdate

SetInfoURL sets the "info_url" field.

func (*OauthProviderUpdate) SetName

SetName sets the "name" field.

func (*OauthProviderUpdate) SetNillableAuthStyle added in v1.2.3

func (opu *OauthProviderUpdate) SetNillableAuthStyle(u *uint64) *OauthProviderUpdate

SetNillableAuthStyle sets the "auth_style" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableAuthURL added in v1.2.3

func (opu *OauthProviderUpdate) SetNillableAuthURL(s *string) *OauthProviderUpdate

SetNillableAuthURL sets the "auth_url" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableClientID added in v1.2.3

func (opu *OauthProviderUpdate) SetNillableClientID(s *string) *OauthProviderUpdate

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableClientSecret added in v1.2.3

func (opu *OauthProviderUpdate) SetNillableClientSecret(s *string) *OauthProviderUpdate

SetNillableClientSecret sets the "client_secret" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableInfoURL added in v1.2.3

func (opu *OauthProviderUpdate) SetNillableInfoURL(s *string) *OauthProviderUpdate

SetNillableInfoURL sets the "info_url" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableName added in v1.2.3

func (opu *OauthProviderUpdate) SetNillableName(s *string) *OauthProviderUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableRedirectURL added in v1.2.3

func (opu *OauthProviderUpdate) SetNillableRedirectURL(s *string) *OauthProviderUpdate

SetNillableRedirectURL sets the "redirect_url" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableScopes added in v1.2.3

func (opu *OauthProviderUpdate) SetNillableScopes(s *string) *OauthProviderUpdate

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableTokenURL added in v1.2.3

func (opu *OauthProviderUpdate) SetNillableTokenURL(s *string) *OauthProviderUpdate

SetNillableTokenURL sets the "token_url" field if the given value is not nil.

func (*OauthProviderUpdate) SetNotEmptyAuthStyle

func (op *OauthProviderUpdate) SetNotEmptyAuthStyle(value uint64) *OauthProviderUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdate) SetNotEmptyAuthURL

func (op *OauthProviderUpdate) SetNotEmptyAuthURL(value string) *OauthProviderUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdate) SetNotEmptyClientID

func (op *OauthProviderUpdate) SetNotEmptyClientID(value string) *OauthProviderUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdate) SetNotEmptyClientSecret

func (op *OauthProviderUpdate) SetNotEmptyClientSecret(value string) *OauthProviderUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdate) SetNotEmptyInfoURL

func (op *OauthProviderUpdate) SetNotEmptyInfoURL(value string) *OauthProviderUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdate) SetNotEmptyName

func (op *OauthProviderUpdate) SetNotEmptyName(value string) *OauthProviderUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdate) SetNotEmptyRedirectURL

func (op *OauthProviderUpdate) SetNotEmptyRedirectURL(value string) *OauthProviderUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdate) SetNotEmptyScopes

func (op *OauthProviderUpdate) SetNotEmptyScopes(value string) *OauthProviderUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdate) SetNotEmptyTokenURL

func (op *OauthProviderUpdate) SetNotEmptyTokenURL(value string) *OauthProviderUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdate) SetNotNilAuthStyle added in v1.0.9

func (op *OauthProviderUpdate) SetNotNilAuthStyle(value *uint64) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilAuthURL added in v1.0.9

func (op *OauthProviderUpdate) SetNotNilAuthURL(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilClientID added in v1.0.9

func (op *OauthProviderUpdate) SetNotNilClientID(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilClientSecret added in v1.0.9

func (op *OauthProviderUpdate) SetNotNilClientSecret(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilInfoURL added in v1.0.9

func (op *OauthProviderUpdate) SetNotNilInfoURL(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilName added in v1.0.9

func (op *OauthProviderUpdate) SetNotNilName(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilRedirectURL added in v1.0.9

func (op *OauthProviderUpdate) SetNotNilRedirectURL(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilScopes added in v1.0.9

func (op *OauthProviderUpdate) SetNotNilScopes(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilTokenURL added in v1.0.9

func (op *OauthProviderUpdate) SetNotNilTokenURL(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilUpdatedAt added in v1.0.9

func (op *OauthProviderUpdate) SetNotNilUpdatedAt(value *time.Time) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetRedirectURL

func (opu *OauthProviderUpdate) SetRedirectURL(s string) *OauthProviderUpdate

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderUpdate) SetScopes

func (opu *OauthProviderUpdate) SetScopes(s string) *OauthProviderUpdate

SetScopes sets the "scopes" field.

func (*OauthProviderUpdate) SetTokenURL

func (opu *OauthProviderUpdate) SetTokenURL(s string) *OauthProviderUpdate

SetTokenURL sets the "token_url" field.

func (*OauthProviderUpdate) SetUpdatedAt

func (opu *OauthProviderUpdate) SetUpdatedAt(t time.Time) *OauthProviderUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OauthProviderUpdate) Where

Where appends a list predicates to the OauthProviderUpdate builder.

type OauthProviderUpdateOne

type OauthProviderUpdateOne struct {
	// contains filtered or unexported fields
}

OauthProviderUpdateOne is the builder for updating a single OauthProvider entity.

func (*OauthProviderUpdateOne) AddAuthStyle

func (opuo *OauthProviderUpdateOne) AddAuthStyle(u int64) *OauthProviderUpdateOne

AddAuthStyle adds u to the "auth_style" field.

func (*OauthProviderUpdateOne) Exec

func (opuo *OauthProviderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OauthProviderUpdateOne) ExecContext added in v1.0.9

func (c *OauthProviderUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*OauthProviderUpdateOne) ExecX

func (opuo *OauthProviderUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*OauthProviderUpdateOne) Mutation

Mutation returns the OauthProviderMutation object of the builder.

func (*OauthProviderUpdateOne) QueryContext added in v1.0.9

func (c *OauthProviderUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*OauthProviderUpdateOne) Save

Save executes the query and returns the updated OauthProvider entity.

func (*OauthProviderUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*OauthProviderUpdateOne) Select

func (opuo *OauthProviderUpdateOne) Select(field string, fields ...string) *OauthProviderUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*OauthProviderUpdateOne) SetAuthStyle

func (opuo *OauthProviderUpdateOne) SetAuthStyle(u uint64) *OauthProviderUpdateOne

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderUpdateOne) SetAuthURL

SetAuthURL sets the "auth_url" field.

func (*OauthProviderUpdateOne) SetClientID

SetClientID sets the "client_id" field.

func (*OauthProviderUpdateOne) SetClientSecret

func (opuo *OauthProviderUpdateOne) SetClientSecret(s string) *OauthProviderUpdateOne

SetClientSecret sets the "client_secret" field.

func (*OauthProviderUpdateOne) SetInfoURL

SetInfoURL sets the "info_url" field.

func (*OauthProviderUpdateOne) SetName

SetName sets the "name" field.

func (*OauthProviderUpdateOne) SetNillableAuthStyle added in v1.2.3

func (opuo *OauthProviderUpdateOne) SetNillableAuthStyle(u *uint64) *OauthProviderUpdateOne

SetNillableAuthStyle sets the "auth_style" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableAuthURL added in v1.2.3

func (opuo *OauthProviderUpdateOne) SetNillableAuthURL(s *string) *OauthProviderUpdateOne

SetNillableAuthURL sets the "auth_url" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableClientID added in v1.2.3

func (opuo *OauthProviderUpdateOne) SetNillableClientID(s *string) *OauthProviderUpdateOne

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableClientSecret added in v1.2.3

func (opuo *OauthProviderUpdateOne) SetNillableClientSecret(s *string) *OauthProviderUpdateOne

SetNillableClientSecret sets the "client_secret" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableInfoURL added in v1.2.3

func (opuo *OauthProviderUpdateOne) SetNillableInfoURL(s *string) *OauthProviderUpdateOne

SetNillableInfoURL sets the "info_url" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableName added in v1.2.3

func (opuo *OauthProviderUpdateOne) SetNillableName(s *string) *OauthProviderUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableRedirectURL added in v1.2.3

func (opuo *OauthProviderUpdateOne) SetNillableRedirectURL(s *string) *OauthProviderUpdateOne

SetNillableRedirectURL sets the "redirect_url" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableScopes added in v1.2.3

func (opuo *OauthProviderUpdateOne) SetNillableScopes(s *string) *OauthProviderUpdateOne

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableTokenURL added in v1.2.3

func (opuo *OauthProviderUpdateOne) SetNillableTokenURL(s *string) *OauthProviderUpdateOne

SetNillableTokenURL sets the "token_url" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNotEmptyAuthStyle

func (op *OauthProviderUpdateOne) SetNotEmptyAuthStyle(value uint64) *OauthProviderUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdateOne) SetNotEmptyAuthURL

func (op *OauthProviderUpdateOne) SetNotEmptyAuthURL(value string) *OauthProviderUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdateOne) SetNotEmptyClientID

func (op *OauthProviderUpdateOne) SetNotEmptyClientID(value string) *OauthProviderUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdateOne) SetNotEmptyClientSecret

func (op *OauthProviderUpdateOne) SetNotEmptyClientSecret(value string) *OauthProviderUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdateOne) SetNotEmptyInfoURL

func (op *OauthProviderUpdateOne) SetNotEmptyInfoURL(value string) *OauthProviderUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdateOne) SetNotEmptyName

func (op *OauthProviderUpdateOne) SetNotEmptyName(value string) *OauthProviderUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdateOne) SetNotEmptyRedirectURL

func (op *OauthProviderUpdateOne) SetNotEmptyRedirectURL(value string) *OauthProviderUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdateOne) SetNotEmptyScopes

func (op *OauthProviderUpdateOne) SetNotEmptyScopes(value string) *OauthProviderUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdateOne) SetNotEmptyTokenURL

func (op *OauthProviderUpdateOne) SetNotEmptyTokenURL(value string) *OauthProviderUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*OauthProviderUpdateOne) SetNotNilAuthStyle added in v1.0.9

func (op *OauthProviderUpdateOne) SetNotNilAuthStyle(value *uint64) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilAuthURL added in v1.0.9

func (op *OauthProviderUpdateOne) SetNotNilAuthURL(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilClientID added in v1.0.9

func (op *OauthProviderUpdateOne) SetNotNilClientID(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilClientSecret added in v1.0.9

func (op *OauthProviderUpdateOne) SetNotNilClientSecret(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilInfoURL added in v1.0.9

func (op *OauthProviderUpdateOne) SetNotNilInfoURL(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilName added in v1.0.9

func (op *OauthProviderUpdateOne) SetNotNilName(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilRedirectURL added in v1.0.9

func (op *OauthProviderUpdateOne) SetNotNilRedirectURL(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilScopes added in v1.0.9

func (op *OauthProviderUpdateOne) SetNotNilScopes(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilTokenURL added in v1.0.9

func (op *OauthProviderUpdateOne) SetNotNilTokenURL(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilUpdatedAt added in v1.0.9

func (op *OauthProviderUpdateOne) SetNotNilUpdatedAt(value *time.Time) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetRedirectURL

func (opuo *OauthProviderUpdateOne) SetRedirectURL(s string) *OauthProviderUpdateOne

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderUpdateOne) SetScopes

SetScopes sets the "scopes" field.

func (*OauthProviderUpdateOne) SetTokenURL

SetTokenURL sets the "token_url" field.

func (*OauthProviderUpdateOne) SetUpdatedAt

func (opuo *OauthProviderUpdateOne) SetUpdatedAt(t time.Time) *OauthProviderUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*OauthProviderUpdateOne) Where

Where appends a list predicates to the OauthProviderUpdate builder.

type OauthProviders

type OauthProviders []*OauthProvider

OauthProviders is a parsable slice of OauthProvider.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type PageDetails

type PageDetails struct {
	Page  uint64 `json:"page"`
	Size  uint64 `json:"size"`
	Total uint64 `json:"total"`
}

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Position

type Position struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Sort Number | 排序编号
	Sort uint32 `json:"sort,omitempty"`
	// Position Name | 职位名称
	Name string `json:"name,omitempty"`
	// The code of position | 职位编码
	Code string `json:"code,omitempty"`
	// Remark | 备注
	Remark string `json:"remark,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PositionQuery when eager-loading is set.
	Edges PositionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Position is the model entity for the Position schema.

func (*Position) ExecContext added in v1.0.9

func (c *Position) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Position) QueryContext added in v1.0.9

func (c *Position) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Position) QueryUsers

func (po *Position) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Position entity.

func (*Position) String

func (po *Position) String() string

String implements the fmt.Stringer.

func (*Position) Unwrap

func (po *Position) Unwrap() *Position

Unwrap unwraps the Position entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Position) Update

func (po *Position) Update() *PositionUpdateOne

Update returns a builder for updating this Position. Note that you need to call Position.Unwrap() before calling this method if this Position was returned from a transaction, and the transaction was committed or rolled back.

func (*Position) Value added in v1.0.0

func (po *Position) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Position. This includes values selected through modifiers, order, etc.

type PositionClient

type PositionClient struct {
	// contains filtered or unexported fields
}

PositionClient is a client for the Position schema.

func NewPositionClient

func NewPositionClient(c config) *PositionClient

NewPositionClient returns a client for the Position from the given config.

func (*PositionClient) Create

func (c *PositionClient) Create() *PositionCreate

Create returns a builder for creating a Position entity.

func (*PositionClient) CreateBulk

func (c *PositionClient) CreateBulk(builders ...*PositionCreate) *PositionCreateBulk

CreateBulk returns a builder for creating a bulk of Position entities.

func (*PositionClient) Delete

func (c *PositionClient) Delete() *PositionDelete

Delete returns a delete builder for Position.

func (*PositionClient) DeleteOne

func (c *PositionClient) DeleteOne(po *Position) *PositionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PositionClient) DeleteOneID

func (c *PositionClient) DeleteOneID(id uint64) *PositionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*PositionClient) ExecContext added in v1.0.9

func (c *PositionClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PositionClient) Get

func (c *PositionClient) Get(ctx context.Context, id uint64) (*Position, error)

Get returns a Position entity by its id.

func (*PositionClient) GetX

func (c *PositionClient) GetX(ctx context.Context, id uint64) *Position

GetX is like Get, but panics if an error occurs.

func (*PositionClient) Hooks

func (c *PositionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*PositionClient) Intercept

func (c *PositionClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `position.Intercept(f(g(h())))`.

func (*PositionClient) Interceptors

func (c *PositionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*PositionClient) MapCreateBulk added in v1.1.5

func (c *PositionClient) MapCreateBulk(slice any, setFunc func(*PositionCreate, int)) *PositionCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*PositionClient) Query

func (c *PositionClient) Query() *PositionQuery

Query returns a query builder for Position.

func (*PositionClient) QueryContext added in v1.0.9

func (c *PositionClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PositionClient) QueryUsers

func (c *PositionClient) QueryUsers(po *Position) *UserQuery

QueryUsers queries the users edge of a Position.

func (*PositionClient) Update

func (c *PositionClient) Update() *PositionUpdate

Update returns an update builder for Position.

func (*PositionClient) UpdateOne

func (c *PositionClient) UpdateOne(po *Position) *PositionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PositionClient) UpdateOneID

func (c *PositionClient) UpdateOneID(id uint64) *PositionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PositionClient) Use

func (c *PositionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `position.Hooks(f(g(h())))`.

type PositionCreate

type PositionCreate struct {
	// contains filtered or unexported fields
}

PositionCreate is the builder for creating a Position entity.

func (*PositionCreate) AddUserIDs

func (pc *PositionCreate) AddUserIDs(ids ...uuid.UUID) *PositionCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*PositionCreate) AddUsers

func (pc *PositionCreate) AddUsers(u ...*User) *PositionCreate

AddUsers adds the "users" edges to the User entity.

func (*PositionCreate) Exec

func (pc *PositionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PositionCreate) ExecContext added in v1.0.9

func (c *PositionCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PositionCreate) ExecX

func (pc *PositionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PositionCreate) Mutation

func (pc *PositionCreate) Mutation() *PositionMutation

Mutation returns the PositionMutation object of the builder.

func (*PositionCreate) QueryContext added in v1.0.9

func (c *PositionCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PositionCreate) Save

func (pc *PositionCreate) Save(ctx context.Context) (*Position, error)

Save creates the Position in the database.

func (*PositionCreate) SaveX

func (pc *PositionCreate) SaveX(ctx context.Context) *Position

SaveX calls Save and panics if Save returns an error.

func (*PositionCreate) SetCode

func (pc *PositionCreate) SetCode(s string) *PositionCreate

SetCode sets the "code" field.

func (*PositionCreate) SetCreatedAt

func (pc *PositionCreate) SetCreatedAt(t time.Time) *PositionCreate

SetCreatedAt sets the "created_at" field.

func (*PositionCreate) SetID

func (pc *PositionCreate) SetID(u uint64) *PositionCreate

SetID sets the "id" field.

func (*PositionCreate) SetName

func (pc *PositionCreate) SetName(s string) *PositionCreate

SetName sets the "name" field.

func (*PositionCreate) SetNillableCreatedAt

func (pc *PositionCreate) SetNillableCreatedAt(t *time.Time) *PositionCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*PositionCreate) SetNillableRemark added in v1.0.13

func (pc *PositionCreate) SetNillableRemark(s *string) *PositionCreate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*PositionCreate) SetNillableSort

func (pc *PositionCreate) SetNillableSort(u *uint32) *PositionCreate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*PositionCreate) SetNillableStatus

func (pc *PositionCreate) SetNillableStatus(u *uint8) *PositionCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PositionCreate) SetNillableUpdatedAt

func (pc *PositionCreate) SetNillableUpdatedAt(t *time.Time) *PositionCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*PositionCreate) SetNotNilCode added in v1.0.9

func (po *PositionCreate) SetNotNilCode(value *string) *PositionCreate

set field if value's pointer is not nil.

func (*PositionCreate) SetNotNilName added in v1.0.9

func (po *PositionCreate) SetNotNilName(value *string) *PositionCreate

set field if value's pointer is not nil.

func (*PositionCreate) SetNotNilRemark added in v1.0.9

func (po *PositionCreate) SetNotNilRemark(value *string) *PositionCreate

set field if value's pointer is not nil.

func (*PositionCreate) SetNotNilSort added in v1.0.9

func (po *PositionCreate) SetNotNilSort(value *uint32) *PositionCreate

set field if value's pointer is not nil.

func (*PositionCreate) SetNotNilStatus added in v1.0.9

func (po *PositionCreate) SetNotNilStatus(value *uint8) *PositionCreate

set field if value's pointer is not nil.

func (*PositionCreate) SetNotNilUpdatedAt added in v1.0.9

func (po *PositionCreate) SetNotNilUpdatedAt(value *time.Time) *PositionCreate

set field if value's pointer is not nil.

func (*PositionCreate) SetRemark

func (pc *PositionCreate) SetRemark(s string) *PositionCreate

SetRemark sets the "remark" field.

func (*PositionCreate) SetSort

func (pc *PositionCreate) SetSort(u uint32) *PositionCreate

SetSort sets the "sort" field.

func (*PositionCreate) SetStatus

func (pc *PositionCreate) SetStatus(u uint8) *PositionCreate

SetStatus sets the "status" field.

func (*PositionCreate) SetUpdatedAt

func (pc *PositionCreate) SetUpdatedAt(t time.Time) *PositionCreate

SetUpdatedAt sets the "updated_at" field.

type PositionCreateBulk

type PositionCreateBulk struct {
	// contains filtered or unexported fields
}

PositionCreateBulk is the builder for creating many Position entities in bulk.

func (*PositionCreateBulk) Exec

func (pcb *PositionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PositionCreateBulk) ExecContext added in v1.0.9

func (c *PositionCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PositionCreateBulk) ExecX

func (pcb *PositionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PositionCreateBulk) QueryContext added in v1.0.9

func (c *PositionCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PositionCreateBulk) Save

func (pcb *PositionCreateBulk) Save(ctx context.Context) ([]*Position, error)

Save creates the Position entities in the database.

func (*PositionCreateBulk) SaveX

func (pcb *PositionCreateBulk) SaveX(ctx context.Context) []*Position

SaveX is like Save, but panics if an error occurs.

type PositionDelete

type PositionDelete struct {
	// contains filtered or unexported fields
}

PositionDelete is the builder for deleting a Position entity.

func (*PositionDelete) Exec

func (pd *PositionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*PositionDelete) ExecContext added in v1.0.9

func (c *PositionDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PositionDelete) ExecX

func (pd *PositionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*PositionDelete) QueryContext added in v1.0.9

func (c *PositionDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PositionDelete) Where

func (pd *PositionDelete) Where(ps ...predicate.Position) *PositionDelete

Where appends a list predicates to the PositionDelete builder.

type PositionDeleteOne

type PositionDeleteOne struct {
	// contains filtered or unexported fields
}

PositionDeleteOne is the builder for deleting a single Position entity.

func (*PositionDeleteOne) Exec

func (pdo *PositionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PositionDeleteOne) ExecX

func (pdo *PositionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PositionDeleteOne) Where

Where appends a list predicates to the PositionDelete builder.

type PositionEdges

type PositionEdges struct {
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// contains filtered or unexported fields
}

PositionEdges holds the relations/edges for other nodes in the graph.

func (PositionEdges) UsersOrErr

func (e PositionEdges) UsersOrErr() ([]*User, error)

UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.

type PositionGroupBy

type PositionGroupBy struct {
	// contains filtered or unexported fields
}

PositionGroupBy is the group-by builder for Position entities.

func (*PositionGroupBy) Aggregate

func (pgb *PositionGroupBy) Aggregate(fns ...AggregateFunc) *PositionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*PositionGroupBy) Bool

func (s *PositionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) BoolX

func (s *PositionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PositionGroupBy) Bools

func (s *PositionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) BoolsX

func (s *PositionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*PositionGroupBy) Float64

func (s *PositionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) Float64X

func (s *PositionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PositionGroupBy) Float64s

func (s *PositionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) Float64sX

func (s *PositionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PositionGroupBy) Int

func (s *PositionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) IntX

func (s *PositionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PositionGroupBy) Ints

func (s *PositionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) IntsX

func (s *PositionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*PositionGroupBy) Scan

func (pgb *PositionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PositionGroupBy) ScanX

func (s *PositionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PositionGroupBy) String

func (s *PositionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) StringX

func (s *PositionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PositionGroupBy) Strings

func (s *PositionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PositionGroupBy) StringsX

func (s *PositionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PositionMutation

type PositionMutation struct {
	// contains filtered or unexported fields
}

PositionMutation represents an operation that mutates the Position nodes in the graph.

func (*PositionMutation) AddField

func (m *PositionMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PositionMutation) AddSort

func (m *PositionMutation) AddSort(u int32)

AddSort adds u to the "sort" field.

func (*PositionMutation) AddStatus

func (m *PositionMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*PositionMutation) AddUserIDs

func (m *PositionMutation) AddUserIDs(ids ...uuid.UUID)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*PositionMutation) AddedEdges

func (m *PositionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*PositionMutation) AddedField

func (m *PositionMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PositionMutation) AddedFields

func (m *PositionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*PositionMutation) AddedIDs

func (m *PositionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*PositionMutation) AddedSort

func (m *PositionMutation) AddedSort() (r int32, exists bool)

AddedSort returns the value that was added to the "sort" field in this mutation.

func (*PositionMutation) AddedStatus

func (m *PositionMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*PositionMutation) ClearEdge

func (m *PositionMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*PositionMutation) ClearField

func (m *PositionMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*PositionMutation) ClearRemark added in v1.0.13

func (m *PositionMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*PositionMutation) ClearStatus

func (m *PositionMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*PositionMutation) ClearUsers

func (m *PositionMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*PositionMutation) ClearedEdges

func (m *PositionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*PositionMutation) ClearedFields

func (m *PositionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (PositionMutation) Client

func (m PositionMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*PositionMutation) Code

func (m *PositionMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*PositionMutation) CreatedAt

func (m *PositionMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*PositionMutation) EdgeCleared

func (m *PositionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*PositionMutation) ExecContext added in v1.0.9

func (c *PositionMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PositionMutation) Field

func (m *PositionMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*PositionMutation) FieldCleared

func (m *PositionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*PositionMutation) Fields

func (m *PositionMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*PositionMutation) ID

func (m *PositionMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*PositionMutation) IDs

func (m *PositionMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*PositionMutation) Name

func (m *PositionMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*PositionMutation) OldCode

func (m *PositionMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Position entity. If the Position object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PositionMutation) OldCreatedAt

func (m *PositionMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Position entity. If the Position object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PositionMutation) OldField

func (m *PositionMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*PositionMutation) OldName

func (m *PositionMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Position entity. If the Position object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PositionMutation) OldRemark

func (m *PositionMutation) OldRemark(ctx context.Context) (v string, err error)

OldRemark returns the old "remark" field's value of the Position entity. If the Position object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PositionMutation) OldSort

func (m *PositionMutation) OldSort(ctx context.Context) (v uint32, err error)

OldSort returns the old "sort" field's value of the Position entity. If the Position object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PositionMutation) OldStatus

func (m *PositionMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the Position entity. If the Position object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PositionMutation) OldUpdatedAt

func (m *PositionMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Position entity. If the Position object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*PositionMutation) Op

func (m *PositionMutation) Op() Op

Op returns the operation name.

func (*PositionMutation) QueryContext added in v1.0.9

func (c *PositionMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PositionMutation) Remark

func (m *PositionMutation) Remark() (r string, exists bool)

Remark returns the value of the "remark" field in the mutation.

func (*PositionMutation) RemarkCleared added in v1.0.13

func (m *PositionMutation) RemarkCleared() bool

RemarkCleared returns if the "remark" field was cleared in this mutation.

func (*PositionMutation) RemoveUserIDs

func (m *PositionMutation) RemoveUserIDs(ids ...uuid.UUID)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*PositionMutation) RemovedEdges

func (m *PositionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*PositionMutation) RemovedIDs

func (m *PositionMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*PositionMutation) RemovedUsersIDs

func (m *PositionMutation) RemovedUsersIDs() (ids []uuid.UUID)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*PositionMutation) ResetCode

func (m *PositionMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*PositionMutation) ResetCreatedAt

func (m *PositionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PositionMutation) ResetEdge

func (m *PositionMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*PositionMutation) ResetField

func (m *PositionMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*PositionMutation) ResetName

func (m *PositionMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PositionMutation) ResetRemark

func (m *PositionMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*PositionMutation) ResetSort

func (m *PositionMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*PositionMutation) ResetStatus

func (m *PositionMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*PositionMutation) ResetUpdatedAt

func (m *PositionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PositionMutation) ResetUsers

func (m *PositionMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*PositionMutation) SetCode

func (m *PositionMutation) SetCode(s string)

SetCode sets the "code" field.

func (*PositionMutation) SetCreatedAt

func (m *PositionMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*PositionMutation) SetField

func (m *PositionMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*PositionMutation) SetID

func (m *PositionMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Position entities.

func (*PositionMutation) SetName

func (m *PositionMutation) SetName(s string)

SetName sets the "name" field.

func (*PositionMutation) SetOp

func (m *PositionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PositionMutation) SetRemark

func (m *PositionMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*PositionMutation) SetSort

func (m *PositionMutation) SetSort(u uint32)

SetSort sets the "sort" field.

func (*PositionMutation) SetStatus

func (m *PositionMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*PositionMutation) SetUpdatedAt

func (m *PositionMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*PositionMutation) Sort

func (m *PositionMutation) Sort() (r uint32, exists bool)

Sort returns the value of the "sort" field in the mutation.

func (*PositionMutation) Status

func (m *PositionMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*PositionMutation) StatusCleared

func (m *PositionMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (PositionMutation) Tx

func (m PositionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*PositionMutation) Type

func (m *PositionMutation) Type() string

Type returns the node type of this mutation (Position).

func (*PositionMutation) UpdatedAt

func (m *PositionMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*PositionMutation) UsersCleared

func (m *PositionMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*PositionMutation) UsersIDs

func (m *PositionMutation) UsersIDs() (ids []uuid.UUID)

UsersIDs returns the "users" edge IDs in the mutation.

func (*PositionMutation) Where

func (m *PositionMutation) Where(ps ...predicate.Position)

Where appends a list predicates to the PositionMutation builder.

func (*PositionMutation) WhereP

func (m *PositionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the PositionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type PositionPageList

type PositionPageList struct {
	List        []*Position  `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

PositionPageList is Position PageList result.

type PositionPager

type PositionPager struct {
	Order  position.OrderOption
	Filter func(*PositionQuery) (*PositionQuery, error)
}

func (*PositionPager) ApplyFilter

func (p *PositionPager) ApplyFilter(query *PositionQuery) (*PositionQuery, error)

type PositionPaginateOption

type PositionPaginateOption func(*PositionPager)

PositionPaginateOption enables pagination customization.

type PositionQuery

type PositionQuery struct {
	// contains filtered or unexported fields
}

PositionQuery is the builder for querying Position entities.

func (*PositionQuery) Aggregate

func (pq *PositionQuery) Aggregate(fns ...AggregateFunc) *PositionSelect

Aggregate returns a PositionSelect configured with the given aggregations.

func (*PositionQuery) All

func (pq *PositionQuery) All(ctx context.Context) ([]*Position, error)

All executes the query and returns a list of Positions.

func (*PositionQuery) AllX

func (pq *PositionQuery) AllX(ctx context.Context) []*Position

AllX is like All, but panics if an error occurs.

func (*PositionQuery) Clone

func (pq *PositionQuery) Clone() *PositionQuery

Clone returns a duplicate of the PositionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*PositionQuery) Count

func (pq *PositionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PositionQuery) CountX

func (pq *PositionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*PositionQuery) ExecContext added in v1.0.9

func (c *PositionQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PositionQuery) Exist

func (pq *PositionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*PositionQuery) ExistX

func (pq *PositionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*PositionQuery) First

func (pq *PositionQuery) First(ctx context.Context) (*Position, error)

First returns the first Position entity from the query. Returns a *NotFoundError when no Position was found.

func (*PositionQuery) FirstID

func (pq *PositionQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Position ID from the query. Returns a *NotFoundError when no Position ID was found.

func (*PositionQuery) FirstIDX

func (pq *PositionQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*PositionQuery) FirstX

func (pq *PositionQuery) FirstX(ctx context.Context) *Position

FirstX is like First, but panics if an error occurs.

func (*PositionQuery) GroupBy

func (pq *PositionQuery) GroupBy(field string, fields ...string) *PositionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Position.Query().
	GroupBy(position.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PositionQuery) IDs

func (pq *PositionQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Position IDs.

func (*PositionQuery) IDsX

func (pq *PositionQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*PositionQuery) Limit

func (pq *PositionQuery) Limit(limit int) *PositionQuery

Limit the number of records to be returned by this query.

func (*PositionQuery) Offset

func (pq *PositionQuery) Offset(offset int) *PositionQuery

Offset to start from.

func (*PositionQuery) Only

func (pq *PositionQuery) Only(ctx context.Context) (*Position, error)

Only returns a single Position entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Position entity is found. Returns a *NotFoundError when no Position entities are found.

func (*PositionQuery) OnlyID

func (pq *PositionQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Position ID in the query. Returns a *NotSingularError when more than one Position ID is found. Returns a *NotFoundError when no entities are found.

func (*PositionQuery) OnlyIDX

func (pq *PositionQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*PositionQuery) OnlyX

func (pq *PositionQuery) OnlyX(ctx context.Context) *Position

OnlyX is like Only, but panics if an error occurs.

func (*PositionQuery) Order

Order specifies how the records should be ordered.

func (*PositionQuery) Page

func (po *PositionQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...PositionPaginateOption,
) (*PositionPageList, error)

func (*PositionQuery) QueryContext added in v1.0.9

func (c *PositionQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PositionQuery) QueryUsers

func (pq *PositionQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*PositionQuery) Select

func (pq *PositionQuery) Select(fields ...string) *PositionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Position.Query().
	Select(position.FieldCreatedAt).
	Scan(ctx, &v)

func (*PositionQuery) Unique

func (pq *PositionQuery) Unique(unique bool) *PositionQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*PositionQuery) Where

func (pq *PositionQuery) Where(ps ...predicate.Position) *PositionQuery

Where adds a new predicate for the PositionQuery builder.

func (*PositionQuery) WithUsers

func (pq *PositionQuery) WithUsers(opts ...func(*UserQuery)) *PositionQuery

WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.

type PositionSelect

type PositionSelect struct {
	*PositionQuery
	// contains filtered or unexported fields
}

PositionSelect is the builder for selecting fields of Position entities.

func (*PositionSelect) Aggregate

func (ps *PositionSelect) Aggregate(fns ...AggregateFunc) *PositionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PositionSelect) Bool

func (s *PositionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*PositionSelect) BoolX

func (s *PositionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*PositionSelect) Bools

func (s *PositionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*PositionSelect) BoolsX

func (s *PositionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (PositionSelect) ExecContext added in v1.0.9

func (c PositionSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PositionSelect) Float64

func (s *PositionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*PositionSelect) Float64X

func (s *PositionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*PositionSelect) Float64s

func (s *PositionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*PositionSelect) Float64sX

func (s *PositionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*PositionSelect) Int

func (s *PositionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*PositionSelect) IntX

func (s *PositionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*PositionSelect) Ints

func (s *PositionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*PositionSelect) IntsX

func (s *PositionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (PositionSelect) QueryContext added in v1.0.9

func (c PositionSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PositionSelect) Scan

func (ps *PositionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*PositionSelect) ScanX

func (s *PositionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*PositionSelect) String

func (s *PositionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*PositionSelect) StringX

func (s *PositionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*PositionSelect) Strings

func (s *PositionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*PositionSelect) StringsX

func (s *PositionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type PositionUpdate

type PositionUpdate struct {
	// contains filtered or unexported fields
}

PositionUpdate is the builder for updating Position entities.

func (*PositionUpdate) AddSort

func (pu *PositionUpdate) AddSort(u int32) *PositionUpdate

AddSort adds u to the "sort" field.

func (*PositionUpdate) AddStatus

func (pu *PositionUpdate) AddStatus(u int8) *PositionUpdate

AddStatus adds u to the "status" field.

func (*PositionUpdate) AddUserIDs

func (pu *PositionUpdate) AddUserIDs(ids ...uuid.UUID) *PositionUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*PositionUpdate) AddUsers

func (pu *PositionUpdate) AddUsers(u ...*User) *PositionUpdate

AddUsers adds the "users" edges to the User entity.

func (*PositionUpdate) ClearRemark added in v1.0.13

func (pu *PositionUpdate) ClearRemark() *PositionUpdate

ClearRemark clears the value of the "remark" field.

func (*PositionUpdate) ClearStatus

func (pu *PositionUpdate) ClearStatus() *PositionUpdate

ClearStatus clears the value of the "status" field.

func (*PositionUpdate) ClearUsers

func (pu *PositionUpdate) ClearUsers() *PositionUpdate

ClearUsers clears all "users" edges to the User entity.

func (*PositionUpdate) Exec

func (pu *PositionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PositionUpdate) ExecContext added in v1.0.9

func (c *PositionUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PositionUpdate) ExecX

func (pu *PositionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PositionUpdate) Mutation

func (pu *PositionUpdate) Mutation() *PositionMutation

Mutation returns the PositionMutation object of the builder.

func (*PositionUpdate) QueryContext added in v1.0.9

func (c *PositionUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PositionUpdate) RemoveUserIDs

func (pu *PositionUpdate) RemoveUserIDs(ids ...uuid.UUID) *PositionUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*PositionUpdate) RemoveUsers

func (pu *PositionUpdate) RemoveUsers(u ...*User) *PositionUpdate

RemoveUsers removes "users" edges to User entities.

func (*PositionUpdate) Save

func (pu *PositionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*PositionUpdate) SaveX

func (pu *PositionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*PositionUpdate) SetCode

func (pu *PositionUpdate) SetCode(s string) *PositionUpdate

SetCode sets the "code" field.

func (*PositionUpdate) SetName

func (pu *PositionUpdate) SetName(s string) *PositionUpdate

SetName sets the "name" field.

func (*PositionUpdate) SetNillableCode added in v1.2.3

func (pu *PositionUpdate) SetNillableCode(s *string) *PositionUpdate

SetNillableCode sets the "code" field if the given value is not nil.

func (*PositionUpdate) SetNillableName added in v1.2.3

func (pu *PositionUpdate) SetNillableName(s *string) *PositionUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PositionUpdate) SetNillableRemark added in v1.0.13

func (pu *PositionUpdate) SetNillableRemark(s *string) *PositionUpdate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*PositionUpdate) SetNillableSort

func (pu *PositionUpdate) SetNillableSort(u *uint32) *PositionUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*PositionUpdate) SetNillableStatus

func (pu *PositionUpdate) SetNillableStatus(u *uint8) *PositionUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PositionUpdate) SetNotEmptyCode

func (po *PositionUpdate) SetNotEmptyCode(value string) *PositionUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*PositionUpdate) SetNotEmptyName

func (po *PositionUpdate) SetNotEmptyName(value string) *PositionUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*PositionUpdate) SetNotEmptyRemark

func (po *PositionUpdate) SetNotEmptyRemark(value string) *PositionUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*PositionUpdate) SetNotEmptySort

func (po *PositionUpdate) SetNotEmptySort(value uint32) *PositionUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*PositionUpdate) SetNotEmptyStatus

func (po *PositionUpdate) SetNotEmptyStatus(value uint8) *PositionUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*PositionUpdate) SetNotNilCode added in v1.0.9

func (po *PositionUpdate) SetNotNilCode(value *string) *PositionUpdate

set field if value's pointer is not nil.

func (*PositionUpdate) SetNotNilName added in v1.0.9

func (po *PositionUpdate) SetNotNilName(value *string) *PositionUpdate

set field if value's pointer is not nil.

func (*PositionUpdate) SetNotNilRemark added in v1.0.9

func (po *PositionUpdate) SetNotNilRemark(value *string) *PositionUpdate

set field if value's pointer is not nil.

func (*PositionUpdate) SetNotNilSort added in v1.0.9

func (po *PositionUpdate) SetNotNilSort(value *uint32) *PositionUpdate

set field if value's pointer is not nil.

func (*PositionUpdate) SetNotNilStatus added in v1.0.9

func (po *PositionUpdate) SetNotNilStatus(value *uint8) *PositionUpdate

set field if value's pointer is not nil.

func (*PositionUpdate) SetNotNilUpdatedAt added in v1.0.9

func (po *PositionUpdate) SetNotNilUpdatedAt(value *time.Time) *PositionUpdate

set field if value's pointer is not nil.

func (*PositionUpdate) SetRemark

func (pu *PositionUpdate) SetRemark(s string) *PositionUpdate

SetRemark sets the "remark" field.

func (*PositionUpdate) SetSort

func (pu *PositionUpdate) SetSort(u uint32) *PositionUpdate

SetSort sets the "sort" field.

func (*PositionUpdate) SetStatus

func (pu *PositionUpdate) SetStatus(u uint8) *PositionUpdate

SetStatus sets the "status" field.

func (*PositionUpdate) SetUpdatedAt

func (pu *PositionUpdate) SetUpdatedAt(t time.Time) *PositionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PositionUpdate) Where

func (pu *PositionUpdate) Where(ps ...predicate.Position) *PositionUpdate

Where appends a list predicates to the PositionUpdate builder.

type PositionUpdateOne

type PositionUpdateOne struct {
	// contains filtered or unexported fields
}

PositionUpdateOne is the builder for updating a single Position entity.

func (*PositionUpdateOne) AddSort

func (puo *PositionUpdateOne) AddSort(u int32) *PositionUpdateOne

AddSort adds u to the "sort" field.

func (*PositionUpdateOne) AddStatus

func (puo *PositionUpdateOne) AddStatus(u int8) *PositionUpdateOne

AddStatus adds u to the "status" field.

func (*PositionUpdateOne) AddUserIDs

func (puo *PositionUpdateOne) AddUserIDs(ids ...uuid.UUID) *PositionUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*PositionUpdateOne) AddUsers

func (puo *PositionUpdateOne) AddUsers(u ...*User) *PositionUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*PositionUpdateOne) ClearRemark added in v1.0.13

func (puo *PositionUpdateOne) ClearRemark() *PositionUpdateOne

ClearRemark clears the value of the "remark" field.

func (*PositionUpdateOne) ClearStatus

func (puo *PositionUpdateOne) ClearStatus() *PositionUpdateOne

ClearStatus clears the value of the "status" field.

func (*PositionUpdateOne) ClearUsers

func (puo *PositionUpdateOne) ClearUsers() *PositionUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*PositionUpdateOne) Exec

func (puo *PositionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PositionUpdateOne) ExecContext added in v1.0.9

func (c *PositionUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*PositionUpdateOne) ExecX

func (puo *PositionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*PositionUpdateOne) Mutation

func (puo *PositionUpdateOne) Mutation() *PositionMutation

Mutation returns the PositionMutation object of the builder.

func (*PositionUpdateOne) QueryContext added in v1.0.9

func (c *PositionUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*PositionUpdateOne) RemoveUserIDs

func (puo *PositionUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *PositionUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*PositionUpdateOne) RemoveUsers

func (puo *PositionUpdateOne) RemoveUsers(u ...*User) *PositionUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*PositionUpdateOne) Save

func (puo *PositionUpdateOne) Save(ctx context.Context) (*Position, error)

Save executes the query and returns the updated Position entity.

func (*PositionUpdateOne) SaveX

func (puo *PositionUpdateOne) SaveX(ctx context.Context) *Position

SaveX is like Save, but panics if an error occurs.

func (*PositionUpdateOne) Select

func (puo *PositionUpdateOne) Select(field string, fields ...string) *PositionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*PositionUpdateOne) SetCode

func (puo *PositionUpdateOne) SetCode(s string) *PositionUpdateOne

SetCode sets the "code" field.

func (*PositionUpdateOne) SetName

func (puo *PositionUpdateOne) SetName(s string) *PositionUpdateOne

SetName sets the "name" field.

func (*PositionUpdateOne) SetNillableCode added in v1.2.3

func (puo *PositionUpdateOne) SetNillableCode(s *string) *PositionUpdateOne

SetNillableCode sets the "code" field if the given value is not nil.

func (*PositionUpdateOne) SetNillableName added in v1.2.3

func (puo *PositionUpdateOne) SetNillableName(s *string) *PositionUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PositionUpdateOne) SetNillableRemark added in v1.0.13

func (puo *PositionUpdateOne) SetNillableRemark(s *string) *PositionUpdateOne

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*PositionUpdateOne) SetNillableSort

func (puo *PositionUpdateOne) SetNillableSort(u *uint32) *PositionUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (*PositionUpdateOne) SetNillableStatus

func (puo *PositionUpdateOne) SetNillableStatus(u *uint8) *PositionUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*PositionUpdateOne) SetNotEmptyCode

func (po *PositionUpdateOne) SetNotEmptyCode(value string) *PositionUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*PositionUpdateOne) SetNotEmptyName

func (po *PositionUpdateOne) SetNotEmptyName(value string) *PositionUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*PositionUpdateOne) SetNotEmptyRemark

func (po *PositionUpdateOne) SetNotEmptyRemark(value string) *PositionUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*PositionUpdateOne) SetNotEmptySort

func (po *PositionUpdateOne) SetNotEmptySort(value uint32) *PositionUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*PositionUpdateOne) SetNotEmptyStatus

func (po *PositionUpdateOne) SetNotEmptyStatus(value uint8) *PositionUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*PositionUpdateOne) SetNotNilCode added in v1.0.9

func (po *PositionUpdateOne) SetNotNilCode(value *string) *PositionUpdateOne

set field if value's pointer is not nil.

func (*PositionUpdateOne) SetNotNilName added in v1.0.9

func (po *PositionUpdateOne) SetNotNilName(value *string) *PositionUpdateOne

set field if value's pointer is not nil.

func (*PositionUpdateOne) SetNotNilRemark added in v1.0.9

func (po *PositionUpdateOne) SetNotNilRemark(value *string) *PositionUpdateOne

set field if value's pointer is not nil.

func (*PositionUpdateOne) SetNotNilSort added in v1.0.9

func (po *PositionUpdateOne) SetNotNilSort(value *uint32) *PositionUpdateOne

set field if value's pointer is not nil.

func (*PositionUpdateOne) SetNotNilStatus added in v1.0.9

func (po *PositionUpdateOne) SetNotNilStatus(value *uint8) *PositionUpdateOne

set field if value's pointer is not nil.

func (*PositionUpdateOne) SetNotNilUpdatedAt added in v1.0.9

func (po *PositionUpdateOne) SetNotNilUpdatedAt(value *time.Time) *PositionUpdateOne

set field if value's pointer is not nil.

func (*PositionUpdateOne) SetRemark

func (puo *PositionUpdateOne) SetRemark(s string) *PositionUpdateOne

SetRemark sets the "remark" field.

func (*PositionUpdateOne) SetSort

func (puo *PositionUpdateOne) SetSort(u uint32) *PositionUpdateOne

SetSort sets the "sort" field.

func (*PositionUpdateOne) SetStatus

func (puo *PositionUpdateOne) SetStatus(u uint8) *PositionUpdateOne

SetStatus sets the "status" field.

func (*PositionUpdateOne) SetUpdatedAt

func (puo *PositionUpdateOne) SetUpdatedAt(t time.Time) *PositionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PositionUpdateOne) Where

Where appends a list predicates to the PositionUpdate builder.

type Positions

type Positions []*Position

Positions is a parsable slice of Position.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type Role

type Role struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Role name | 角色名
	Name string `json:"name,omitempty"`
	// Role code for permission control in front end | 角色码,用于前端权限控制
	Code string `json:"code,omitempty"`
	// Default menu : dashboard | 默认登录页面
	DefaultRouter string `json:"default_router,omitempty"`
	// Remark | 备注
	Remark string `json:"remark,omitempty"`
	// Order number | 排序编号
	Sort uint32 `json:"sort,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the RoleQuery when eager-loading is set.
	Edges RoleEdges `json:"edges"`
	// contains filtered or unexported fields
}

Role is the model entity for the Role schema.

func (*Role) ExecContext added in v1.0.9

func (c *Role) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Role) QueryContext added in v1.0.9

func (c *Role) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Role) QueryMenus

func (r *Role) QueryMenus() *MenuQuery

QueryMenus queries the "menus" edge of the Role entity.

func (*Role) QueryUsers

func (r *Role) QueryUsers() *UserQuery

QueryUsers queries the "users" edge of the Role entity.

func (*Role) String

func (r *Role) String() string

String implements the fmt.Stringer.

func (*Role) Unwrap

func (r *Role) Unwrap() *Role

Unwrap unwraps the Role entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Role) Update

func (r *Role) Update() *RoleUpdateOne

Update returns a builder for updating this Role. Note that you need to call Role.Unwrap() before calling this method if this Role was returned from a transaction, and the transaction was committed or rolled back.

func (*Role) Value added in v1.0.0

func (r *Role) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Role. This includes values selected through modifiers, order, etc.

type RoleClient

type RoleClient struct {
	// contains filtered or unexported fields
}

RoleClient is a client for the Role schema.

func NewRoleClient

func NewRoleClient(c config) *RoleClient

NewRoleClient returns a client for the Role from the given config.

func (*RoleClient) Create

func (c *RoleClient) Create() *RoleCreate

Create returns a builder for creating a Role entity.

func (*RoleClient) CreateBulk

func (c *RoleClient) CreateBulk(builders ...*RoleCreate) *RoleCreateBulk

CreateBulk returns a builder for creating a bulk of Role entities.

func (*RoleClient) Delete

func (c *RoleClient) Delete() *RoleDelete

Delete returns a delete builder for Role.

func (*RoleClient) DeleteOne

func (c *RoleClient) DeleteOne(r *Role) *RoleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RoleClient) DeleteOneID

func (c *RoleClient) DeleteOneID(id uint64) *RoleDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RoleClient) ExecContext added in v1.0.9

func (c *RoleClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleClient) Get

func (c *RoleClient) Get(ctx context.Context, id uint64) (*Role, error)

Get returns a Role entity by its id.

func (*RoleClient) GetX

func (c *RoleClient) GetX(ctx context.Context, id uint64) *Role

GetX is like Get, but panics if an error occurs.

func (*RoleClient) Hooks

func (c *RoleClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RoleClient) Intercept

func (c *RoleClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `role.Intercept(f(g(h())))`.

func (*RoleClient) Interceptors

func (c *RoleClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RoleClient) MapCreateBulk added in v1.1.5

func (c *RoleClient) MapCreateBulk(slice any, setFunc func(*RoleCreate, int)) *RoleCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*RoleClient) Query

func (c *RoleClient) Query() *RoleQuery

Query returns a query builder for Role.

func (*RoleClient) QueryContext added in v1.0.9

func (c *RoleClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleClient) QueryMenus

func (c *RoleClient) QueryMenus(r *Role) *MenuQuery

QueryMenus queries the menus edge of a Role.

func (*RoleClient) QueryUsers

func (c *RoleClient) QueryUsers(r *Role) *UserQuery

QueryUsers queries the users edge of a Role.

func (*RoleClient) Update

func (c *RoleClient) Update() *RoleUpdate

Update returns an update builder for Role.

func (*RoleClient) UpdateOne

func (c *RoleClient) UpdateOne(r *Role) *RoleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RoleClient) UpdateOneID

func (c *RoleClient) UpdateOneID(id uint64) *RoleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RoleClient) Use

func (c *RoleClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `role.Hooks(f(g(h())))`.

type RoleCreate

type RoleCreate struct {
	// contains filtered or unexported fields
}

RoleCreate is the builder for creating a Role entity.

func (*RoleCreate) AddMenuIDs

func (rc *RoleCreate) AddMenuIDs(ids ...uint64) *RoleCreate

AddMenuIDs adds the "menus" edge to the Menu entity by IDs.

func (*RoleCreate) AddMenus

func (rc *RoleCreate) AddMenus(m ...*Menu) *RoleCreate

AddMenus adds the "menus" edges to the Menu entity.

func (*RoleCreate) AddUserIDs

func (rc *RoleCreate) AddUserIDs(ids ...uuid.UUID) *RoleCreate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*RoleCreate) AddUsers

func (rc *RoleCreate) AddUsers(u ...*User) *RoleCreate

AddUsers adds the "users" edges to the User entity.

func (*RoleCreate) Exec

func (rc *RoleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreate) ExecContext added in v1.0.9

func (c *RoleCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleCreate) ExecX

func (rc *RoleCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleCreate) Mutation

func (rc *RoleCreate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleCreate) QueryContext added in v1.0.9

func (c *RoleCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleCreate) Save

func (rc *RoleCreate) Save(ctx context.Context) (*Role, error)

Save creates the Role in the database.

func (*RoleCreate) SaveX

func (rc *RoleCreate) SaveX(ctx context.Context) *Role

SaveX calls Save and panics if Save returns an error.

func (*RoleCreate) SetCode

func (rc *RoleCreate) SetCode(s string) *RoleCreate

SetCode sets the "code" field.

func (*RoleCreate) SetCreatedAt

func (rc *RoleCreate) SetCreatedAt(t time.Time) *RoleCreate

SetCreatedAt sets the "created_at" field.

func (*RoleCreate) SetDefaultRouter

func (rc *RoleCreate) SetDefaultRouter(s string) *RoleCreate

SetDefaultRouter sets the "default_router" field.

func (*RoleCreate) SetID

func (rc *RoleCreate) SetID(u uint64) *RoleCreate

SetID sets the "id" field.

func (*RoleCreate) SetName

func (rc *RoleCreate) SetName(s string) *RoleCreate

SetName sets the "name" field.

func (*RoleCreate) SetNillableCreatedAt

func (rc *RoleCreate) SetNillableCreatedAt(t *time.Time) *RoleCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*RoleCreate) SetNillableDefaultRouter

func (rc *RoleCreate) SetNillableDefaultRouter(s *string) *RoleCreate

SetNillableDefaultRouter sets the "default_router" field if the given value is not nil.

func (*RoleCreate) SetNillableRemark

func (rc *RoleCreate) SetNillableRemark(s *string) *RoleCreate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*RoleCreate) SetNillableSort

func (rc *RoleCreate) SetNillableSort(u *uint32) *RoleCreate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*RoleCreate) SetNillableStatus

func (rc *RoleCreate) SetNillableStatus(u *uint8) *RoleCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*RoleCreate) SetNillableUpdatedAt

func (rc *RoleCreate) SetNillableUpdatedAt(t *time.Time) *RoleCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*RoleCreate) SetNotNilCode added in v1.0.9

func (r *RoleCreate) SetNotNilCode(value *string) *RoleCreate

set field if value's pointer is not nil.

func (*RoleCreate) SetNotNilDefaultRouter added in v1.0.9

func (r *RoleCreate) SetNotNilDefaultRouter(value *string) *RoleCreate

set field if value's pointer is not nil.

func (*RoleCreate) SetNotNilName added in v1.0.9

func (r *RoleCreate) SetNotNilName(value *string) *RoleCreate

set field if value's pointer is not nil.

func (*RoleCreate) SetNotNilRemark added in v1.0.9

func (r *RoleCreate) SetNotNilRemark(value *string) *RoleCreate

set field if value's pointer is not nil.

func (*RoleCreate) SetNotNilSort added in v1.0.9

func (r *RoleCreate) SetNotNilSort(value *uint32) *RoleCreate

set field if value's pointer is not nil.

func (*RoleCreate) SetNotNilStatus added in v1.0.9

func (r *RoleCreate) SetNotNilStatus(value *uint8) *RoleCreate

set field if value's pointer is not nil.

func (*RoleCreate) SetNotNilUpdatedAt added in v1.0.9

func (r *RoleCreate) SetNotNilUpdatedAt(value *time.Time) *RoleCreate

set field if value's pointer is not nil.

func (*RoleCreate) SetRemark

func (rc *RoleCreate) SetRemark(s string) *RoleCreate

SetRemark sets the "remark" field.

func (*RoleCreate) SetSort

func (rc *RoleCreate) SetSort(u uint32) *RoleCreate

SetSort sets the "sort" field.

func (*RoleCreate) SetStatus

func (rc *RoleCreate) SetStatus(u uint8) *RoleCreate

SetStatus sets the "status" field.

func (*RoleCreate) SetUpdatedAt

func (rc *RoleCreate) SetUpdatedAt(t time.Time) *RoleCreate

SetUpdatedAt sets the "updated_at" field.

type RoleCreateBulk

type RoleCreateBulk struct {
	// contains filtered or unexported fields
}

RoleCreateBulk is the builder for creating many Role entities in bulk.

func (*RoleCreateBulk) Exec

func (rcb *RoleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleCreateBulk) ExecContext added in v1.0.9

func (c *RoleCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleCreateBulk) ExecX

func (rcb *RoleCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleCreateBulk) QueryContext added in v1.0.9

func (c *RoleCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleCreateBulk) Save

func (rcb *RoleCreateBulk) Save(ctx context.Context) ([]*Role, error)

Save creates the Role entities in the database.

func (*RoleCreateBulk) SaveX

func (rcb *RoleCreateBulk) SaveX(ctx context.Context) []*Role

SaveX is like Save, but panics if an error occurs.

type RoleDelete

type RoleDelete struct {
	// contains filtered or unexported fields
}

RoleDelete is the builder for deleting a Role entity.

func (*RoleDelete) Exec

func (rd *RoleDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RoleDelete) ExecContext added in v1.0.9

func (c *RoleDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleDelete) ExecX

func (rd *RoleDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RoleDelete) QueryContext added in v1.0.9

func (c *RoleDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleDelete) Where

func (rd *RoleDelete) Where(ps ...predicate.Role) *RoleDelete

Where appends a list predicates to the RoleDelete builder.

type RoleDeleteOne

type RoleDeleteOne struct {
	// contains filtered or unexported fields
}

RoleDeleteOne is the builder for deleting a single Role entity.

func (*RoleDeleteOne) Exec

func (rdo *RoleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RoleDeleteOne) ExecX

func (rdo *RoleDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleDeleteOne) Where

func (rdo *RoleDeleteOne) Where(ps ...predicate.Role) *RoleDeleteOne

Where appends a list predicates to the RoleDelete builder.

type RoleEdges

type RoleEdges struct {
	// Menus holds the value of the menus edge.
	Menus []*Menu `json:"menus,omitempty"`
	// Users holds the value of the users edge.
	Users []*User `json:"users,omitempty"`
	// contains filtered or unexported fields
}

RoleEdges holds the relations/edges for other nodes in the graph.

func (RoleEdges) MenusOrErr

func (e RoleEdges) MenusOrErr() ([]*Menu, error)

MenusOrErr returns the Menus value or an error if the edge was not loaded in eager-loading.

func (RoleEdges) UsersOrErr

func (e RoleEdges) UsersOrErr() ([]*User, error)

UsersOrErr returns the Users value or an error if the edge was not loaded in eager-loading.

type RoleGroupBy

type RoleGroupBy struct {
	// contains filtered or unexported fields
}

RoleGroupBy is the group-by builder for Role entities.

func (*RoleGroupBy) Aggregate

func (rgb *RoleGroupBy) Aggregate(fns ...AggregateFunc) *RoleGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RoleGroupBy) Bool

func (s *RoleGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) BoolX

func (s *RoleGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleGroupBy) Bools

func (s *RoleGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) BoolsX

func (s *RoleGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RoleGroupBy) Float64

func (s *RoleGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) Float64X

func (s *RoleGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleGroupBy) Float64s

func (s *RoleGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) Float64sX

func (s *RoleGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleGroupBy) Int

func (s *RoleGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) IntX

func (s *RoleGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleGroupBy) Ints

func (s *RoleGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) IntsX

func (s *RoleGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RoleGroupBy) Scan

func (rgb *RoleGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleGroupBy) ScanX

func (s *RoleGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleGroupBy) String

func (s *RoleGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) StringX

func (s *RoleGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleGroupBy) Strings

func (s *RoleGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleGroupBy) StringsX

func (s *RoleGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleMutation

type RoleMutation struct {
	// contains filtered or unexported fields
}

RoleMutation represents an operation that mutates the Role nodes in the graph.

func (*RoleMutation) AddField

func (m *RoleMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*RoleMutation) AddMenuIDs

func (m *RoleMutation) AddMenuIDs(ids ...uint64)

AddMenuIDs adds the "menus" edge to the Menu entity by ids.

func (*RoleMutation) AddSort

func (m *RoleMutation) AddSort(u int32)

AddSort adds u to the "sort" field.

func (*RoleMutation) AddStatus

func (m *RoleMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*RoleMutation) AddUserIDs

func (m *RoleMutation) AddUserIDs(ids ...uuid.UUID)

AddUserIDs adds the "users" edge to the User entity by ids.

func (*RoleMutation) AddedEdges

func (m *RoleMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RoleMutation) AddedField

func (m *RoleMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*RoleMutation) AddedFields

func (m *RoleMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RoleMutation) AddedIDs

func (m *RoleMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RoleMutation) AddedSort

func (m *RoleMutation) AddedSort() (r int32, exists bool)

AddedSort returns the value that was added to the "sort" field in this mutation.

func (*RoleMutation) AddedStatus

func (m *RoleMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*RoleMutation) ClearEdge

func (m *RoleMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*RoleMutation) ClearField

func (m *RoleMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*RoleMutation) ClearMenus

func (m *RoleMutation) ClearMenus()

ClearMenus clears the "menus" edge to the Menu entity.

func (*RoleMutation) ClearStatus

func (m *RoleMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*RoleMutation) ClearUsers

func (m *RoleMutation) ClearUsers()

ClearUsers clears the "users" edge to the User entity.

func (*RoleMutation) ClearedEdges

func (m *RoleMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RoleMutation) ClearedFields

func (m *RoleMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RoleMutation) Client

func (m RoleMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*RoleMutation) Code

func (m *RoleMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*RoleMutation) CreatedAt

func (m *RoleMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*RoleMutation) DefaultRouter

func (m *RoleMutation) DefaultRouter() (r string, exists bool)

DefaultRouter returns the value of the "default_router" field in the mutation.

func (*RoleMutation) EdgeCleared

func (m *RoleMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RoleMutation) ExecContext added in v1.0.9

func (c *RoleMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleMutation) Field

func (m *RoleMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*RoleMutation) FieldCleared

func (m *RoleMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RoleMutation) Fields

func (m *RoleMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*RoleMutation) ID

func (m *RoleMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*RoleMutation) IDs

func (m *RoleMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*RoleMutation) MenusCleared

func (m *RoleMutation) MenusCleared() bool

MenusCleared reports if the "menus" edge to the Menu entity was cleared.

func (*RoleMutation) MenusIDs

func (m *RoleMutation) MenusIDs() (ids []uint64)

MenusIDs returns the "menus" edge IDs in the mutation.

func (*RoleMutation) Name

func (m *RoleMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*RoleMutation) OldCode

func (m *RoleMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Role entity. If the Role object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMutation) OldCreatedAt

func (m *RoleMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Role entity. If the Role object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMutation) OldDefaultRouter

func (m *RoleMutation) OldDefaultRouter(ctx context.Context) (v string, err error)

OldDefaultRouter returns the old "default_router" field's value of the Role entity. If the Role object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMutation) OldField

func (m *RoleMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*RoleMutation) OldName

func (m *RoleMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Role entity. If the Role object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMutation) OldRemark

func (m *RoleMutation) OldRemark(ctx context.Context) (v string, err error)

OldRemark returns the old "remark" field's value of the Role entity. If the Role object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMutation) OldSort

func (m *RoleMutation) OldSort(ctx context.Context) (v uint32, err error)

OldSort returns the old "sort" field's value of the Role entity. If the Role object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMutation) OldStatus

func (m *RoleMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the Role entity. If the Role object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMutation) OldUpdatedAt

func (m *RoleMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Role entity. If the Role object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*RoleMutation) Op

func (m *RoleMutation) Op() Op

Op returns the operation name.

func (*RoleMutation) QueryContext added in v1.0.9

func (c *RoleMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleMutation) Remark

func (m *RoleMutation) Remark() (r string, exists bool)

Remark returns the value of the "remark" field in the mutation.

func (*RoleMutation) RemoveMenuIDs

func (m *RoleMutation) RemoveMenuIDs(ids ...uint64)

RemoveMenuIDs removes the "menus" edge to the Menu entity by IDs.

func (*RoleMutation) RemoveUserIDs

func (m *RoleMutation) RemoveUserIDs(ids ...uuid.UUID)

RemoveUserIDs removes the "users" edge to the User entity by IDs.

func (*RoleMutation) RemovedEdges

func (m *RoleMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RoleMutation) RemovedIDs

func (m *RoleMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*RoleMutation) RemovedMenusIDs

func (m *RoleMutation) RemovedMenusIDs() (ids []uint64)

RemovedMenus returns the removed IDs of the "menus" edge to the Menu entity.

func (*RoleMutation) RemovedUsersIDs

func (m *RoleMutation) RemovedUsersIDs() (ids []uuid.UUID)

RemovedUsers returns the removed IDs of the "users" edge to the User entity.

func (*RoleMutation) ResetCode

func (m *RoleMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*RoleMutation) ResetCreatedAt

func (m *RoleMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RoleMutation) ResetDefaultRouter

func (m *RoleMutation) ResetDefaultRouter()

ResetDefaultRouter resets all changes to the "default_router" field.

func (*RoleMutation) ResetEdge

func (m *RoleMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*RoleMutation) ResetField

func (m *RoleMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*RoleMutation) ResetMenus

func (m *RoleMutation) ResetMenus()

ResetMenus resets all changes to the "menus" edge.

func (*RoleMutation) ResetName

func (m *RoleMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*RoleMutation) ResetRemark

func (m *RoleMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*RoleMutation) ResetSort

func (m *RoleMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*RoleMutation) ResetStatus

func (m *RoleMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*RoleMutation) ResetUpdatedAt

func (m *RoleMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*RoleMutation) ResetUsers

func (m *RoleMutation) ResetUsers()

ResetUsers resets all changes to the "users" edge.

func (*RoleMutation) SetCode

func (m *RoleMutation) SetCode(s string)

SetCode sets the "code" field.

func (*RoleMutation) SetCreatedAt

func (m *RoleMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*RoleMutation) SetDefaultRouter

func (m *RoleMutation) SetDefaultRouter(s string)

SetDefaultRouter sets the "default_router" field.

func (*RoleMutation) SetField

func (m *RoleMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*RoleMutation) SetID

func (m *RoleMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Role entities.

func (*RoleMutation) SetName

func (m *RoleMutation) SetName(s string)

SetName sets the "name" field.

func (*RoleMutation) SetOp

func (m *RoleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RoleMutation) SetRemark

func (m *RoleMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*RoleMutation) SetSort

func (m *RoleMutation) SetSort(u uint32)

SetSort sets the "sort" field.

func (*RoleMutation) SetStatus

func (m *RoleMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*RoleMutation) SetUpdatedAt

func (m *RoleMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*RoleMutation) Sort

func (m *RoleMutation) Sort() (r uint32, exists bool)

Sort returns the value of the "sort" field in the mutation.

func (*RoleMutation) Status

func (m *RoleMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*RoleMutation) StatusCleared

func (m *RoleMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (RoleMutation) Tx

func (m RoleMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RoleMutation) Type

func (m *RoleMutation) Type() string

Type returns the node type of this mutation (Role).

func (*RoleMutation) UpdatedAt

func (m *RoleMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*RoleMutation) UsersCleared

func (m *RoleMutation) UsersCleared() bool

UsersCleared reports if the "users" edge to the User entity was cleared.

func (*RoleMutation) UsersIDs

func (m *RoleMutation) UsersIDs() (ids []uuid.UUID)

UsersIDs returns the "users" edge IDs in the mutation.

func (*RoleMutation) Where

func (m *RoleMutation) Where(ps ...predicate.Role)

Where appends a list predicates to the RoleMutation builder.

func (*RoleMutation) WhereP

func (m *RoleMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RoleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RolePageList

type RolePageList struct {
	List        []*Role      `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

RolePageList is Role PageList result.

type RolePager

type RolePager struct {
	Order  role.OrderOption
	Filter func(*RoleQuery) (*RoleQuery, error)
}

func (*RolePager) ApplyFilter

func (p *RolePager) ApplyFilter(query *RoleQuery) (*RoleQuery, error)

type RolePaginateOption

type RolePaginateOption func(*RolePager)

RolePaginateOption enables pagination customization.

type RoleQuery

type RoleQuery struct {
	// contains filtered or unexported fields
}

RoleQuery is the builder for querying Role entities.

func (*RoleQuery) Aggregate

func (rq *RoleQuery) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate returns a RoleSelect configured with the given aggregations.

func (*RoleQuery) All

func (rq *RoleQuery) All(ctx context.Context) ([]*Role, error)

All executes the query and returns a list of Roles.

func (*RoleQuery) AllX

func (rq *RoleQuery) AllX(ctx context.Context) []*Role

AllX is like All, but panics if an error occurs.

func (*RoleQuery) Clone

func (rq *RoleQuery) Clone() *RoleQuery

Clone returns a duplicate of the RoleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RoleQuery) Count

func (rq *RoleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RoleQuery) CountX

func (rq *RoleQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RoleQuery) ExecContext added in v1.0.9

func (c *RoleQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleQuery) Exist

func (rq *RoleQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RoleQuery) ExistX

func (rq *RoleQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RoleQuery) First

func (rq *RoleQuery) First(ctx context.Context) (*Role, error)

First returns the first Role entity from the query. Returns a *NotFoundError when no Role was found.

func (*RoleQuery) FirstID

func (rq *RoleQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first Role ID from the query. Returns a *NotFoundError when no Role ID was found.

func (*RoleQuery) FirstIDX

func (rq *RoleQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*RoleQuery) FirstX

func (rq *RoleQuery) FirstX(ctx context.Context) *Role

FirstX is like First, but panics if an error occurs.

func (*RoleQuery) GroupBy

func (rq *RoleQuery) GroupBy(field string, fields ...string) *RoleGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Role.Query().
	GroupBy(role.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RoleQuery) IDs

func (rq *RoleQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of Role IDs.

func (*RoleQuery) IDsX

func (rq *RoleQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*RoleQuery) Limit

func (rq *RoleQuery) Limit(limit int) *RoleQuery

Limit the number of records to be returned by this query.

func (*RoleQuery) Offset

func (rq *RoleQuery) Offset(offset int) *RoleQuery

Offset to start from.

func (*RoleQuery) Only

func (rq *RoleQuery) Only(ctx context.Context) (*Role, error)

Only returns a single Role entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Role entity is found. Returns a *NotFoundError when no Role entities are found.

func (*RoleQuery) OnlyID

func (rq *RoleQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only Role ID in the query. Returns a *NotSingularError when more than one Role ID is found. Returns a *NotFoundError when no entities are found.

func (*RoleQuery) OnlyIDX

func (rq *RoleQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RoleQuery) OnlyX

func (rq *RoleQuery) OnlyX(ctx context.Context) *Role

OnlyX is like Only, but panics if an error occurs.

func (*RoleQuery) Order

func (rq *RoleQuery) Order(o ...role.OrderOption) *RoleQuery

Order specifies how the records should be ordered.

func (*RoleQuery) Page

func (r *RoleQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...RolePaginateOption,
) (*RolePageList, error)

func (*RoleQuery) QueryContext added in v1.0.9

func (c *RoleQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleQuery) QueryMenus

func (rq *RoleQuery) QueryMenus() *MenuQuery

QueryMenus chains the current query on the "menus" edge.

func (*RoleQuery) QueryUsers

func (rq *RoleQuery) QueryUsers() *UserQuery

QueryUsers chains the current query on the "users" edge.

func (*RoleQuery) Select

func (rq *RoleQuery) Select(fields ...string) *RoleSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Role.Query().
	Select(role.FieldCreatedAt).
	Scan(ctx, &v)

func (*RoleQuery) Unique

func (rq *RoleQuery) Unique(unique bool) *RoleQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*RoleQuery) Where

func (rq *RoleQuery) Where(ps ...predicate.Role) *RoleQuery

Where adds a new predicate for the RoleQuery builder.

func (*RoleQuery) WithMenus

func (rq *RoleQuery) WithMenus(opts ...func(*MenuQuery)) *RoleQuery

WithMenus tells the query-builder to eager-load the nodes that are connected to the "menus" edge. The optional arguments are used to configure the query builder of the edge.

func (*RoleQuery) WithUsers

func (rq *RoleQuery) WithUsers(opts ...func(*UserQuery)) *RoleQuery

WithUsers tells the query-builder to eager-load the nodes that are connected to the "users" edge. The optional arguments are used to configure the query builder of the edge.

type RoleSelect

type RoleSelect struct {
	*RoleQuery
	// contains filtered or unexported fields
}

RoleSelect is the builder for selecting fields of Role entities.

func (*RoleSelect) Aggregate

func (rs *RoleSelect) Aggregate(fns ...AggregateFunc) *RoleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RoleSelect) Bool

func (s *RoleSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RoleSelect) BoolX

func (s *RoleSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RoleSelect) Bools

func (s *RoleSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RoleSelect) BoolsX

func (s *RoleSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (RoleSelect) ExecContext added in v1.0.9

func (c RoleSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleSelect) Float64

func (s *RoleSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RoleSelect) Float64X

func (s *RoleSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RoleSelect) Float64s

func (s *RoleSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RoleSelect) Float64sX

func (s *RoleSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RoleSelect) Int

func (s *RoleSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RoleSelect) IntX

func (s *RoleSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RoleSelect) Ints

func (s *RoleSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RoleSelect) IntsX

func (s *RoleSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (RoleSelect) QueryContext added in v1.0.9

func (c RoleSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleSelect) Scan

func (rs *RoleSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RoleSelect) ScanX

func (s *RoleSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RoleSelect) String

func (s *RoleSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RoleSelect) StringX

func (s *RoleSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RoleSelect) Strings

func (s *RoleSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RoleSelect) StringsX

func (s *RoleSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RoleUpdate

type RoleUpdate struct {
	// contains filtered or unexported fields
}

RoleUpdate is the builder for updating Role entities.

func (*RoleUpdate) AddMenuIDs

func (ru *RoleUpdate) AddMenuIDs(ids ...uint64) *RoleUpdate

AddMenuIDs adds the "menus" edge to the Menu entity by IDs.

func (*RoleUpdate) AddMenus

func (ru *RoleUpdate) AddMenus(m ...*Menu) *RoleUpdate

AddMenus adds the "menus" edges to the Menu entity.

func (*RoleUpdate) AddSort

func (ru *RoleUpdate) AddSort(u int32) *RoleUpdate

AddSort adds u to the "sort" field.

func (*RoleUpdate) AddStatus

func (ru *RoleUpdate) AddStatus(u int8) *RoleUpdate

AddStatus adds u to the "status" field.

func (*RoleUpdate) AddUserIDs

func (ru *RoleUpdate) AddUserIDs(ids ...uuid.UUID) *RoleUpdate

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*RoleUpdate) AddUsers

func (ru *RoleUpdate) AddUsers(u ...*User) *RoleUpdate

AddUsers adds the "users" edges to the User entity.

func (*RoleUpdate) ClearMenus

func (ru *RoleUpdate) ClearMenus() *RoleUpdate

ClearMenus clears all "menus" edges to the Menu entity.

func (*RoleUpdate) ClearStatus

func (ru *RoleUpdate) ClearStatus() *RoleUpdate

ClearStatus clears the value of the "status" field.

func (*RoleUpdate) ClearUsers

func (ru *RoleUpdate) ClearUsers() *RoleUpdate

ClearUsers clears all "users" edges to the User entity.

func (*RoleUpdate) Exec

func (ru *RoleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpdate) ExecContext added in v1.0.9

func (c *RoleUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleUpdate) ExecX

func (ru *RoleUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUpdate) Mutation

func (ru *RoleUpdate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdate) QueryContext added in v1.0.9

func (c *RoleUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleUpdate) RemoveMenuIDs

func (ru *RoleUpdate) RemoveMenuIDs(ids ...uint64) *RoleUpdate

RemoveMenuIDs removes the "menus" edge to Menu entities by IDs.

func (*RoleUpdate) RemoveMenus

func (ru *RoleUpdate) RemoveMenus(m ...*Menu) *RoleUpdate

RemoveMenus removes "menus" edges to Menu entities.

func (*RoleUpdate) RemoveUserIDs

func (ru *RoleUpdate) RemoveUserIDs(ids ...uuid.UUID) *RoleUpdate

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*RoleUpdate) RemoveUsers

func (ru *RoleUpdate) RemoveUsers(u ...*User) *RoleUpdate

RemoveUsers removes "users" edges to User entities.

func (*RoleUpdate) Save

func (ru *RoleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RoleUpdate) SaveX

func (ru *RoleUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RoleUpdate) SetCode

func (ru *RoleUpdate) SetCode(s string) *RoleUpdate

SetCode sets the "code" field.

func (*RoleUpdate) SetDefaultRouter

func (ru *RoleUpdate) SetDefaultRouter(s string) *RoleUpdate

SetDefaultRouter sets the "default_router" field.

func (*RoleUpdate) SetName

func (ru *RoleUpdate) SetName(s string) *RoleUpdate

SetName sets the "name" field.

func (*RoleUpdate) SetNillableCode added in v1.2.3

func (ru *RoleUpdate) SetNillableCode(s *string) *RoleUpdate

SetNillableCode sets the "code" field if the given value is not nil.

func (*RoleUpdate) SetNillableDefaultRouter

func (ru *RoleUpdate) SetNillableDefaultRouter(s *string) *RoleUpdate

SetNillableDefaultRouter sets the "default_router" field if the given value is not nil.

func (*RoleUpdate) SetNillableName added in v1.2.3

func (ru *RoleUpdate) SetNillableName(s *string) *RoleUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*RoleUpdate) SetNillableRemark

func (ru *RoleUpdate) SetNillableRemark(s *string) *RoleUpdate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*RoleUpdate) SetNillableSort

func (ru *RoleUpdate) SetNillableSort(u *uint32) *RoleUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*RoleUpdate) SetNillableStatus

func (ru *RoleUpdate) SetNillableStatus(u *uint8) *RoleUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*RoleUpdate) SetNotEmptyCode

func (r *RoleUpdate) SetNotEmptyCode(value string) *RoleUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdate) SetNotEmptyDefaultRouter

func (r *RoleUpdate) SetNotEmptyDefaultRouter(value string) *RoleUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdate) SetNotEmptyName

func (r *RoleUpdate) SetNotEmptyName(value string) *RoleUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdate) SetNotEmptyRemark

func (r *RoleUpdate) SetNotEmptyRemark(value string) *RoleUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdate) SetNotEmptySort

func (r *RoleUpdate) SetNotEmptySort(value uint32) *RoleUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdate) SetNotEmptyStatus

func (r *RoleUpdate) SetNotEmptyStatus(value uint8) *RoleUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdate) SetNotNilCode added in v1.0.9

func (r *RoleUpdate) SetNotNilCode(value *string) *RoleUpdate

set field if value's pointer is not nil.

func (*RoleUpdate) SetNotNilDefaultRouter added in v1.0.9

func (r *RoleUpdate) SetNotNilDefaultRouter(value *string) *RoleUpdate

set field if value's pointer is not nil.

func (*RoleUpdate) SetNotNilName added in v1.0.9

func (r *RoleUpdate) SetNotNilName(value *string) *RoleUpdate

set field if value's pointer is not nil.

func (*RoleUpdate) SetNotNilRemark added in v1.0.9

func (r *RoleUpdate) SetNotNilRemark(value *string) *RoleUpdate

set field if value's pointer is not nil.

func (*RoleUpdate) SetNotNilSort added in v1.0.9

func (r *RoleUpdate) SetNotNilSort(value *uint32) *RoleUpdate

set field if value's pointer is not nil.

func (*RoleUpdate) SetNotNilStatus added in v1.0.9

func (r *RoleUpdate) SetNotNilStatus(value *uint8) *RoleUpdate

set field if value's pointer is not nil.

func (*RoleUpdate) SetNotNilUpdatedAt added in v1.0.9

func (r *RoleUpdate) SetNotNilUpdatedAt(value *time.Time) *RoleUpdate

set field if value's pointer is not nil.

func (*RoleUpdate) SetRemark

func (ru *RoleUpdate) SetRemark(s string) *RoleUpdate

SetRemark sets the "remark" field.

func (*RoleUpdate) SetSort

func (ru *RoleUpdate) SetSort(u uint32) *RoleUpdate

SetSort sets the "sort" field.

func (*RoleUpdate) SetStatus

func (ru *RoleUpdate) SetStatus(u uint8) *RoleUpdate

SetStatus sets the "status" field.

func (*RoleUpdate) SetUpdatedAt

func (ru *RoleUpdate) SetUpdatedAt(t time.Time) *RoleUpdate

SetUpdatedAt sets the "updated_at" field.

func (*RoleUpdate) Where

func (ru *RoleUpdate) Where(ps ...predicate.Role) *RoleUpdate

Where appends a list predicates to the RoleUpdate builder.

type RoleUpdateOne

type RoleUpdateOne struct {
	// contains filtered or unexported fields
}

RoleUpdateOne is the builder for updating a single Role entity.

func (*RoleUpdateOne) AddMenuIDs

func (ruo *RoleUpdateOne) AddMenuIDs(ids ...uint64) *RoleUpdateOne

AddMenuIDs adds the "menus" edge to the Menu entity by IDs.

func (*RoleUpdateOne) AddMenus

func (ruo *RoleUpdateOne) AddMenus(m ...*Menu) *RoleUpdateOne

AddMenus adds the "menus" edges to the Menu entity.

func (*RoleUpdateOne) AddSort

func (ruo *RoleUpdateOne) AddSort(u int32) *RoleUpdateOne

AddSort adds u to the "sort" field.

func (*RoleUpdateOne) AddStatus

func (ruo *RoleUpdateOne) AddStatus(u int8) *RoleUpdateOne

AddStatus adds u to the "status" field.

func (*RoleUpdateOne) AddUserIDs

func (ruo *RoleUpdateOne) AddUserIDs(ids ...uuid.UUID) *RoleUpdateOne

AddUserIDs adds the "users" edge to the User entity by IDs.

func (*RoleUpdateOne) AddUsers

func (ruo *RoleUpdateOne) AddUsers(u ...*User) *RoleUpdateOne

AddUsers adds the "users" edges to the User entity.

func (*RoleUpdateOne) ClearMenus

func (ruo *RoleUpdateOne) ClearMenus() *RoleUpdateOne

ClearMenus clears all "menus" edges to the Menu entity.

func (*RoleUpdateOne) ClearStatus

func (ruo *RoleUpdateOne) ClearStatus() *RoleUpdateOne

ClearStatus clears the value of the "status" field.

func (*RoleUpdateOne) ClearUsers

func (ruo *RoleUpdateOne) ClearUsers() *RoleUpdateOne

ClearUsers clears all "users" edges to the User entity.

func (*RoleUpdateOne) Exec

func (ruo *RoleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RoleUpdateOne) ExecContext added in v1.0.9

func (c *RoleUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*RoleUpdateOne) ExecX

func (ruo *RoleUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RoleUpdateOne) Mutation

func (ruo *RoleUpdateOne) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdateOne) QueryContext added in v1.0.9

func (c *RoleUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*RoleUpdateOne) RemoveMenuIDs

func (ruo *RoleUpdateOne) RemoveMenuIDs(ids ...uint64) *RoleUpdateOne

RemoveMenuIDs removes the "menus" edge to Menu entities by IDs.

func (*RoleUpdateOne) RemoveMenus

func (ruo *RoleUpdateOne) RemoveMenus(m ...*Menu) *RoleUpdateOne

RemoveMenus removes "menus" edges to Menu entities.

func (*RoleUpdateOne) RemoveUserIDs

func (ruo *RoleUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *RoleUpdateOne

RemoveUserIDs removes the "users" edge to User entities by IDs.

func (*RoleUpdateOne) RemoveUsers

func (ruo *RoleUpdateOne) RemoveUsers(u ...*User) *RoleUpdateOne

RemoveUsers removes "users" edges to User entities.

func (*RoleUpdateOne) Save

func (ruo *RoleUpdateOne) Save(ctx context.Context) (*Role, error)

Save executes the query and returns the updated Role entity.

func (*RoleUpdateOne) SaveX

func (ruo *RoleUpdateOne) SaveX(ctx context.Context) *Role

SaveX is like Save, but panics if an error occurs.

func (*RoleUpdateOne) Select

func (ruo *RoleUpdateOne) Select(field string, fields ...string) *RoleUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RoleUpdateOne) SetCode

func (ruo *RoleUpdateOne) SetCode(s string) *RoleUpdateOne

SetCode sets the "code" field.

func (*RoleUpdateOne) SetDefaultRouter

func (ruo *RoleUpdateOne) SetDefaultRouter(s string) *RoleUpdateOne

SetDefaultRouter sets the "default_router" field.

func (*RoleUpdateOne) SetName

func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne

SetName sets the "name" field.

func (*RoleUpdateOne) SetNillableCode added in v1.2.3

func (ruo *RoleUpdateOne) SetNillableCode(s *string) *RoleUpdateOne

SetNillableCode sets the "code" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableDefaultRouter

func (ruo *RoleUpdateOne) SetNillableDefaultRouter(s *string) *RoleUpdateOne

SetNillableDefaultRouter sets the "default_router" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableName added in v1.2.3

func (ruo *RoleUpdateOne) SetNillableName(s *string) *RoleUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableRemark

func (ruo *RoleUpdateOne) SetNillableRemark(s *string) *RoleUpdateOne

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableSort

func (ruo *RoleUpdateOne) SetNillableSort(u *uint32) *RoleUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableStatus

func (ruo *RoleUpdateOne) SetNillableStatus(u *uint8) *RoleUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*RoleUpdateOne) SetNotEmptyCode

func (r *RoleUpdateOne) SetNotEmptyCode(value string) *RoleUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdateOne) SetNotEmptyDefaultRouter

func (r *RoleUpdateOne) SetNotEmptyDefaultRouter(value string) *RoleUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdateOne) SetNotEmptyName

func (r *RoleUpdateOne) SetNotEmptyName(value string) *RoleUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdateOne) SetNotEmptyRemark

func (r *RoleUpdateOne) SetNotEmptyRemark(value string) *RoleUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdateOne) SetNotEmptySort

func (r *RoleUpdateOne) SetNotEmptySort(value uint32) *RoleUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdateOne) SetNotEmptyStatus

func (r *RoleUpdateOne) SetNotEmptyStatus(value uint8) *RoleUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*RoleUpdateOne) SetNotNilCode added in v1.0.9

func (r *RoleUpdateOne) SetNotNilCode(value *string) *RoleUpdateOne

set field if value's pointer is not nil.

func (*RoleUpdateOne) SetNotNilDefaultRouter added in v1.0.9

func (r *RoleUpdateOne) SetNotNilDefaultRouter(value *string) *RoleUpdateOne

set field if value's pointer is not nil.

func (*RoleUpdateOne) SetNotNilName added in v1.0.9

func (r *RoleUpdateOne) SetNotNilName(value *string) *RoleUpdateOne

set field if value's pointer is not nil.

func (*RoleUpdateOne) SetNotNilRemark added in v1.0.9

func (r *RoleUpdateOne) SetNotNilRemark(value *string) *RoleUpdateOne

set field if value's pointer is not nil.

func (*RoleUpdateOne) SetNotNilSort added in v1.0.9

func (r *RoleUpdateOne) SetNotNilSort(value *uint32) *RoleUpdateOne

set field if value's pointer is not nil.

func (*RoleUpdateOne) SetNotNilStatus added in v1.0.9

func (r *RoleUpdateOne) SetNotNilStatus(value *uint8) *RoleUpdateOne

set field if value's pointer is not nil.

func (*RoleUpdateOne) SetNotNilUpdatedAt added in v1.0.9

func (r *RoleUpdateOne) SetNotNilUpdatedAt(value *time.Time) *RoleUpdateOne

set field if value's pointer is not nil.

func (*RoleUpdateOne) SetRemark

func (ruo *RoleUpdateOne) SetRemark(s string) *RoleUpdateOne

SetRemark sets the "remark" field.

func (*RoleUpdateOne) SetSort

func (ruo *RoleUpdateOne) SetSort(u uint32) *RoleUpdateOne

SetSort sets the "sort" field.

func (*RoleUpdateOne) SetStatus

func (ruo *RoleUpdateOne) SetStatus(u uint8) *RoleUpdateOne

SetStatus sets the "status" field.

func (*RoleUpdateOne) SetUpdatedAt

func (ruo *RoleUpdateOne) SetUpdatedAt(t time.Time) *RoleUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*RoleUpdateOne) Where

func (ruo *RoleUpdateOne) Where(ps ...predicate.Role) *RoleUpdateOne

Where appends a list predicates to the RoleUpdate builder.

type Roles

type Roles []*Role

Roles is a parsable slice of Role.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Token

type Token struct {

	// ID of the ent.
	// UUID
	ID uuid.UUID `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	//  User's UUID | 用户的UUID
	UUID uuid.UUID `json:"uuid,omitempty"`
	// Token string | Token 字符串
	Token string `json:"token,omitempty"`
	// Log in source such as GitHub | Token 来源 (本地为core, 第三方如github等)
	Source string `json:"source,omitempty"`
	//  Expire time | 过期时间
	ExpiredAt time.Time `json:"expired_at,omitempty"`
	// contains filtered or unexported fields
}

Token is the model entity for the Token schema.

func (*Token) ExecContext added in v1.0.9

func (c *Token) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Token) QueryContext added in v1.0.9

func (c *Token) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Token) String

func (t *Token) String() string

String implements the fmt.Stringer.

func (*Token) Unwrap

func (t *Token) Unwrap() *Token

Unwrap unwraps the Token entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Token) Update

func (t *Token) Update() *TokenUpdateOne

Update returns a builder for updating this Token. Note that you need to call Token.Unwrap() before calling this method if this Token was returned from a transaction, and the transaction was committed or rolled back.

func (*Token) Value added in v1.0.0

func (t *Token) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Token. This includes values selected through modifiers, order, etc.

type TokenClient

type TokenClient struct {
	// contains filtered or unexported fields
}

TokenClient is a client for the Token schema.

func NewTokenClient

func NewTokenClient(c config) *TokenClient

NewTokenClient returns a client for the Token from the given config.

func (*TokenClient) Create

func (c *TokenClient) Create() *TokenCreate

Create returns a builder for creating a Token entity.

func (*TokenClient) CreateBulk

func (c *TokenClient) CreateBulk(builders ...*TokenCreate) *TokenCreateBulk

CreateBulk returns a builder for creating a bulk of Token entities.

func (*TokenClient) Delete

func (c *TokenClient) Delete() *TokenDelete

Delete returns a delete builder for Token.

func (*TokenClient) DeleteOne

func (c *TokenClient) DeleteOne(t *Token) *TokenDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TokenClient) DeleteOneID

func (c *TokenClient) DeleteOneID(id uuid.UUID) *TokenDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TokenClient) ExecContext added in v1.0.9

func (c *TokenClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenClient) Get

func (c *TokenClient) Get(ctx context.Context, id uuid.UUID) (*Token, error)

Get returns a Token entity by its id.

func (*TokenClient) GetX

func (c *TokenClient) GetX(ctx context.Context, id uuid.UUID) *Token

GetX is like Get, but panics if an error occurs.

func (*TokenClient) Hooks

func (c *TokenClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TokenClient) Intercept

func (c *TokenClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `token.Intercept(f(g(h())))`.

func (*TokenClient) Interceptors

func (c *TokenClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TokenClient) MapCreateBulk added in v1.1.5

func (c *TokenClient) MapCreateBulk(slice any, setFunc func(*TokenCreate, int)) *TokenCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*TokenClient) Query

func (c *TokenClient) Query() *TokenQuery

Query returns a query builder for Token.

func (*TokenClient) QueryContext added in v1.0.9

func (c *TokenClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenClient) Update

func (c *TokenClient) Update() *TokenUpdate

Update returns an update builder for Token.

func (*TokenClient) UpdateOne

func (c *TokenClient) UpdateOne(t *Token) *TokenUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TokenClient) UpdateOneID

func (c *TokenClient) UpdateOneID(id uuid.UUID) *TokenUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TokenClient) Use

func (c *TokenClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `token.Hooks(f(g(h())))`.

type TokenCreate

type TokenCreate struct {
	// contains filtered or unexported fields
}

TokenCreate is the builder for creating a Token entity.

func (*TokenCreate) Exec

func (tc *TokenCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenCreate) ExecContext added in v1.0.9

func (c *TokenCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenCreate) ExecX

func (tc *TokenCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenCreate) Mutation

func (tc *TokenCreate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenCreate) QueryContext added in v1.0.9

func (c *TokenCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenCreate) Save

func (tc *TokenCreate) Save(ctx context.Context) (*Token, error)

Save creates the Token in the database.

func (*TokenCreate) SaveX

func (tc *TokenCreate) SaveX(ctx context.Context) *Token

SaveX calls Save and panics if Save returns an error.

func (*TokenCreate) SetCreatedAt

func (tc *TokenCreate) SetCreatedAt(t time.Time) *TokenCreate

SetCreatedAt sets the "created_at" field.

func (*TokenCreate) SetExpiredAt

func (tc *TokenCreate) SetExpiredAt(t time.Time) *TokenCreate

SetExpiredAt sets the "expired_at" field.

func (*TokenCreate) SetID

func (tc *TokenCreate) SetID(u uuid.UUID) *TokenCreate

SetID sets the "id" field.

func (*TokenCreate) SetNillableCreatedAt

func (tc *TokenCreate) SetNillableCreatedAt(t *time.Time) *TokenCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TokenCreate) SetNillableID

func (tc *TokenCreate) SetNillableID(u *uuid.UUID) *TokenCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TokenCreate) SetNillableStatus

func (tc *TokenCreate) SetNillableStatus(u *uint8) *TokenCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TokenCreate) SetNillableUpdatedAt

func (tc *TokenCreate) SetNillableUpdatedAt(t *time.Time) *TokenCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*TokenCreate) SetNotNilExpiredAt added in v1.0.9

func (t *TokenCreate) SetNotNilExpiredAt(value *time.Time) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilSource added in v1.0.9

func (t *TokenCreate) SetNotNilSource(value *string) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilStatus added in v1.0.9

func (t *TokenCreate) SetNotNilStatus(value *uint8) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilToken added in v1.0.9

func (t *TokenCreate) SetNotNilToken(value *string) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilUUID added in v1.0.9

func (t *TokenCreate) SetNotNilUUID(value *uuid.UUID) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilUpdatedAt added in v1.0.9

func (t *TokenCreate) SetNotNilUpdatedAt(value *time.Time) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetSource

func (tc *TokenCreate) SetSource(s string) *TokenCreate

SetSource sets the "source" field.

func (*TokenCreate) SetStatus

func (tc *TokenCreate) SetStatus(u uint8) *TokenCreate

SetStatus sets the "status" field.

func (*TokenCreate) SetToken

func (tc *TokenCreate) SetToken(s string) *TokenCreate

SetToken sets the "token" field.

func (*TokenCreate) SetUUID

func (tc *TokenCreate) SetUUID(u uuid.UUID) *TokenCreate

SetUUID sets the "uuid" field.

func (*TokenCreate) SetUpdatedAt

func (tc *TokenCreate) SetUpdatedAt(t time.Time) *TokenCreate

SetUpdatedAt sets the "updated_at" field.

type TokenCreateBulk

type TokenCreateBulk struct {
	// contains filtered or unexported fields
}

TokenCreateBulk is the builder for creating many Token entities in bulk.

func (*TokenCreateBulk) Exec

func (tcb *TokenCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenCreateBulk) ExecContext added in v1.0.9

func (c *TokenCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenCreateBulk) ExecX

func (tcb *TokenCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenCreateBulk) QueryContext added in v1.0.9

func (c *TokenCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenCreateBulk) Save

func (tcb *TokenCreateBulk) Save(ctx context.Context) ([]*Token, error)

Save creates the Token entities in the database.

func (*TokenCreateBulk) SaveX

func (tcb *TokenCreateBulk) SaveX(ctx context.Context) []*Token

SaveX is like Save, but panics if an error occurs.

type TokenDelete

type TokenDelete struct {
	// contains filtered or unexported fields
}

TokenDelete is the builder for deleting a Token entity.

func (*TokenDelete) Exec

func (td *TokenDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TokenDelete) ExecContext added in v1.0.9

func (c *TokenDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenDelete) ExecX

func (td *TokenDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TokenDelete) QueryContext added in v1.0.9

func (c *TokenDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenDelete) Where

func (td *TokenDelete) Where(ps ...predicate.Token) *TokenDelete

Where appends a list predicates to the TokenDelete builder.

type TokenDeleteOne

type TokenDeleteOne struct {
	// contains filtered or unexported fields
}

TokenDeleteOne is the builder for deleting a single Token entity.

func (*TokenDeleteOne) Exec

func (tdo *TokenDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TokenDeleteOne) ExecX

func (tdo *TokenDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenDeleteOne) Where

func (tdo *TokenDeleteOne) Where(ps ...predicate.Token) *TokenDeleteOne

Where appends a list predicates to the TokenDelete builder.

type TokenGroupBy

type TokenGroupBy struct {
	// contains filtered or unexported fields
}

TokenGroupBy is the group-by builder for Token entities.

func (*TokenGroupBy) Aggregate

func (tgb *TokenGroupBy) Aggregate(fns ...AggregateFunc) *TokenGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TokenGroupBy) Bool

func (s *TokenGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) BoolX

func (s *TokenGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TokenGroupBy) Bools

func (s *TokenGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) BoolsX

func (s *TokenGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TokenGroupBy) Float64

func (s *TokenGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) Float64X

func (s *TokenGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TokenGroupBy) Float64s

func (s *TokenGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) Float64sX

func (s *TokenGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TokenGroupBy) Int

func (s *TokenGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) IntX

func (s *TokenGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TokenGroupBy) Ints

func (s *TokenGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) IntsX

func (s *TokenGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TokenGroupBy) Scan

func (tgb *TokenGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TokenGroupBy) ScanX

func (s *TokenGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TokenGroupBy) String

func (s *TokenGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) StringX

func (s *TokenGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TokenGroupBy) Strings

func (s *TokenGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) StringsX

func (s *TokenGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TokenMutation

type TokenMutation struct {
	// contains filtered or unexported fields
}

TokenMutation represents an operation that mutates the Token nodes in the graph.

func (*TokenMutation) AddField

func (m *TokenMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TokenMutation) AddStatus

func (m *TokenMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*TokenMutation) AddedEdges

func (m *TokenMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TokenMutation) AddedField

func (m *TokenMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TokenMutation) AddedFields

func (m *TokenMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TokenMutation) AddedIDs

func (m *TokenMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TokenMutation) AddedStatus

func (m *TokenMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*TokenMutation) ClearEdge

func (m *TokenMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*TokenMutation) ClearField

func (m *TokenMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*TokenMutation) ClearStatus

func (m *TokenMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*TokenMutation) ClearedEdges

func (m *TokenMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TokenMutation) ClearedFields

func (m *TokenMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TokenMutation) Client

func (m TokenMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*TokenMutation) CreatedAt

func (m *TokenMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*TokenMutation) EdgeCleared

func (m *TokenMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TokenMutation) ExecContext added in v1.0.9

func (c *TokenMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenMutation) ExpiredAt

func (m *TokenMutation) ExpiredAt() (r time.Time, exists bool)

ExpiredAt returns the value of the "expired_at" field in the mutation.

func (*TokenMutation) Field

func (m *TokenMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TokenMutation) FieldCleared

func (m *TokenMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TokenMutation) Fields

func (m *TokenMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*TokenMutation) ID

func (m *TokenMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*TokenMutation) IDs

func (m *TokenMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*TokenMutation) OldCreatedAt

func (m *TokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldExpiredAt

func (m *TokenMutation) OldExpiredAt(ctx context.Context) (v time.Time, err error)

OldExpiredAt returns the old "expired_at" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldField

func (m *TokenMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*TokenMutation) OldSource

func (m *TokenMutation) OldSource(ctx context.Context) (v string, err error)

OldSource returns the old "source" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldStatus

func (m *TokenMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldToken

func (m *TokenMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldUUID

func (m *TokenMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldUpdatedAt

func (m *TokenMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) Op

func (m *TokenMutation) Op() Op

Op returns the operation name.

func (*TokenMutation) QueryContext added in v1.0.9

func (c *TokenMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenMutation) RemovedEdges

func (m *TokenMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TokenMutation) RemovedIDs

func (m *TokenMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*TokenMutation) ResetCreatedAt

func (m *TokenMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TokenMutation) ResetEdge

func (m *TokenMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*TokenMutation) ResetExpiredAt

func (m *TokenMutation) ResetExpiredAt()

ResetExpiredAt resets all changes to the "expired_at" field.

func (*TokenMutation) ResetField

func (m *TokenMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*TokenMutation) ResetSource

func (m *TokenMutation) ResetSource()

ResetSource resets all changes to the "source" field.

func (*TokenMutation) ResetStatus

func (m *TokenMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TokenMutation) ResetToken

func (m *TokenMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*TokenMutation) ResetUUID

func (m *TokenMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*TokenMutation) ResetUpdatedAt

func (m *TokenMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TokenMutation) SetCreatedAt

func (m *TokenMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*TokenMutation) SetExpiredAt

func (m *TokenMutation) SetExpiredAt(t time.Time)

SetExpiredAt sets the "expired_at" field.

func (*TokenMutation) SetField

func (m *TokenMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TokenMutation) SetID

func (m *TokenMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Token entities.

func (*TokenMutation) SetOp

func (m *TokenMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TokenMutation) SetSource

func (m *TokenMutation) SetSource(s string)

SetSource sets the "source" field.

func (*TokenMutation) SetStatus

func (m *TokenMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*TokenMutation) SetToken

func (m *TokenMutation) SetToken(s string)

SetToken sets the "token" field.

func (*TokenMutation) SetUUID

func (m *TokenMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (*TokenMutation) SetUpdatedAt

func (m *TokenMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*TokenMutation) Source

func (m *TokenMutation) Source() (r string, exists bool)

Source returns the value of the "source" field in the mutation.

func (*TokenMutation) Status

func (m *TokenMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*TokenMutation) StatusCleared

func (m *TokenMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (*TokenMutation) Token

func (m *TokenMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (TokenMutation) Tx

func (m TokenMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TokenMutation) Type

func (m *TokenMutation) Type() string

Type returns the node type of this mutation (Token).

func (*TokenMutation) UUID

func (m *TokenMutation) UUID() (r uuid.UUID, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*TokenMutation) UpdatedAt

func (m *TokenMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*TokenMutation) Where

func (m *TokenMutation) Where(ps ...predicate.Token)

Where appends a list predicates to the TokenMutation builder.

func (*TokenMutation) WhereP

func (m *TokenMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TokenPageList

type TokenPageList struct {
	List        []*Token     `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

TokenPageList is Token PageList result.

type TokenPager

type TokenPager struct {
	Order  token.OrderOption
	Filter func(*TokenQuery) (*TokenQuery, error)
}

func (*TokenPager) ApplyFilter

func (p *TokenPager) ApplyFilter(query *TokenQuery) (*TokenQuery, error)

type TokenPaginateOption

type TokenPaginateOption func(*TokenPager)

TokenPaginateOption enables pagination customization.

type TokenQuery

type TokenQuery struct {
	// contains filtered or unexported fields
}

TokenQuery is the builder for querying Token entities.

func (*TokenQuery) Aggregate

func (tq *TokenQuery) Aggregate(fns ...AggregateFunc) *TokenSelect

Aggregate returns a TokenSelect configured with the given aggregations.

func (*TokenQuery) All

func (tq *TokenQuery) All(ctx context.Context) ([]*Token, error)

All executes the query and returns a list of Tokens.

func (*TokenQuery) AllX

func (tq *TokenQuery) AllX(ctx context.Context) []*Token

AllX is like All, but panics if an error occurs.

func (*TokenQuery) Clone

func (tq *TokenQuery) Clone() *TokenQuery

Clone returns a duplicate of the TokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TokenQuery) Count

func (tq *TokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TokenQuery) CountX

func (tq *TokenQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TokenQuery) ExecContext added in v1.0.9

func (c *TokenQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenQuery) Exist

func (tq *TokenQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TokenQuery) ExistX

func (tq *TokenQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TokenQuery) First

func (tq *TokenQuery) First(ctx context.Context) (*Token, error)

First returns the first Token entity from the query. Returns a *NotFoundError when no Token was found.

func (*TokenQuery) FirstID

func (tq *TokenQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Token ID from the query. Returns a *NotFoundError when no Token ID was found.

func (*TokenQuery) FirstIDX

func (tq *TokenQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TokenQuery) FirstX

func (tq *TokenQuery) FirstX(ctx context.Context) *Token

FirstX is like First, but panics if an error occurs.

func (*TokenQuery) GroupBy

func (tq *TokenQuery) GroupBy(field string, fields ...string) *TokenGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Token.Query().
	GroupBy(token.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TokenQuery) IDs

func (tq *TokenQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Token IDs.

func (*TokenQuery) IDsX

func (tq *TokenQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TokenQuery) Limit

func (tq *TokenQuery) Limit(limit int) *TokenQuery

Limit the number of records to be returned by this query.

func (*TokenQuery) Offset

func (tq *TokenQuery) Offset(offset int) *TokenQuery

Offset to start from.

func (*TokenQuery) Only

func (tq *TokenQuery) Only(ctx context.Context) (*Token, error)

Only returns a single Token entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Token entity is found. Returns a *NotFoundError when no Token entities are found.

func (*TokenQuery) OnlyID

func (tq *TokenQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Token ID in the query. Returns a *NotSingularError when more than one Token ID is found. Returns a *NotFoundError when no entities are found.

func (*TokenQuery) OnlyIDX

func (tq *TokenQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TokenQuery) OnlyX

func (tq *TokenQuery) OnlyX(ctx context.Context) *Token

OnlyX is like Only, but panics if an error occurs.

func (*TokenQuery) Order

func (tq *TokenQuery) Order(o ...token.OrderOption) *TokenQuery

Order specifies how the records should be ordered.

func (*TokenQuery) Page

func (t *TokenQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...TokenPaginateOption,
) (*TokenPageList, error)

func (*TokenQuery) QueryContext added in v1.0.9

func (c *TokenQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenQuery) Select

func (tq *TokenQuery) Select(fields ...string) *TokenSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Token.Query().
	Select(token.FieldCreatedAt).
	Scan(ctx, &v)

func (*TokenQuery) Unique

func (tq *TokenQuery) Unique(unique bool) *TokenQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*TokenQuery) Where

func (tq *TokenQuery) Where(ps ...predicate.Token) *TokenQuery

Where adds a new predicate for the TokenQuery builder.

type TokenSelect

type TokenSelect struct {
	*TokenQuery
	// contains filtered or unexported fields
}

TokenSelect is the builder for selecting fields of Token entities.

func (*TokenSelect) Aggregate

func (ts *TokenSelect) Aggregate(fns ...AggregateFunc) *TokenSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TokenSelect) Bool

func (s *TokenSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TokenSelect) BoolX

func (s *TokenSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TokenSelect) Bools

func (s *TokenSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TokenSelect) BoolsX

func (s *TokenSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (TokenSelect) ExecContext added in v1.0.9

func (c TokenSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenSelect) Float64

func (s *TokenSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TokenSelect) Float64X

func (s *TokenSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TokenSelect) Float64s

func (s *TokenSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TokenSelect) Float64sX

func (s *TokenSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TokenSelect) Int

func (s *TokenSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TokenSelect) IntX

func (s *TokenSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TokenSelect) Ints

func (s *TokenSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TokenSelect) IntsX

func (s *TokenSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (TokenSelect) QueryContext added in v1.0.9

func (c TokenSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenSelect) Scan

func (ts *TokenSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TokenSelect) ScanX

func (s *TokenSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TokenSelect) String

func (s *TokenSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TokenSelect) StringX

func (s *TokenSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TokenSelect) Strings

func (s *TokenSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TokenSelect) StringsX

func (s *TokenSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TokenUpdate

type TokenUpdate struct {
	// contains filtered or unexported fields
}

TokenUpdate is the builder for updating Token entities.

func (*TokenUpdate) AddStatus

func (tu *TokenUpdate) AddStatus(u int8) *TokenUpdate

AddStatus adds u to the "status" field.

func (*TokenUpdate) ClearStatus

func (tu *TokenUpdate) ClearStatus() *TokenUpdate

ClearStatus clears the value of the "status" field.

func (*TokenUpdate) Exec

func (tu *TokenUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUpdate) ExecContext added in v1.0.9

func (c *TokenUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenUpdate) ExecX

func (tu *TokenUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUpdate) Mutation

func (tu *TokenUpdate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdate) QueryContext added in v1.0.9

func (c *TokenUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenUpdate) Save

func (tu *TokenUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TokenUpdate) SaveX

func (tu *TokenUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TokenUpdate) SetExpiredAt

func (tu *TokenUpdate) SetExpiredAt(t time.Time) *TokenUpdate

SetExpiredAt sets the "expired_at" field.

func (*TokenUpdate) SetNillableExpiredAt added in v1.2.3

func (tu *TokenUpdate) SetNillableExpiredAt(t *time.Time) *TokenUpdate

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*TokenUpdate) SetNillableSource added in v1.2.3

func (tu *TokenUpdate) SetNillableSource(s *string) *TokenUpdate

SetNillableSource sets the "source" field if the given value is not nil.

func (*TokenUpdate) SetNillableStatus

func (tu *TokenUpdate) SetNillableStatus(u *uint8) *TokenUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TokenUpdate) SetNillableToken added in v1.2.3

func (tu *TokenUpdate) SetNillableToken(s *string) *TokenUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*TokenUpdate) SetNillableUUID added in v1.2.3

func (tu *TokenUpdate) SetNillableUUID(u *uuid.UUID) *TokenUpdate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*TokenUpdate) SetNotEmptySource

func (t *TokenUpdate) SetNotEmptySource(value string) *TokenUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*TokenUpdate) SetNotEmptyStatus

func (t *TokenUpdate) SetNotEmptyStatus(value uint8) *TokenUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*TokenUpdate) SetNotEmptyToken

func (t *TokenUpdate) SetNotEmptyToken(value string) *TokenUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*TokenUpdate) SetNotNilExpiredAt added in v1.0.9

func (t *TokenUpdate) SetNotNilExpiredAt(value *time.Time) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilSource added in v1.0.9

func (t *TokenUpdate) SetNotNilSource(value *string) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilStatus added in v1.0.9

func (t *TokenUpdate) SetNotNilStatus(value *uint8) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilToken added in v1.0.9

func (t *TokenUpdate) SetNotNilToken(value *string) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilUUID added in v1.0.9

func (t *TokenUpdate) SetNotNilUUID(value *uuid.UUID) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilUpdatedAt added in v1.0.9

func (t *TokenUpdate) SetNotNilUpdatedAt(value *time.Time) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetSource

func (tu *TokenUpdate) SetSource(s string) *TokenUpdate

SetSource sets the "source" field.

func (*TokenUpdate) SetStatus

func (tu *TokenUpdate) SetStatus(u uint8) *TokenUpdate

SetStatus sets the "status" field.

func (*TokenUpdate) SetToken

func (tu *TokenUpdate) SetToken(s string) *TokenUpdate

SetToken sets the "token" field.

func (*TokenUpdate) SetUUID

func (tu *TokenUpdate) SetUUID(u uuid.UUID) *TokenUpdate

SetUUID sets the "uuid" field.

func (*TokenUpdate) SetUpdatedAt

func (tu *TokenUpdate) SetUpdatedAt(t time.Time) *TokenUpdate

SetUpdatedAt sets the "updated_at" field.

func (*TokenUpdate) Where

func (tu *TokenUpdate) Where(ps ...predicate.Token) *TokenUpdate

Where appends a list predicates to the TokenUpdate builder.

type TokenUpdateOne

type TokenUpdateOne struct {
	// contains filtered or unexported fields
}

TokenUpdateOne is the builder for updating a single Token entity.

func (*TokenUpdateOne) AddStatus

func (tuo *TokenUpdateOne) AddStatus(u int8) *TokenUpdateOne

AddStatus adds u to the "status" field.

func (*TokenUpdateOne) ClearStatus

func (tuo *TokenUpdateOne) ClearStatus() *TokenUpdateOne

ClearStatus clears the value of the "status" field.

func (*TokenUpdateOne) Exec

func (tuo *TokenUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TokenUpdateOne) ExecContext added in v1.0.9

func (c *TokenUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenUpdateOne) ExecX

func (tuo *TokenUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUpdateOne) Mutation

func (tuo *TokenUpdateOne) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdateOne) QueryContext added in v1.0.9

func (c *TokenUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenUpdateOne) Save

func (tuo *TokenUpdateOne) Save(ctx context.Context) (*Token, error)

Save executes the query and returns the updated Token entity.

func (*TokenUpdateOne) SaveX

func (tuo *TokenUpdateOne) SaveX(ctx context.Context) *Token

SaveX is like Save, but panics if an error occurs.

func (*TokenUpdateOne) Select

func (tuo *TokenUpdateOne) Select(field string, fields ...string) *TokenUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TokenUpdateOne) SetExpiredAt

func (tuo *TokenUpdateOne) SetExpiredAt(t time.Time) *TokenUpdateOne

SetExpiredAt sets the "expired_at" field.

func (*TokenUpdateOne) SetNillableExpiredAt added in v1.2.3

func (tuo *TokenUpdateOne) SetNillableExpiredAt(t *time.Time) *TokenUpdateOne

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableSource added in v1.2.3

func (tuo *TokenUpdateOne) SetNillableSource(s *string) *TokenUpdateOne

SetNillableSource sets the "source" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableStatus

func (tuo *TokenUpdateOne) SetNillableStatus(u *uint8) *TokenUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableToken added in v1.2.3

func (tuo *TokenUpdateOne) SetNillableToken(s *string) *TokenUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableUUID added in v1.2.3

func (tuo *TokenUpdateOne) SetNillableUUID(u *uuid.UUID) *TokenUpdateOne

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*TokenUpdateOne) SetNotEmptySource

func (t *TokenUpdateOne) SetNotEmptySource(value string) *TokenUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*TokenUpdateOne) SetNotEmptyStatus

func (t *TokenUpdateOne) SetNotEmptyStatus(value uint8) *TokenUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*TokenUpdateOne) SetNotEmptyToken

func (t *TokenUpdateOne) SetNotEmptyToken(value string) *TokenUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*TokenUpdateOne) SetNotNilExpiredAt added in v1.0.9

func (t *TokenUpdateOne) SetNotNilExpiredAt(value *time.Time) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilSource added in v1.0.9

func (t *TokenUpdateOne) SetNotNilSource(value *string) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilStatus added in v1.0.9

func (t *TokenUpdateOne) SetNotNilStatus(value *uint8) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilToken added in v1.0.9

func (t *TokenUpdateOne) SetNotNilToken(value *string) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilUUID added in v1.0.9

func (t *TokenUpdateOne) SetNotNilUUID(value *uuid.UUID) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilUpdatedAt added in v1.0.9

func (t *TokenUpdateOne) SetNotNilUpdatedAt(value *time.Time) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetSource

func (tuo *TokenUpdateOne) SetSource(s string) *TokenUpdateOne

SetSource sets the "source" field.

func (*TokenUpdateOne) SetStatus

func (tuo *TokenUpdateOne) SetStatus(u uint8) *TokenUpdateOne

SetStatus sets the "status" field.

func (*TokenUpdateOne) SetToken

func (tuo *TokenUpdateOne) SetToken(s string) *TokenUpdateOne

SetToken sets the "token" field.

func (*TokenUpdateOne) SetUUID

func (tuo *TokenUpdateOne) SetUUID(u uuid.UUID) *TokenUpdateOne

SetUUID sets the "uuid" field.

func (*TokenUpdateOne) SetUpdatedAt

func (tuo *TokenUpdateOne) SetUpdatedAt(t time.Time) *TokenUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*TokenUpdateOne) Where

func (tuo *TokenUpdateOne) Where(ps ...predicate.Token) *TokenUpdateOne

Where appends a list predicates to the TokenUpdate builder.

type Tokens

type Tokens []*Token

Tokens is a parsable slice of Token.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// API is the client for interacting with the API builders.
	API *APIClient
	// Department is the client for interacting with the Department builders.
	Department *DepartmentClient
	// Dictionary is the client for interacting with the Dictionary builders.
	Dictionary *DictionaryClient
	// DictionaryDetail is the client for interacting with the DictionaryDetail builders.
	DictionaryDetail *DictionaryDetailClient
	// Menu is the client for interacting with the Menu builders.
	Menu *MenuClient
	// OauthProvider is the client for interacting with the OauthProvider builders.
	OauthProvider *OauthProviderClient
	// Position is the client for interacting with the Position builders.
	Position *PositionClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// Token is the client for interacting with the Token builders.
	Token *TokenClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) ExecContext added in v1.0.9

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) QueryContext added in v1.0.9

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	// UUID
	ID uuid.UUID `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Delete Time | 删除日期
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// User's login name | 登录名
	Username string `json:"username,omitempty"`
	// Password | 密码
	Password string `json:"password,omitempty"`
	// Nickname | 昵称
	Nickname string `json:"nickname,omitempty"`
	// The description of user | 用户的描述信息
	Description string `json:"description,omitempty"`
	// The home page that the user enters after logging in | 用户登陆后进入的首页
	HomePath string `json:"home_path,omitempty"`
	// Mobile number | 手机号
	Mobile string `json:"mobile,omitempty"`
	// Email | 邮箱号
	Email string `json:"email,omitempty"`
	// Avatar | 头像路径
	Avatar string `json:"avatar,omitempty"`
	// Department ID | 部门ID
	DepartmentID uint64 `json:"department_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the UserQuery when eager-loading is set.
	Edges UserEdges `json:"edges"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) ExecContext added in v1.0.9

func (c *User) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*User) QueryContext added in v1.0.9

func (c *User) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*User) QueryDepartments

func (u *User) QueryDepartments() *DepartmentQuery

QueryDepartments queries the "departments" edge of the User entity.

func (*User) QueryPositions

func (u *User) QueryPositions() *PositionQuery

QueryPositions queries the "positions" edge of the User entity.

func (*User) QueryRoles

func (u *User) QueryRoles() *RoleQuery

QueryRoles queries the "roles" edge of the User entity.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

func (*User) Value added in v1.0.0

func (u *User) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the User. This includes values selected through modifiers, order, etc.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uuid.UUID) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) ExecContext added in v1.0.9

func (c *UserClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uuid.UUID) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uuid.UUID) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk added in v1.1.5

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryContext added in v1.0.9

func (c *UserClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserClient) QueryDepartments

func (c *UserClient) QueryDepartments(u *User) *DepartmentQuery

QueryDepartments queries the departments edge of a User.

func (*UserClient) QueryPositions

func (c *UserClient) QueryPositions(u *User) *PositionQuery

QueryPositions queries the positions edge of a User.

func (*UserClient) QueryRoles

func (c *UserClient) QueryRoles(u *User) *RoleQuery

QueryRoles queries the roles edge of a User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id uuid.UUID) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) AddPositionIDs

func (uc *UserCreate) AddPositionIDs(ids ...uint64) *UserCreate

AddPositionIDs adds the "positions" edge to the Position entity by IDs.

func (*UserCreate) AddPositions

func (uc *UserCreate) AddPositions(p ...*Position) *UserCreate

AddPositions adds the "positions" edges to the Position entity.

func (*UserCreate) AddRoleIDs

func (uc *UserCreate) AddRoleIDs(ids ...uint64) *UserCreate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserCreate) AddRoles

func (uc *UserCreate) AddRoles(r ...*Role) *UserCreate

AddRoles adds the "roles" edges to the Role entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecContext added in v1.0.9

func (c *UserCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) QueryContext added in v1.0.9

func (c *UserCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAvatar

func (uc *UserCreate) SetAvatar(s string) *UserCreate

SetAvatar sets the "avatar" field.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetDeletedAt added in v1.0.9

func (uc *UserCreate) SetDeletedAt(t time.Time) *UserCreate

SetDeletedAt sets the "deleted_at" field.

func (*UserCreate) SetDepartmentID

func (uc *UserCreate) SetDepartmentID(u uint64) *UserCreate

SetDepartmentID sets the "department_id" field.

func (*UserCreate) SetDepartments

func (uc *UserCreate) SetDepartments(d *Department) *UserCreate

SetDepartments sets the "departments" edge to the Department entity.

func (*UserCreate) SetDepartmentsID

func (uc *UserCreate) SetDepartmentsID(id uint64) *UserCreate

SetDepartmentsID sets the "departments" edge to the Department entity by ID.

func (*UserCreate) SetDescription

func (uc *UserCreate) SetDescription(s string) *UserCreate

SetDescription sets the "description" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetHomePath

func (uc *UserCreate) SetHomePath(s string) *UserCreate

SetHomePath sets the "home_path" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uuid.UUID) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetMobile

func (uc *UserCreate) SetMobile(s string) *UserCreate

SetMobile sets the "mobile" field.

func (*UserCreate) SetNickname

func (uc *UserCreate) SetNickname(s string) *UserCreate

SetNickname sets the "nickname" field.

func (*UserCreate) SetNillableAvatar

func (uc *UserCreate) SetNillableAvatar(s *string) *UserCreate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*UserCreate) SetNillableDeletedAt added in v1.0.9

func (uc *UserCreate) SetNillableDeletedAt(t *time.Time) *UserCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserCreate) SetNillableDepartmentID

func (uc *UserCreate) SetNillableDepartmentID(u *uint64) *UserCreate

SetNillableDepartmentID sets the "department_id" field if the given value is not nil.

func (*UserCreate) SetNillableDepartmentsID

func (uc *UserCreate) SetNillableDepartmentsID(id *uint64) *UserCreate

SetNillableDepartmentsID sets the "departments" edge to the Department entity by ID if the given value is not nil.

func (*UserCreate) SetNillableDescription

func (uc *UserCreate) SetNillableDescription(s *string) *UserCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserCreate) SetNillableEmail

func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserCreate) SetNillableHomePath

func (uc *UserCreate) SetNillableHomePath(s *string) *UserCreate

SetNillableHomePath sets the "home_path" field if the given value is not nil.

func (*UserCreate) SetNillableID

func (uc *UserCreate) SetNillableID(u *uuid.UUID) *UserCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*UserCreate) SetNillableMobile

func (uc *UserCreate) SetNillableMobile(s *string) *UserCreate

SetNillableMobile sets the "mobile" field if the given value is not nil.

func (*UserCreate) SetNillableStatus

func (uc *UserCreate) SetNillableStatus(u *uint8) *UserCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserCreate) SetNotNilAvatar added in v1.0.9

func (u *UserCreate) SetNotNilAvatar(value *string) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetNotNilDeletedAt added in v1.0.9

func (u *UserCreate) SetNotNilDeletedAt(value *time.Time) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetNotNilDepartmentID added in v1.0.9

func (u *UserCreate) SetNotNilDepartmentID(value *uint64) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetNotNilDescription added in v1.0.9

func (u *UserCreate) SetNotNilDescription(value *string) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetNotNilEmail added in v1.0.9

func (u *UserCreate) SetNotNilEmail(value *string) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetNotNilHomePath added in v1.0.9

func (u *UserCreate) SetNotNilHomePath(value *string) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetNotNilMobile added in v1.0.9

func (u *UserCreate) SetNotNilMobile(value *string) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetNotNilNickname added in v1.0.9

func (u *UserCreate) SetNotNilNickname(value *string) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetNotNilPassword added in v1.0.9

func (u *UserCreate) SetNotNilPassword(value *string) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetNotNilStatus added in v1.0.9

func (u *UserCreate) SetNotNilStatus(value *uint8) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetNotNilUpdatedAt added in v1.0.9

func (u *UserCreate) SetNotNilUpdatedAt(value *time.Time) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetNotNilUsername added in v1.0.9

func (u *UserCreate) SetNotNilUsername(value *string) *UserCreate

set field if value's pointer is not nil.

func (*UserCreate) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetStatus

func (uc *UserCreate) SetStatus(u uint8) *UserCreate

SetStatus sets the "status" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

func (*UserCreate) SetUsername

func (uc *UserCreate) SetUsername(s string) *UserCreate

SetUsername sets the "username" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecContext added in v1.0.9

func (c *UserCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) QueryContext added in v1.0.9

func (c *UserCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecContext added in v1.0.9

func (c *UserDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) QueryContext added in v1.0.9

func (c *UserDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserEdges

type UserEdges struct {
	// Departments holds the value of the departments edge.
	Departments *Department `json:"departments,omitempty"`
	// Positions holds the value of the positions edge.
	Positions []*Position `json:"positions,omitempty"`
	// Roles holds the value of the roles edge.
	Roles []*Role `json:"roles,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) DepartmentsOrErr

func (e UserEdges) DepartmentsOrErr() (*Department, error)

DepartmentsOrErr returns the Departments value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (UserEdges) PositionsOrErr

func (e UserEdges) PositionsOrErr() ([]*Position, error)

PositionsOrErr returns the Positions value or an error if the edge was not loaded in eager-loading.

func (UserEdges) RolesOrErr

func (e UserEdges) RolesOrErr() ([]*Role, error)

RolesOrErr returns the Roles value or an error if the edge was not loaded in eager-loading.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) AddPositionIDs

func (m *UserMutation) AddPositionIDs(ids ...uint64)

AddPositionIDs adds the "positions" edge to the Position entity by ids.

func (*UserMutation) AddRoleIDs

func (m *UserMutation) AddRoleIDs(ids ...uint64)

AddRoleIDs adds the "roles" edge to the Role entity by ids.

func (*UserMutation) AddStatus

func (m *UserMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) AddedStatus

func (m *UserMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*UserMutation) Avatar

func (m *UserMutation) Avatar() (r string, exists bool)

Avatar returns the value of the "avatar" field in the mutation.

func (*UserMutation) AvatarCleared

func (m *UserMutation) AvatarCleared() bool

AvatarCleared returns if the "avatar" field was cleared in this mutation.

func (*UserMutation) ClearAvatar

func (m *UserMutation) ClearAvatar()

ClearAvatar clears the value of the "avatar" field.

func (*UserMutation) ClearDeletedAt added in v1.0.9

func (m *UserMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserMutation) ClearDepartmentID

func (m *UserMutation) ClearDepartmentID()

ClearDepartmentID clears the value of the "department_id" field.

func (*UserMutation) ClearDepartments

func (m *UserMutation) ClearDepartments()

ClearDepartments clears the "departments" edge to the Department entity.

func (*UserMutation) ClearDescription

func (m *UserMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*UserMutation) ClearEdge

func (m *UserMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*UserMutation) ClearEmail

func (m *UserMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*UserMutation) ClearField

func (m *UserMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ClearMobile

func (m *UserMutation) ClearMobile()

ClearMobile clears the value of the "mobile" field.

func (*UserMutation) ClearPositions

func (m *UserMutation) ClearPositions()

ClearPositions clears the "positions" edge to the Position entity.

func (*UserMutation) ClearRoles

func (m *UserMutation) ClearRoles()

ClearRoles clears the "roles" edge to the Role entity.

func (*UserMutation) ClearStatus

func (m *UserMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*UserMutation) CreatedAt

func (m *UserMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*UserMutation) DeletedAt added in v1.0.9

func (m *UserMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*UserMutation) DeletedAtCleared added in v1.0.9

func (m *UserMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*UserMutation) DepartmentID

func (m *UserMutation) DepartmentID() (r uint64, exists bool)

DepartmentID returns the value of the "department_id" field in the mutation.

func (*UserMutation) DepartmentIDCleared

func (m *UserMutation) DepartmentIDCleared() bool

DepartmentIDCleared returns if the "department_id" field was cleared in this mutation.

func (*UserMutation) DepartmentsCleared

func (m *UserMutation) DepartmentsCleared() bool

DepartmentsCleared reports if the "departments" edge to the Department entity was cleared.

func (*UserMutation) DepartmentsID

func (m *UserMutation) DepartmentsID() (id uint64, exists bool)

DepartmentsID returns the "departments" edge ID in the mutation.

func (*UserMutation) DepartmentsIDs

func (m *UserMutation) DepartmentsIDs() (ids []uint64)

DepartmentsIDs returns the "departments" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DepartmentsID instead. It exists only for internal usage by the builders.

func (*UserMutation) Description

func (m *UserMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*UserMutation) DescriptionCleared

func (m *UserMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) EmailCleared

func (m *UserMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*UserMutation) ExecContext added in v1.0.9

func (c *UserMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserMutation) Field

func (m *UserMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*UserMutation) HomePath

func (m *UserMutation) HomePath() (r string, exists bool)

HomePath returns the value of the "home_path" field in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*UserMutation) Mobile

func (m *UserMutation) Mobile() (r string, exists bool)

Mobile returns the value of the "mobile" field in the mutation.

func (*UserMutation) MobileCleared

func (m *UserMutation) MobileCleared() bool

MobileCleared returns if the "mobile" field was cleared in this mutation.

func (*UserMutation) Nickname

func (m *UserMutation) Nickname() (r string, exists bool)

Nickname returns the value of the "nickname" field in the mutation.

func (*UserMutation) OldAvatar

func (m *UserMutation) OldAvatar(ctx context.Context) (v string, err error)

OldAvatar returns the old "avatar" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldCreatedAt

func (m *UserMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldDeletedAt added in v1.0.9

func (m *UserMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldDepartmentID

func (m *UserMutation) OldDepartmentID(ctx context.Context) (v uint64, err error)

OldDepartmentID returns the old "department_id" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldDescription

func (m *UserMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldField

func (m *UserMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*UserMutation) OldHomePath

func (m *UserMutation) OldHomePath(ctx context.Context) (v string, err error)

OldHomePath returns the old "home_path" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldMobile

func (m *UserMutation) OldMobile(ctx context.Context) (v string, err error)

OldMobile returns the old "mobile" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldNickname

func (m *UserMutation) OldNickname(ctx context.Context) (v string, err error)

OldNickname returns the old "nickname" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldPassword

func (m *UserMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldStatus

func (m *UserMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUpdatedAt

func (m *UserMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) OldUsername

func (m *UserMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the User entity. If the User object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) Password

func (m *UserMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*UserMutation) PositionsCleared

func (m *UserMutation) PositionsCleared() bool

PositionsCleared reports if the "positions" edge to the Position entity was cleared.

func (*UserMutation) PositionsIDs

func (m *UserMutation) PositionsIDs() (ids []uint64)

PositionsIDs returns the "positions" edge IDs in the mutation.

func (*UserMutation) QueryContext added in v1.0.9

func (c *UserMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserMutation) RemovePositionIDs

func (m *UserMutation) RemovePositionIDs(ids ...uint64)

RemovePositionIDs removes the "positions" edge to the Position entity by IDs.

func (*UserMutation) RemoveRoleIDs

func (m *UserMutation) RemoveRoleIDs(ids ...uint64)

RemoveRoleIDs removes the "roles" edge to the Role entity by IDs.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*UserMutation) RemovedPositionsIDs

func (m *UserMutation) RemovedPositionsIDs() (ids []uint64)

RemovedPositions returns the removed IDs of the "positions" edge to the Position entity.

func (*UserMutation) RemovedRolesIDs

func (m *UserMutation) RemovedRolesIDs() (ids []uint64)

RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.

func (*UserMutation) ResetAvatar

func (m *UserMutation) ResetAvatar()

ResetAvatar resets all changes to the "avatar" field.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDeletedAt added in v1.0.9

func (m *UserMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*UserMutation) ResetDepartmentID

func (m *UserMutation) ResetDepartmentID()

ResetDepartmentID resets all changes to the "department_id" field.

func (*UserMutation) ResetDepartments

func (m *UserMutation) ResetDepartments()

ResetDepartments resets all changes to the "departments" edge.

func (*UserMutation) ResetDescription

func (m *UserMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*UserMutation) ResetHomePath

func (m *UserMutation) ResetHomePath()

ResetHomePath resets all changes to the "home_path" field.

func (*UserMutation) ResetMobile

func (m *UserMutation) ResetMobile()

ResetMobile resets all changes to the "mobile" field.

func (*UserMutation) ResetNickname

func (m *UserMutation) ResetNickname()

ResetNickname resets all changes to the "nickname" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetPositions

func (m *UserMutation) ResetPositions()

ResetPositions resets all changes to the "positions" edge.

func (*UserMutation) ResetRoles

func (m *UserMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*UserMutation) ResetStatus

func (m *UserMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) ResetUsername

func (m *UserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*UserMutation) RolesCleared

func (m *UserMutation) RolesCleared() bool

RolesCleared reports if the "roles" edge to the Role entity was cleared.

func (*UserMutation) RolesIDs

func (m *UserMutation) RolesIDs() (ids []uint64)

RolesIDs returns the "roles" edge IDs in the mutation.

func (*UserMutation) SetAvatar

func (m *UserMutation) SetAvatar(s string)

SetAvatar sets the "avatar" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetDeletedAt added in v1.0.9

func (m *UserMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*UserMutation) SetDepartmentID

func (m *UserMutation) SetDepartmentID(u uint64)

SetDepartmentID sets the "department_id" field.

func (*UserMutation) SetDepartmentsID

func (m *UserMutation) SetDepartmentsID(id uint64)

SetDepartmentsID sets the "departments" edge to the Department entity by id.

func (*UserMutation) SetDescription

func (m *UserMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*UserMutation) SetHomePath

func (m *UserMutation) SetHomePath(s string)

SetHomePath sets the "home_path" field.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetMobile

func (m *UserMutation) SetMobile(s string)

SetMobile sets the "mobile" field.

func (*UserMutation) SetNickname

func (m *UserMutation) SetNickname(s string)

SetNickname sets the "nickname" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPassword

func (m *UserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*UserMutation) SetStatus

func (m *UserMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) SetUsername

func (m *UserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*UserMutation) Status

func (m *UserMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*UserMutation) StatusCleared

func (m *UserMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UpdatedAt

func (m *UserMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*UserMutation) Username

func (m *UserMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserPageList

type UserPageList struct {
	List        []*User      `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

UserPageList is User PageList result.

type UserPager

type UserPager struct {
	Order  user.OrderOption
	Filter func(*UserQuery) (*UserQuery, error)
}

func (*UserPager) ApplyFilter

func (p *UserPager) ApplyFilter(query *UserQuery) (*UserQuery, error)

type UserPaginateOption

type UserPaginateOption func(*UserPager)

UserPaginateOption enables pagination customization.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) ExecContext added in v1.0.9

func (c *UserQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) Page

func (u *UserQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...UserPaginateOption,
) (*UserPageList, error)

func (*UserQuery) QueryContext added in v1.0.9

func (c *UserQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserQuery) QueryDepartments

func (uq *UserQuery) QueryDepartments() *DepartmentQuery

QueryDepartments chains the current query on the "departments" edge.

func (*UserQuery) QueryPositions

func (uq *UserQuery) QueryPositions() *PositionQuery

QueryPositions chains the current query on the "positions" edge.

func (*UserQuery) QueryRoles

func (uq *UserQuery) QueryRoles() *RoleQuery

QueryRoles chains the current query on the "roles" edge.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.User.Query().
	Select(user.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

func (*UserQuery) WithDepartments

func (uq *UserQuery) WithDepartments(opts ...func(*DepartmentQuery)) *UserQuery

WithDepartments tells the query-builder to eager-load the nodes that are connected to the "departments" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithPositions

func (uq *UserQuery) WithPositions(opts ...func(*PositionQuery)) *UserQuery

WithPositions tells the query-builder to eager-load the nodes that are connected to the "positions" edge. The optional arguments are used to configure the query builder of the edge.

func (*UserQuery) WithRoles

func (uq *UserQuery) WithRoles(opts ...func(*RoleQuery)) *UserQuery

WithRoles tells the query-builder to eager-load the nodes that are connected to the "roles" edge. The optional arguments are used to configure the query builder of the edge.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (UserSelect) ExecContext added in v1.0.9

func (c UserSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (UserSelect) QueryContext added in v1.0.9

func (c UserSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddPositionIDs

func (uu *UserUpdate) AddPositionIDs(ids ...uint64) *UserUpdate

AddPositionIDs adds the "positions" edge to the Position entity by IDs.

func (*UserUpdate) AddPositions

func (uu *UserUpdate) AddPositions(p ...*Position) *UserUpdate

AddPositions adds the "positions" edges to the Position entity.

func (*UserUpdate) AddRoleIDs

func (uu *UserUpdate) AddRoleIDs(ids ...uint64) *UserUpdate

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserUpdate) AddRoles

func (uu *UserUpdate) AddRoles(r ...*Role) *UserUpdate

AddRoles adds the "roles" edges to the Role entity.

func (*UserUpdate) AddStatus

func (uu *UserUpdate) AddStatus(u int8) *UserUpdate

AddStatus adds u to the "status" field.

func (*UserUpdate) ClearAvatar

func (uu *UserUpdate) ClearAvatar() *UserUpdate

ClearAvatar clears the value of the "avatar" field.

func (*UserUpdate) ClearDeletedAt added in v1.0.9

func (uu *UserUpdate) ClearDeletedAt() *UserUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpdate) ClearDepartmentID

func (uu *UserUpdate) ClearDepartmentID() *UserUpdate

ClearDepartmentID clears the value of the "department_id" field.

func (*UserUpdate) ClearDepartments

func (uu *UserUpdate) ClearDepartments() *UserUpdate

ClearDepartments clears the "departments" edge to the Department entity.

func (*UserUpdate) ClearDescription

func (uu *UserUpdate) ClearDescription() *UserUpdate

ClearDescription clears the value of the "description" field.

func (*UserUpdate) ClearEmail

func (uu *UserUpdate) ClearEmail() *UserUpdate

ClearEmail clears the value of the "email" field.

func (*UserUpdate) ClearMobile

func (uu *UserUpdate) ClearMobile() *UserUpdate

ClearMobile clears the value of the "mobile" field.

func (*UserUpdate) ClearPositions

func (uu *UserUpdate) ClearPositions() *UserUpdate

ClearPositions clears all "positions" edges to the Position entity.

func (*UserUpdate) ClearRoles

func (uu *UserUpdate) ClearRoles() *UserUpdate

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdate) ClearStatus

func (uu *UserUpdate) ClearStatus() *UserUpdate

ClearStatus clears the value of the "status" field.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecContext added in v1.0.9

func (c *UserUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) QueryContext added in v1.0.9

func (c *UserUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdate) RemovePositionIDs

func (uu *UserUpdate) RemovePositionIDs(ids ...uint64) *UserUpdate

RemovePositionIDs removes the "positions" edge to Position entities by IDs.

func (*UserUpdate) RemovePositions

func (uu *UserUpdate) RemovePositions(p ...*Position) *UserUpdate

RemovePositions removes "positions" edges to Position entities.

func (*UserUpdate) RemoveRoleIDs

func (uu *UserUpdate) RemoveRoleIDs(ids ...uint64) *UserUpdate

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*UserUpdate) RemoveRoles

func (uu *UserUpdate) RemoveRoles(r ...*Role) *UserUpdate

RemoveRoles removes "roles" edges to Role entities.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetAvatar

func (uu *UserUpdate) SetAvatar(s string) *UserUpdate

SetAvatar sets the "avatar" field.

func (*UserUpdate) SetDeletedAt added in v1.0.9

func (uu *UserUpdate) SetDeletedAt(t time.Time) *UserUpdate

SetDeletedAt sets the "deleted_at" field.

func (*UserUpdate) SetDepartmentID

func (uu *UserUpdate) SetDepartmentID(u uint64) *UserUpdate

SetDepartmentID sets the "department_id" field.

func (*UserUpdate) SetDepartments

func (uu *UserUpdate) SetDepartments(d *Department) *UserUpdate

SetDepartments sets the "departments" edge to the Department entity.

func (*UserUpdate) SetDepartmentsID

func (uu *UserUpdate) SetDepartmentsID(id uint64) *UserUpdate

SetDepartmentsID sets the "departments" edge to the Department entity by ID.

func (*UserUpdate) SetDescription

func (uu *UserUpdate) SetDescription(s string) *UserUpdate

SetDescription sets the "description" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetHomePath

func (uu *UserUpdate) SetHomePath(s string) *UserUpdate

SetHomePath sets the "home_path" field.

func (*UserUpdate) SetMobile

func (uu *UserUpdate) SetMobile(s string) *UserUpdate

SetMobile sets the "mobile" field.

func (*UserUpdate) SetNickname

func (uu *UserUpdate) SetNickname(s string) *UserUpdate

SetNickname sets the "nickname" field.

func (*UserUpdate) SetNillableAvatar

func (uu *UserUpdate) SetNillableAvatar(s *string) *UserUpdate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserUpdate) SetNillableDeletedAt added in v1.0.9

func (uu *UserUpdate) SetNillableDeletedAt(t *time.Time) *UserUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserUpdate) SetNillableDepartmentID

func (uu *UserUpdate) SetNillableDepartmentID(u *uint64) *UserUpdate

SetNillableDepartmentID sets the "department_id" field if the given value is not nil.

func (*UserUpdate) SetNillableDepartmentsID

func (uu *UserUpdate) SetNillableDepartmentsID(id *uint64) *UserUpdate

SetNillableDepartmentsID sets the "departments" edge to the Department entity by ID if the given value is not nil.

func (*UserUpdate) SetNillableDescription

func (uu *UserUpdate) SetNillableDescription(s *string) *UserUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserUpdate) SetNillableEmail

func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillableHomePath

func (uu *UserUpdate) SetNillableHomePath(s *string) *UserUpdate

SetNillableHomePath sets the "home_path" field if the given value is not nil.

func (*UserUpdate) SetNillableMobile

func (uu *UserUpdate) SetNillableMobile(s *string) *UserUpdate

SetNillableMobile sets the "mobile" field if the given value is not nil.

func (*UserUpdate) SetNillableNickname added in v1.2.3

func (uu *UserUpdate) SetNillableNickname(s *string) *UserUpdate

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword added in v1.2.3

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillableStatus

func (uu *UserUpdate) SetNillableStatus(u *uint8) *UserUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*UserUpdate) SetNillableUsername added in v1.2.3

func (uu *UserUpdate) SetNillableUsername(s *string) *UserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdate) SetNotEmptyAvatar

func (u *UserUpdate) SetNotEmptyAvatar(value string) *UserUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdate) SetNotEmptyDepartmentID

func (u *UserUpdate) SetNotEmptyDepartmentID(value uint64) *UserUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdate) SetNotEmptyDescription

func (u *UserUpdate) SetNotEmptyDescription(value string) *UserUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdate) SetNotEmptyEmail

func (u *UserUpdate) SetNotEmptyEmail(value string) *UserUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdate) SetNotEmptyHomePath

func (u *UserUpdate) SetNotEmptyHomePath(value string) *UserUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdate) SetNotEmptyMobile

func (u *UserUpdate) SetNotEmptyMobile(value string) *UserUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdate) SetNotEmptyNickname

func (u *UserUpdate) SetNotEmptyNickname(value string) *UserUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdate) SetNotEmptyPassword

func (u *UserUpdate) SetNotEmptyPassword(value string) *UserUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdate) SetNotEmptyStatus

func (u *UserUpdate) SetNotEmptyStatus(value uint8) *UserUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdate) SetNotEmptyUsername

func (u *UserUpdate) SetNotEmptyUsername(value string) *UserUpdate

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdate) SetNotNilAvatar added in v1.0.9

func (u *UserUpdate) SetNotNilAvatar(value *string) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetNotNilDeletedAt added in v1.0.9

func (u *UserUpdate) SetNotNilDeletedAt(value *time.Time) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetNotNilDepartmentID added in v1.0.9

func (u *UserUpdate) SetNotNilDepartmentID(value *uint64) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetNotNilDescription added in v1.0.9

func (u *UserUpdate) SetNotNilDescription(value *string) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetNotNilEmail added in v1.0.9

func (u *UserUpdate) SetNotNilEmail(value *string) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetNotNilHomePath added in v1.0.9

func (u *UserUpdate) SetNotNilHomePath(value *string) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetNotNilMobile added in v1.0.9

func (u *UserUpdate) SetNotNilMobile(value *string) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetNotNilNickname added in v1.0.9

func (u *UserUpdate) SetNotNilNickname(value *string) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetNotNilPassword added in v1.0.9

func (u *UserUpdate) SetNotNilPassword(value *string) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetNotNilStatus added in v1.0.9

func (u *UserUpdate) SetNotNilStatus(value *uint8) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetNotNilUpdatedAt added in v1.0.9

func (u *UserUpdate) SetNotNilUpdatedAt(value *time.Time) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetNotNilUsername added in v1.0.9

func (u *UserUpdate) SetNotNilUsername(value *string) *UserUpdate

set field if value's pointer is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetStatus

func (uu *UserUpdate) SetStatus(u uint8) *UserUpdate

SetStatus sets the "status" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) SetUsername

func (uu *UserUpdate) SetUsername(s string) *UserUpdate

SetUsername sets the "username" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddPositionIDs

func (uuo *UserUpdateOne) AddPositionIDs(ids ...uint64) *UserUpdateOne

AddPositionIDs adds the "positions" edge to the Position entity by IDs.

func (*UserUpdateOne) AddPositions

func (uuo *UserUpdateOne) AddPositions(p ...*Position) *UserUpdateOne

AddPositions adds the "positions" edges to the Position entity.

func (*UserUpdateOne) AddRoleIDs

func (uuo *UserUpdateOne) AddRoleIDs(ids ...uint64) *UserUpdateOne

AddRoleIDs adds the "roles" edge to the Role entity by IDs.

func (*UserUpdateOne) AddRoles

func (uuo *UserUpdateOne) AddRoles(r ...*Role) *UserUpdateOne

AddRoles adds the "roles" edges to the Role entity.

func (*UserUpdateOne) AddStatus

func (uuo *UserUpdateOne) AddStatus(u int8) *UserUpdateOne

AddStatus adds u to the "status" field.

func (*UserUpdateOne) ClearAvatar

func (uuo *UserUpdateOne) ClearAvatar() *UserUpdateOne

ClearAvatar clears the value of the "avatar" field.

func (*UserUpdateOne) ClearDeletedAt added in v1.0.9

func (uuo *UserUpdateOne) ClearDeletedAt() *UserUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpdateOne) ClearDepartmentID

func (uuo *UserUpdateOne) ClearDepartmentID() *UserUpdateOne

ClearDepartmentID clears the value of the "department_id" field.

func (*UserUpdateOne) ClearDepartments

func (uuo *UserUpdateOne) ClearDepartments() *UserUpdateOne

ClearDepartments clears the "departments" edge to the Department entity.

func (*UserUpdateOne) ClearDescription

func (uuo *UserUpdateOne) ClearDescription() *UserUpdateOne

ClearDescription clears the value of the "description" field.

func (*UserUpdateOne) ClearEmail

func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne

ClearEmail clears the value of the "email" field.

func (*UserUpdateOne) ClearMobile

func (uuo *UserUpdateOne) ClearMobile() *UserUpdateOne

ClearMobile clears the value of the "mobile" field.

func (*UserUpdateOne) ClearPositions

func (uuo *UserUpdateOne) ClearPositions() *UserUpdateOne

ClearPositions clears all "positions" edges to the Position entity.

func (*UserUpdateOne) ClearRoles

func (uuo *UserUpdateOne) ClearRoles() *UserUpdateOne

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdateOne) ClearStatus

func (uuo *UserUpdateOne) ClearStatus() *UserUpdateOne

ClearStatus clears the value of the "status" field.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecContext added in v1.0.9

func (c *UserUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) QueryContext added in v1.0.9

func (c *UserUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdateOne) RemovePositionIDs

func (uuo *UserUpdateOne) RemovePositionIDs(ids ...uint64) *UserUpdateOne

RemovePositionIDs removes the "positions" edge to Position entities by IDs.

func (*UserUpdateOne) RemovePositions

func (uuo *UserUpdateOne) RemovePositions(p ...*Position) *UserUpdateOne

RemovePositions removes "positions" edges to Position entities.

func (*UserUpdateOne) RemoveRoleIDs

func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...uint64) *UserUpdateOne

RemoveRoleIDs removes the "roles" edge to Role entities by IDs.

func (*UserUpdateOne) RemoveRoles

func (uuo *UserUpdateOne) RemoveRoles(r ...*Role) *UserUpdateOne

RemoveRoles removes "roles" edges to Role entities.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetAvatar

func (uuo *UserUpdateOne) SetAvatar(s string) *UserUpdateOne

SetAvatar sets the "avatar" field.

func (*UserUpdateOne) SetDeletedAt added in v1.0.9

func (uuo *UserUpdateOne) SetDeletedAt(t time.Time) *UserUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*UserUpdateOne) SetDepartmentID

func (uuo *UserUpdateOne) SetDepartmentID(u uint64) *UserUpdateOne

SetDepartmentID sets the "department_id" field.

func (*UserUpdateOne) SetDepartments

func (uuo *UserUpdateOne) SetDepartments(d *Department) *UserUpdateOne

SetDepartments sets the "departments" edge to the Department entity.

func (*UserUpdateOne) SetDepartmentsID

func (uuo *UserUpdateOne) SetDepartmentsID(id uint64) *UserUpdateOne

SetDepartmentsID sets the "departments" edge to the Department entity by ID.

func (*UserUpdateOne) SetDescription

func (uuo *UserUpdateOne) SetDescription(s string) *UserUpdateOne

SetDescription sets the "description" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetHomePath

func (uuo *UserUpdateOne) SetHomePath(s string) *UserUpdateOne

SetHomePath sets the "home_path" field.

func (*UserUpdateOne) SetMobile

func (uuo *UserUpdateOne) SetMobile(s string) *UserUpdateOne

SetMobile sets the "mobile" field.

func (*UserUpdateOne) SetNickname

func (uuo *UserUpdateOne) SetNickname(s string) *UserUpdateOne

SetNickname sets the "nickname" field.

func (*UserUpdateOne) SetNillableAvatar

func (uuo *UserUpdateOne) SetNillableAvatar(s *string) *UserUpdateOne

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserUpdateOne) SetNillableDeletedAt added in v1.0.9

func (uuo *UserUpdateOne) SetNillableDeletedAt(t *time.Time) *UserUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableDepartmentID

func (uuo *UserUpdateOne) SetNillableDepartmentID(u *uint64) *UserUpdateOne

SetNillableDepartmentID sets the "department_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillableDepartmentsID

func (uuo *UserUpdateOne) SetNillableDepartmentsID(id *uint64) *UserUpdateOne

SetNillableDepartmentsID sets the "departments" edge to the Department entity by ID if the given value is not nil.

func (*UserUpdateOne) SetNillableDescription

func (uuo *UserUpdateOne) SetNillableDescription(s *string) *UserUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*UserUpdateOne) SetNillableEmail

func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillableHomePath

func (uuo *UserUpdateOne) SetNillableHomePath(s *string) *UserUpdateOne

SetNillableHomePath sets the "home_path" field if the given value is not nil.

func (*UserUpdateOne) SetNillableMobile

func (uuo *UserUpdateOne) SetNillableMobile(s *string) *UserUpdateOne

SetNillableMobile sets the "mobile" field if the given value is not nil.

func (*UserUpdateOne) SetNillableNickname added in v1.2.3

func (uuo *UserUpdateOne) SetNillableNickname(s *string) *UserUpdateOne

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword added in v1.2.3

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillableStatus

func (uuo *UserUpdateOne) SetNillableStatus(u *uint8) *UserUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUsername added in v1.2.3

func (uuo *UserUpdateOne) SetNillableUsername(s *string) *UserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*UserUpdateOne) SetNotEmptyAvatar

func (u *UserUpdateOne) SetNotEmptyAvatar(value string) *UserUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdateOne) SetNotEmptyDepartmentID

func (u *UserUpdateOne) SetNotEmptyDepartmentID(value uint64) *UserUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdateOne) SetNotEmptyDescription

func (u *UserUpdateOne) SetNotEmptyDescription(value string) *UserUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdateOne) SetNotEmptyEmail

func (u *UserUpdateOne) SetNotEmptyEmail(value string) *UserUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdateOne) SetNotEmptyHomePath

func (u *UserUpdateOne) SetNotEmptyHomePath(value string) *UserUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdateOne) SetNotEmptyMobile

func (u *UserUpdateOne) SetNotEmptyMobile(value string) *UserUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdateOne) SetNotEmptyNickname

func (u *UserUpdateOne) SetNotEmptyNickname(value string) *UserUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdateOne) SetNotEmptyPassword

func (u *UserUpdateOne) SetNotEmptyPassword(value string) *UserUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdateOne) SetNotEmptyStatus

func (u *UserUpdateOne) SetNotEmptyStatus(value uint8) *UserUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdateOne) SetNotEmptyUsername

func (u *UserUpdateOne) SetNotEmptyUsername(value string) *UserUpdateOne

set field if value is not empty. e.g. string does not equal to ""

func (*UserUpdateOne) SetNotNilAvatar added in v1.0.9

func (u *UserUpdateOne) SetNotNilAvatar(value *string) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetNotNilDeletedAt added in v1.0.9

func (u *UserUpdateOne) SetNotNilDeletedAt(value *time.Time) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetNotNilDepartmentID added in v1.0.9

func (u *UserUpdateOne) SetNotNilDepartmentID(value *uint64) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetNotNilDescription added in v1.0.9

func (u *UserUpdateOne) SetNotNilDescription(value *string) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetNotNilEmail added in v1.0.9

func (u *UserUpdateOne) SetNotNilEmail(value *string) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetNotNilHomePath added in v1.0.9

func (u *UserUpdateOne) SetNotNilHomePath(value *string) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetNotNilMobile added in v1.0.9

func (u *UserUpdateOne) SetNotNilMobile(value *string) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetNotNilNickname added in v1.0.9

func (u *UserUpdateOne) SetNotNilNickname(value *string) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetNotNilPassword added in v1.0.9

func (u *UserUpdateOne) SetNotNilPassword(value *string) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetNotNilStatus added in v1.0.9

func (u *UserUpdateOne) SetNotNilStatus(value *uint8) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetNotNilUpdatedAt added in v1.0.9

func (u *UserUpdateOne) SetNotNilUpdatedAt(value *time.Time) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetNotNilUsername added in v1.0.9

func (u *UserUpdateOne) SetNotNilUsername(value *string) *UserUpdateOne

set field if value's pointer is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetStatus

func (uuo *UserUpdateOne) SetStatus(u uint8) *UserUpdateOne

SetStatus sets the "status" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) SetUsername

func (uuo *UserUpdateOne) SetUsername(s string) *UserUpdateOne

SetUsername sets the "username" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL