ent

package
v0.0.0-...-96f2668 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 28 Imported by: 0

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.
	TypeDept   = "Dept"
	TypeMember = "Member"
	TypeMenu   = "Menu"
	TypePost   = "Post"
	TypeRole   = "Role"
	TypeTenant = "Tenant"
	TypeUser   = "User"
)

Variables

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 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
	// Dept is the client for interacting with the Dept builders.
	Dept *DeptClient
	// Member is the client for interacting with the Member builders.
	Member *MemberClient
	// Menu is the client for interacting with the Menu builders.
	Menu *MenuClient
	// Post is the client for interacting with the Post builders.
	Post *PostClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// Tenant is the client for interacting with the Tenant builders.
	Tenant *TenantClient
	// 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().
	Dept.
	Query().
	Count(ctx)

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) 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 Dept

type Dept struct {

	// ID of the ent.
	// id
	ID uint32 `json:"id,omitempty"`
	// 创建时间
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// 更新时间
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// 删除时间
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// 备注
	Remark *string `json:"remark,omitempty"`
	// 排序
	Sort *int32 `json:"sort,omitempty"`
	// 状态 0 UNSPECIFIED 开启 1 -> ACTIVE 关闭 2 -> INACTIVE, 禁用 3 -> BANNED
	State *int32 `json:"state,omitempty"`
	// 名称
	Name *string `json:"name,omitempty"`
	// 父级ID
	ParentID *uint32 `json:"parent_id,omitempty"`
	// 祖级列表
	Ancestors []int `json:"ancestors,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DeptQuery when eager-loading is set.
	Edges DeptEdges `json:"edges"`
	// contains filtered or unexported fields
}

部门表

func (*Dept) QueryChildren

func (d *Dept) QueryChildren() *DeptQuery

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

func (*Dept) QueryParent

func (d *Dept) QueryParent() *DeptQuery

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

func (*Dept) String

func (d *Dept) String() string

String implements the fmt.Stringer.

func (*Dept) Unwrap

func (d *Dept) Unwrap() *Dept

Unwrap unwraps the Dept 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 (*Dept) Update

func (d *Dept) Update() *DeptUpdateOne

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

func (*Dept) Value

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

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

type DeptClient

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

DeptClient is a client for the Dept schema.

func NewDeptClient

func NewDeptClient(c config) *DeptClient

NewDeptClient returns a client for the Dept from the given config.

func (*DeptClient) Create

func (c *DeptClient) Create() *DeptCreate

Create returns a builder for creating a Dept entity.

func (*DeptClient) CreateBulk

func (c *DeptClient) CreateBulk(builders ...*DeptCreate) *DeptCreateBulk

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

func (*DeptClient) Delete

func (c *DeptClient) Delete() *DeptDelete

Delete returns a delete builder for Dept.

func (*DeptClient) DeleteOne

func (c *DeptClient) DeleteOne(d *Dept) *DeptDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DeptClient) DeleteOneID

func (c *DeptClient) DeleteOneID(id uint32) *DeptDeleteOne

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

func (*DeptClient) Get

func (c *DeptClient) Get(ctx context.Context, id uint32) (*Dept, error)

Get returns a Dept entity by its id.

func (*DeptClient) GetX

func (c *DeptClient) GetX(ctx context.Context, id uint32) *Dept

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

func (*DeptClient) Hooks

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

Hooks returns the client hooks.

func (*DeptClient) Intercept

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

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

func (*DeptClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DeptClient) MapCreateBulk

func (c *DeptClient) MapCreateBulk(slice any, setFunc func(*DeptCreate, int)) *DeptCreateBulk

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 (*DeptClient) Query

func (c *DeptClient) Query() *DeptQuery

Query returns a query builder for Dept.

func (*DeptClient) QueryChildren

func (c *DeptClient) QueryChildren(d *Dept) *DeptQuery

QueryChildren queries the children edge of a Dept.

func (*DeptClient) QueryParent

func (c *DeptClient) QueryParent(d *Dept) *DeptQuery

QueryParent queries the parent edge of a Dept.

func (*DeptClient) Update

func (c *DeptClient) Update() *DeptUpdate

Update returns an update builder for Dept.

func (*DeptClient) UpdateOne

func (c *DeptClient) UpdateOne(d *Dept) *DeptUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DeptClient) UpdateOneID

func (c *DeptClient) UpdateOneID(id uint32) *DeptUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DeptClient) Use

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

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

type DeptCreate

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

DeptCreate is the builder for creating a Dept entity.

func (*DeptCreate) AddChildIDs

func (dc *DeptCreate) AddChildIDs(ids ...uint32) *DeptCreate

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

func (*DeptCreate) AddChildren

func (dc *DeptCreate) AddChildren(d ...*Dept) *DeptCreate

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

func (*DeptCreate) Exec

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

Exec executes the query.

func (*DeptCreate) ExecX

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

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

func (*DeptCreate) Mutation

func (dc *DeptCreate) Mutation() *DeptMutation

Mutation returns the DeptMutation object of the builder.

func (*DeptCreate) OnConflict

func (dc *DeptCreate) OnConflict(opts ...sql.ConflictOption) *DeptUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Dept.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DeptUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*DeptCreate) OnConflictColumns

func (dc *DeptCreate) OnConflictColumns(columns ...string) *DeptUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Dept.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DeptCreate) Save

func (dc *DeptCreate) Save(ctx context.Context) (*Dept, error)

Save creates the Dept in the database.

func (*DeptCreate) SaveX

func (dc *DeptCreate) SaveX(ctx context.Context) *Dept

SaveX calls Save and panics if Save returns an error.

func (*DeptCreate) SetAncestors

func (dc *DeptCreate) SetAncestors(i []int) *DeptCreate

SetAncestors sets the "ancestors" field.

func (*DeptCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DeptCreate) SetDeletedAt

func (dc *DeptCreate) SetDeletedAt(t time.Time) *DeptCreate

SetDeletedAt sets the "deleted_at" field.

func (*DeptCreate) SetID

func (dc *DeptCreate) SetID(u uint32) *DeptCreate

SetID sets the "id" field.

func (*DeptCreate) SetName

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

SetName sets the "name" field.

func (*DeptCreate) SetNillableCreatedAt

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

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

func (*DeptCreate) SetNillableDeletedAt

func (dc *DeptCreate) SetNillableDeletedAt(t *time.Time) *DeptCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*DeptCreate) SetNillableParentID

func (dc *DeptCreate) SetNillableParentID(u *uint32) *DeptCreate

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

func (*DeptCreate) SetNillableRemark

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

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

func (*DeptCreate) SetNillableSort

func (dc *DeptCreate) SetNillableSort(i *int32) *DeptCreate

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

func (*DeptCreate) SetNillableState

func (dc *DeptCreate) SetNillableState(i *int32) *DeptCreate

SetNillableState sets the "state" field if the given value is not nil.

func (*DeptCreate) SetNillableUpdatedAt

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

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

func (*DeptCreate) SetParent

func (dc *DeptCreate) SetParent(d *Dept) *DeptCreate

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

func (*DeptCreate) SetParentID

func (dc *DeptCreate) SetParentID(u uint32) *DeptCreate

SetParentID sets the "parent_id" field.

func (*DeptCreate) SetRemark

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

SetRemark sets the "remark" field.

func (*DeptCreate) SetSort

func (dc *DeptCreate) SetSort(i int32) *DeptCreate

SetSort sets the "sort" field.

func (*DeptCreate) SetState

func (dc *DeptCreate) SetState(i int32) *DeptCreate

SetState sets the "state" field.

func (*DeptCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

type DeptCreateBulk

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

DeptCreateBulk is the builder for creating many Dept entities in bulk.

func (*DeptCreateBulk) Exec

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

Exec executes the query.

func (*DeptCreateBulk) ExecX

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

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

func (*DeptCreateBulk) OnConflict

func (dcb *DeptCreateBulk) OnConflict(opts ...sql.ConflictOption) *DeptUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Dept.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.DeptUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*DeptCreateBulk) OnConflictColumns

func (dcb *DeptCreateBulk) OnConflictColumns(columns ...string) *DeptUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Dept.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*DeptCreateBulk) Save

func (dcb *DeptCreateBulk) Save(ctx context.Context) ([]*Dept, error)

Save creates the Dept entities in the database.

func (*DeptCreateBulk) SaveX

func (dcb *DeptCreateBulk) SaveX(ctx context.Context) []*Dept

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

type DeptDelete

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

DeptDelete is the builder for deleting a Dept entity.

func (*DeptDelete) Exec

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

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

func (*DeptDelete) ExecX

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

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

func (*DeptDelete) Where

func (dd *DeptDelete) Where(ps ...predicate.Dept) *DeptDelete

Where appends a list predicates to the DeptDelete builder.

type DeptDeleteOne

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

DeptDeleteOne is the builder for deleting a single Dept entity.

func (*DeptDeleteOne) Exec

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

Exec executes the deletion query.

func (*DeptDeleteOne) ExecX

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

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

func (*DeptDeleteOne) Where

func (ddo *DeptDeleteOne) Where(ps ...predicate.Dept) *DeptDeleteOne

Where appends a list predicates to the DeptDelete builder.

type DeptEdges

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

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

func (DeptEdges) ChildrenOrErr

func (e DeptEdges) ChildrenOrErr() ([]*Dept, error)

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

func (DeptEdges) ParentOrErr

func (e DeptEdges) ParentOrErr() (*Dept, error)

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

type DeptFilter

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

DeptFilter provides a generic filtering capability at runtime for DeptQuery.

func (*DeptFilter) Where

func (f *DeptFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*DeptFilter) WhereAncestors

func (f *DeptFilter) WhereAncestors(p entql.BytesP)

WhereAncestors applies the entql json.RawMessage predicate on the ancestors field.

func (*DeptFilter) WhereCreatedAt

func (f *DeptFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*DeptFilter) WhereDeletedAt

func (f *DeptFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*DeptFilter) WhereHasChildren

func (f *DeptFilter) WhereHasChildren()

WhereHasChildren applies a predicate to check if query has an edge children.

func (*DeptFilter) WhereHasChildrenWith

func (f *DeptFilter) WhereHasChildrenWith(preds ...predicate.Dept)

WhereHasChildrenWith applies a predicate to check if query has an edge children with a given conditions (other predicates).

func (*DeptFilter) WhereHasParent

func (f *DeptFilter) WhereHasParent()

WhereHasParent applies a predicate to check if query has an edge parent.

func (*DeptFilter) WhereHasParentWith

func (f *DeptFilter) WhereHasParentWith(preds ...predicate.Dept)

WhereHasParentWith applies a predicate to check if query has an edge parent with a given conditions (other predicates).

func (*DeptFilter) WhereID

func (f *DeptFilter) WhereID(p entql.Uint32P)

WhereID applies the entql uint32 predicate on the id field.

func (*DeptFilter) WhereName

func (f *DeptFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

func (*DeptFilter) WhereParentID

func (f *DeptFilter) WhereParentID(p entql.Uint32P)

WhereParentID applies the entql uint32 predicate on the parent_id field.

func (*DeptFilter) WhereRemark

func (f *DeptFilter) WhereRemark(p entql.StringP)

WhereRemark applies the entql string predicate on the remark field.

func (*DeptFilter) WhereSort

func (f *DeptFilter) WhereSort(p entql.Int32P)

WhereSort applies the entql int32 predicate on the sort field.

func (*DeptFilter) WhereState

func (f *DeptFilter) WhereState(p entql.Int32P)

WhereState applies the entql int32 predicate on the state field.

func (*DeptFilter) WhereUpdatedAt

func (f *DeptFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

type DeptGroupBy

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

DeptGroupBy is the group-by builder for Dept entities.

func (*DeptGroupBy) Aggregate

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

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

func (*DeptGroupBy) Bool

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

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

func (*DeptGroupBy) BoolX

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

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

func (*DeptGroupBy) Bools

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

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

func (*DeptGroupBy) BoolsX

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

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

func (*DeptGroupBy) Float64

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

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

func (*DeptGroupBy) Float64X

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

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

func (*DeptGroupBy) Float64s

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

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

func (*DeptGroupBy) Float64sX

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

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

func (*DeptGroupBy) Int

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

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

func (*DeptGroupBy) IntX

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

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

func (*DeptGroupBy) Ints

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

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

func (*DeptGroupBy) IntsX

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

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

func (*DeptGroupBy) Scan

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

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

func (*DeptGroupBy) ScanX

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

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

func (*DeptGroupBy) String

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

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

func (*DeptGroupBy) StringX

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

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

func (*DeptGroupBy) Strings

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

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

func (*DeptGroupBy) StringsX

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

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

type DeptMutation

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

DeptMutation represents an operation that mutates the Dept nodes in the graph.

func (*DeptMutation) AddChildIDs

func (m *DeptMutation) AddChildIDs(ids ...uint32)

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

func (*DeptMutation) AddField

func (m *DeptMutation) 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 (*DeptMutation) AddSort

func (m *DeptMutation) AddSort(i int32)

AddSort adds i to the "sort" field.

func (*DeptMutation) AddState

func (m *DeptMutation) AddState(i int32)

AddState adds i to the "state" field.

func (*DeptMutation) AddedEdges

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

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

func (*DeptMutation) AddedField

func (m *DeptMutation) 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 (*DeptMutation) AddedFields

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

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

func (*DeptMutation) AddedIDs

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

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

func (*DeptMutation) AddedSort

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

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

func (*DeptMutation) AddedState

func (m *DeptMutation) AddedState() (r int32, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*DeptMutation) Ancestors

func (m *DeptMutation) Ancestors() (r []int, exists bool)

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

func (*DeptMutation) AncestorsCleared

func (m *DeptMutation) AncestorsCleared() bool

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

func (*DeptMutation) AppendAncestors

func (m *DeptMutation) AppendAncestors(i []int)

AppendAncestors adds i to the "ancestors" field.

func (*DeptMutation) AppendedAncestors

func (m *DeptMutation) AppendedAncestors() ([]int, bool)

AppendedAncestors returns the list of values that were appended to the "ancestors" field in this mutation.

func (*DeptMutation) ChildrenCleared

func (m *DeptMutation) ChildrenCleared() bool

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

func (*DeptMutation) ChildrenIDs

func (m *DeptMutation) ChildrenIDs() (ids []uint32)

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

func (*DeptMutation) ClearAncestors

func (m *DeptMutation) ClearAncestors()

ClearAncestors clears the value of the "ancestors" field.

func (*DeptMutation) ClearChildren

func (m *DeptMutation) ClearChildren()

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

func (*DeptMutation) ClearCreatedAt

func (m *DeptMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*DeptMutation) ClearDeletedAt

func (m *DeptMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DeptMutation) ClearEdge

func (m *DeptMutation) 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 (*DeptMutation) ClearField

func (m *DeptMutation) 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 (*DeptMutation) ClearParent

func (m *DeptMutation) ClearParent()

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

func (*DeptMutation) ClearParentID

func (m *DeptMutation) ClearParentID()

ClearParentID clears the value of the "parent_id" field.

func (*DeptMutation) ClearRemark

func (m *DeptMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*DeptMutation) ClearUpdatedAt

func (m *DeptMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DeptMutation) ClearedEdges

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

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

func (*DeptMutation) ClearedFields

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

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

func (DeptMutation) Client

func (m DeptMutation) 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 (*DeptMutation) CreatedAt

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

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

func (*DeptMutation) CreatedAtCleared

func (m *DeptMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*DeptMutation) DeletedAt

func (m *DeptMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*DeptMutation) DeletedAtCleared

func (m *DeptMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*DeptMutation) EdgeCleared

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

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

func (*DeptMutation) Field

func (m *DeptMutation) 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 (*DeptMutation) FieldCleared

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

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

func (*DeptMutation) Fields

func (m *DeptMutation) 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 (*DeptMutation) Filter

func (m *DeptMutation) Filter() *DeptFilter

Filter returns an entql.Where implementation to apply filters on the DeptMutation builder.

func (*DeptMutation) ID

func (m *DeptMutation) ID() (id uint32, 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 (*DeptMutation) IDs

func (m *DeptMutation) IDs(ctx context.Context) ([]uint32, 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 (*DeptMutation) Name

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

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

func (*DeptMutation) OldAncestors

func (m *DeptMutation) OldAncestors(ctx context.Context) (v []int, err error)

OldAncestors returns the old "ancestors" field's value of the Dept entity. If the Dept 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 (*DeptMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Dept entity. If the Dept 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 (*DeptMutation) OldDeletedAt

func (m *DeptMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Dept entity. If the Dept 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 (*DeptMutation) OldField

func (m *DeptMutation) 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 (*DeptMutation) OldName

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

OldName returns the old "name" field's value of the Dept entity. If the Dept 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 (*DeptMutation) OldParentID

func (m *DeptMutation) OldParentID(ctx context.Context) (v *uint32, err error)

OldParentID returns the old "parent_id" field's value of the Dept entity. If the Dept 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 (*DeptMutation) OldRemark

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

OldRemark returns the old "remark" field's value of the Dept entity. If the Dept 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 (*DeptMutation) OldSort

func (m *DeptMutation) OldSort(ctx context.Context) (v *int32, err error)

OldSort returns the old "sort" field's value of the Dept entity. If the Dept 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 (*DeptMutation) OldState

func (m *DeptMutation) OldState(ctx context.Context) (v *int32, err error)

OldState returns the old "state" field's value of the Dept entity. If the Dept 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 (*DeptMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Dept entity. If the Dept 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 (*DeptMutation) Op

func (m *DeptMutation) Op() Op

Op returns the operation name.

func (*DeptMutation) ParentCleared

func (m *DeptMutation) ParentCleared() bool

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

func (*DeptMutation) ParentID

func (m *DeptMutation) ParentID() (r uint32, exists bool)

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

func (*DeptMutation) ParentIDCleared

func (m *DeptMutation) ParentIDCleared() bool

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

func (*DeptMutation) ParentIDs

func (m *DeptMutation) ParentIDs() (ids []uint32)

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 (*DeptMutation) Remark

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

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

func (*DeptMutation) RemarkCleared

func (m *DeptMutation) RemarkCleared() bool

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

func (*DeptMutation) RemoveChildIDs

func (m *DeptMutation) RemoveChildIDs(ids ...uint32)

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

func (*DeptMutation) RemovedChildrenIDs

func (m *DeptMutation) RemovedChildrenIDs() (ids []uint32)

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

func (*DeptMutation) RemovedEdges

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

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

func (*DeptMutation) RemovedIDs

func (m *DeptMutation) 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 (*DeptMutation) ResetAncestors

func (m *DeptMutation) ResetAncestors()

ResetAncestors resets all changes to the "ancestors" field.

func (*DeptMutation) ResetChildren

func (m *DeptMutation) ResetChildren()

ResetChildren resets all changes to the "children" edge.

func (*DeptMutation) ResetCreatedAt

func (m *DeptMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*DeptMutation) ResetDeletedAt

func (m *DeptMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*DeptMutation) ResetEdge

func (m *DeptMutation) 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 (*DeptMutation) ResetField

func (m *DeptMutation) 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 (*DeptMutation) ResetName

func (m *DeptMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DeptMutation) ResetParent

func (m *DeptMutation) ResetParent()

ResetParent resets all changes to the "parent" edge.

func (*DeptMutation) ResetParentID

func (m *DeptMutation) ResetParentID()

ResetParentID resets all changes to the "parent_id" field.

func (*DeptMutation) ResetRemark

func (m *DeptMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*DeptMutation) ResetSort

func (m *DeptMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*DeptMutation) ResetState

func (m *DeptMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*DeptMutation) ResetUpdatedAt

func (m *DeptMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*DeptMutation) SetAncestors

func (m *DeptMutation) SetAncestors(i []int)

SetAncestors sets the "ancestors" field.

func (*DeptMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*DeptMutation) SetDeletedAt

func (m *DeptMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*DeptMutation) SetField

func (m *DeptMutation) 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 (*DeptMutation) SetID

func (m *DeptMutation) SetID(id uint32)

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

func (*DeptMutation) SetName

func (m *DeptMutation) SetName(s string)

SetName sets the "name" field.

func (*DeptMutation) SetOp

func (m *DeptMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DeptMutation) SetParentID

func (m *DeptMutation) SetParentID(u uint32)

SetParentID sets the "parent_id" field.

func (*DeptMutation) SetRemark

func (m *DeptMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*DeptMutation) SetSort

func (m *DeptMutation) SetSort(i int32)

SetSort sets the "sort" field.

func (*DeptMutation) SetState

func (m *DeptMutation) SetState(i int32)

SetState sets the "state" field.

func (*DeptMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*DeptMutation) Sort

func (m *DeptMutation) Sort() (r int32, exists bool)

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

func (*DeptMutation) State

func (m *DeptMutation) State() (r int32, exists bool)

State returns the value of the "state" field in the mutation.

func (DeptMutation) Tx

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

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

func (*DeptMutation) Type

func (m *DeptMutation) Type() string

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

func (*DeptMutation) UpdatedAt

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

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

func (*DeptMutation) UpdatedAtCleared

func (m *DeptMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*DeptMutation) Where

func (m *DeptMutation) Where(ps ...predicate.Dept)

Where appends a list predicates to the DeptMutation builder.

func (*DeptMutation) WhereP

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

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

type DeptQuery

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

DeptQuery is the builder for querying Dept entities.

func (*DeptQuery) Aggregate

func (dq *DeptQuery) Aggregate(fns ...AggregateFunc) *DeptSelect

Aggregate returns a DeptSelect configured with the given aggregations.

func (*DeptQuery) All

func (dq *DeptQuery) All(ctx context.Context) ([]*Dept, error)

All executes the query and returns a list of Depts.

func (*DeptQuery) AllX

func (dq *DeptQuery) AllX(ctx context.Context) []*Dept

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

func (*DeptQuery) Clone

func (dq *DeptQuery) Clone() *DeptQuery

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

func (*DeptQuery) Count

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

Count returns the count of the given query.

func (*DeptQuery) CountX

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

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

func (*DeptQuery) Exist

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

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

func (*DeptQuery) ExistX

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

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

func (*DeptQuery) Filter

func (dq *DeptQuery) Filter() *DeptFilter

Filter returns a Filter implementation to apply filters on the DeptQuery builder.

func (*DeptQuery) First

func (dq *DeptQuery) First(ctx context.Context) (*Dept, error)

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

func (*DeptQuery) FirstID

func (dq *DeptQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*DeptQuery) FirstIDX

func (dq *DeptQuery) FirstIDX(ctx context.Context) uint32

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

func (*DeptQuery) FirstX

func (dq *DeptQuery) FirstX(ctx context.Context) *Dept

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

func (*DeptQuery) GroupBy

func (dq *DeptQuery) GroupBy(field string, fields ...string) *DeptGroupBy

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.Dept.Query().
	GroupBy(dept.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DeptQuery) IDs

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

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

func (*DeptQuery) IDsX

func (dq *DeptQuery) IDsX(ctx context.Context) []uint32

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

func (*DeptQuery) Limit

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

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

func (*DeptQuery) Modify

func (dq *DeptQuery) Modify(modifiers ...func(s *sql.Selector)) *DeptSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*DeptQuery) Offset

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

Offset to start from.

func (*DeptQuery) Only

func (dq *DeptQuery) Only(ctx context.Context) (*Dept, error)

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

func (*DeptQuery) OnlyID

func (dq *DeptQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*DeptQuery) OnlyIDX

func (dq *DeptQuery) OnlyIDX(ctx context.Context) uint32

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

func (*DeptQuery) OnlyX

func (dq *DeptQuery) OnlyX(ctx context.Context) *Dept

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

func (*DeptQuery) Order

func (dq *DeptQuery) Order(o ...dept.OrderOption) *DeptQuery

Order specifies how the records should be ordered.

func (*DeptQuery) QueryChildren

func (dq *DeptQuery) QueryChildren() *DeptQuery

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

func (*DeptQuery) QueryParent

func (dq *DeptQuery) QueryParent() *DeptQuery

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

func (*DeptQuery) Select

func (dq *DeptQuery) Select(fields ...string) *DeptSelect

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.Dept.Query().
	Select(dept.FieldCreatedAt).
	Scan(ctx, &v)

func (*DeptQuery) Unique

func (dq *DeptQuery) Unique(unique bool) *DeptQuery

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 (*DeptQuery) Where

func (dq *DeptQuery) Where(ps ...predicate.Dept) *DeptQuery

Where adds a new predicate for the DeptQuery builder.

func (*DeptQuery) WithChildren

func (dq *DeptQuery) WithChildren(opts ...func(*DeptQuery)) *DeptQuery

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 (*DeptQuery) WithParent

func (dq *DeptQuery) WithParent(opts ...func(*DeptQuery)) *DeptQuery

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.

type DeptSelect

type DeptSelect struct {
	*DeptQuery
	// contains filtered or unexported fields
}

DeptSelect is the builder for selecting fields of Dept entities.

func (*DeptSelect) Aggregate

func (ds *DeptSelect) Aggregate(fns ...AggregateFunc) *DeptSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DeptSelect) Bool

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

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

func (*DeptSelect) BoolX

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

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

func (*DeptSelect) Bools

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

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

func (*DeptSelect) BoolsX

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

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

func (*DeptSelect) Float64

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

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

func (*DeptSelect) Float64X

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

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

func (*DeptSelect) Float64s

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

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

func (*DeptSelect) Float64sX

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

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

func (*DeptSelect) Int

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

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

func (*DeptSelect) IntX

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

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

func (*DeptSelect) Ints

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

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

func (*DeptSelect) IntsX

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

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

func (*DeptSelect) Modify

func (ds *DeptSelect) Modify(modifiers ...func(s *sql.Selector)) *DeptSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*DeptSelect) Scan

func (ds *DeptSelect) Scan(ctx context.Context, v any) error

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

func (*DeptSelect) ScanX

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

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

func (*DeptSelect) String

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

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

func (*DeptSelect) StringX

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

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

func (*DeptSelect) Strings

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

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

func (*DeptSelect) StringsX

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

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

type DeptUpdate

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

DeptUpdate is the builder for updating Dept entities.

func (*DeptUpdate) AddChildIDs

func (du *DeptUpdate) AddChildIDs(ids ...uint32) *DeptUpdate

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

func (*DeptUpdate) AddChildren

func (du *DeptUpdate) AddChildren(d ...*Dept) *DeptUpdate

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

func (*DeptUpdate) AddSort

func (du *DeptUpdate) AddSort(i int32) *DeptUpdate

AddSort adds i to the "sort" field.

func (*DeptUpdate) AddState

func (du *DeptUpdate) AddState(i int32) *DeptUpdate

AddState adds i to the "state" field.

func (*DeptUpdate) AppendAncestors

func (du *DeptUpdate) AppendAncestors(i []int) *DeptUpdate

AppendAncestors appends i to the "ancestors" field.

func (*DeptUpdate) ClearAncestors

func (du *DeptUpdate) ClearAncestors() *DeptUpdate

ClearAncestors clears the value of the "ancestors" field.

func (*DeptUpdate) ClearChildren

func (du *DeptUpdate) ClearChildren() *DeptUpdate

ClearChildren clears all "children" edges to the Dept entity.

func (*DeptUpdate) ClearDeletedAt

func (du *DeptUpdate) ClearDeletedAt() *DeptUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DeptUpdate) ClearParent

func (du *DeptUpdate) ClearParent() *DeptUpdate

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

func (*DeptUpdate) ClearParentID

func (du *DeptUpdate) ClearParentID() *DeptUpdate

ClearParentID clears the value of the "parent_id" field.

func (*DeptUpdate) ClearRemark

func (du *DeptUpdate) ClearRemark() *DeptUpdate

ClearRemark clears the value of the "remark" field.

func (*DeptUpdate) ClearUpdatedAt

func (du *DeptUpdate) ClearUpdatedAt() *DeptUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DeptUpdate) Exec

func (du *DeptUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DeptUpdate) ExecX

func (du *DeptUpdate) ExecX(ctx context.Context)

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

func (*DeptUpdate) Modify

func (du *DeptUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DeptUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*DeptUpdate) Mutation

func (du *DeptUpdate) Mutation() *DeptMutation

Mutation returns the DeptMutation object of the builder.

func (*DeptUpdate) RemoveChildIDs

func (du *DeptUpdate) RemoveChildIDs(ids ...uint32) *DeptUpdate

RemoveChildIDs removes the "children" edge to Dept entities by IDs.

func (*DeptUpdate) RemoveChildren

func (du *DeptUpdate) RemoveChildren(d ...*Dept) *DeptUpdate

RemoveChildren removes "children" edges to Dept entities.

func (*DeptUpdate) Save

func (du *DeptUpdate) Save(ctx context.Context) (int, error)

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

func (*DeptUpdate) SaveX

func (du *DeptUpdate) SaveX(ctx context.Context) int

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

func (*DeptUpdate) SetAncestors

func (du *DeptUpdate) SetAncestors(i []int) *DeptUpdate

SetAncestors sets the "ancestors" field.

func (*DeptUpdate) SetDeletedAt

func (du *DeptUpdate) SetDeletedAt(t time.Time) *DeptUpdate

SetDeletedAt sets the "deleted_at" field.

func (*DeptUpdate) SetName

func (du *DeptUpdate) SetName(s string) *DeptUpdate

SetName sets the "name" field.

func (*DeptUpdate) SetNillableDeletedAt

func (du *DeptUpdate) SetNillableDeletedAt(t *time.Time) *DeptUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*DeptUpdate) SetNillableName

func (du *DeptUpdate) SetNillableName(s *string) *DeptUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*DeptUpdate) SetNillableParentID

func (du *DeptUpdate) SetNillableParentID(u *uint32) *DeptUpdate

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

func (*DeptUpdate) SetNillableRemark

func (du *DeptUpdate) SetNillableRemark(s *string) *DeptUpdate

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

func (*DeptUpdate) SetNillableSort

func (du *DeptUpdate) SetNillableSort(i *int32) *DeptUpdate

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

func (*DeptUpdate) SetNillableState

func (du *DeptUpdate) SetNillableState(i *int32) *DeptUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*DeptUpdate) SetNillableUpdatedAt

func (du *DeptUpdate) SetNillableUpdatedAt(t *time.Time) *DeptUpdate

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

func (*DeptUpdate) SetParent

func (du *DeptUpdate) SetParent(d *Dept) *DeptUpdate

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

func (*DeptUpdate) SetParentID

func (du *DeptUpdate) SetParentID(u uint32) *DeptUpdate

SetParentID sets the "parent_id" field.

func (*DeptUpdate) SetRemark

func (du *DeptUpdate) SetRemark(s string) *DeptUpdate

SetRemark sets the "remark" field.

func (*DeptUpdate) SetSort

func (du *DeptUpdate) SetSort(i int32) *DeptUpdate

SetSort sets the "sort" field.

func (*DeptUpdate) SetState

func (du *DeptUpdate) SetState(i int32) *DeptUpdate

SetState sets the "state" field.

func (*DeptUpdate) SetUpdatedAt

func (du *DeptUpdate) SetUpdatedAt(t time.Time) *DeptUpdate

SetUpdatedAt sets the "updated_at" field.

func (*DeptUpdate) Where

func (du *DeptUpdate) Where(ps ...predicate.Dept) *DeptUpdate

Where appends a list predicates to the DeptUpdate builder.

type DeptUpdateOne

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

DeptUpdateOne is the builder for updating a single Dept entity.

func (*DeptUpdateOne) AddChildIDs

func (duo *DeptUpdateOne) AddChildIDs(ids ...uint32) *DeptUpdateOne

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

func (*DeptUpdateOne) AddChildren

func (duo *DeptUpdateOne) AddChildren(d ...*Dept) *DeptUpdateOne

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

func (*DeptUpdateOne) AddSort

func (duo *DeptUpdateOne) AddSort(i int32) *DeptUpdateOne

AddSort adds i to the "sort" field.

func (*DeptUpdateOne) AddState

func (duo *DeptUpdateOne) AddState(i int32) *DeptUpdateOne

AddState adds i to the "state" field.

func (*DeptUpdateOne) AppendAncestors

func (duo *DeptUpdateOne) AppendAncestors(i []int) *DeptUpdateOne

AppendAncestors appends i to the "ancestors" field.

func (*DeptUpdateOne) ClearAncestors

func (duo *DeptUpdateOne) ClearAncestors() *DeptUpdateOne

ClearAncestors clears the value of the "ancestors" field.

func (*DeptUpdateOne) ClearChildren

func (duo *DeptUpdateOne) ClearChildren() *DeptUpdateOne

ClearChildren clears all "children" edges to the Dept entity.

func (*DeptUpdateOne) ClearDeletedAt

func (duo *DeptUpdateOne) ClearDeletedAt() *DeptUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DeptUpdateOne) ClearParent

func (duo *DeptUpdateOne) ClearParent() *DeptUpdateOne

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

func (*DeptUpdateOne) ClearParentID

func (duo *DeptUpdateOne) ClearParentID() *DeptUpdateOne

ClearParentID clears the value of the "parent_id" field.

func (*DeptUpdateOne) ClearRemark

func (duo *DeptUpdateOne) ClearRemark() *DeptUpdateOne

ClearRemark clears the value of the "remark" field.

func (*DeptUpdateOne) ClearUpdatedAt

func (duo *DeptUpdateOne) ClearUpdatedAt() *DeptUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DeptUpdateOne) Exec

func (duo *DeptUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DeptUpdateOne) ExecX

func (duo *DeptUpdateOne) ExecX(ctx context.Context)

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

func (*DeptUpdateOne) Modify

func (duo *DeptUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *DeptUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*DeptUpdateOne) Mutation

func (duo *DeptUpdateOne) Mutation() *DeptMutation

Mutation returns the DeptMutation object of the builder.

func (*DeptUpdateOne) RemoveChildIDs

func (duo *DeptUpdateOne) RemoveChildIDs(ids ...uint32) *DeptUpdateOne

RemoveChildIDs removes the "children" edge to Dept entities by IDs.

func (*DeptUpdateOne) RemoveChildren

func (duo *DeptUpdateOne) RemoveChildren(d ...*Dept) *DeptUpdateOne

RemoveChildren removes "children" edges to Dept entities.

func (*DeptUpdateOne) Save

func (duo *DeptUpdateOne) Save(ctx context.Context) (*Dept, error)

Save executes the query and returns the updated Dept entity.

func (*DeptUpdateOne) SaveX

func (duo *DeptUpdateOne) SaveX(ctx context.Context) *Dept

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

func (*DeptUpdateOne) Select

func (duo *DeptUpdateOne) Select(field string, fields ...string) *DeptUpdateOne

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

func (*DeptUpdateOne) SetAncestors

func (duo *DeptUpdateOne) SetAncestors(i []int) *DeptUpdateOne

SetAncestors sets the "ancestors" field.

func (*DeptUpdateOne) SetDeletedAt

func (duo *DeptUpdateOne) SetDeletedAt(t time.Time) *DeptUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*DeptUpdateOne) SetName

func (duo *DeptUpdateOne) SetName(s string) *DeptUpdateOne

SetName sets the "name" field.

func (*DeptUpdateOne) SetNillableDeletedAt

func (duo *DeptUpdateOne) SetNillableDeletedAt(t *time.Time) *DeptUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*DeptUpdateOne) SetNillableName

func (duo *DeptUpdateOne) SetNillableName(s *string) *DeptUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*DeptUpdateOne) SetNillableParentID

func (duo *DeptUpdateOne) SetNillableParentID(u *uint32) *DeptUpdateOne

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

func (*DeptUpdateOne) SetNillableRemark

func (duo *DeptUpdateOne) SetNillableRemark(s *string) *DeptUpdateOne

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

func (*DeptUpdateOne) SetNillableSort

func (duo *DeptUpdateOne) SetNillableSort(i *int32) *DeptUpdateOne

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

func (*DeptUpdateOne) SetNillableState

func (duo *DeptUpdateOne) SetNillableState(i *int32) *DeptUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*DeptUpdateOne) SetNillableUpdatedAt

func (duo *DeptUpdateOne) SetNillableUpdatedAt(t *time.Time) *DeptUpdateOne

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

func (*DeptUpdateOne) SetParent

func (duo *DeptUpdateOne) SetParent(d *Dept) *DeptUpdateOne

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

func (*DeptUpdateOne) SetParentID

func (duo *DeptUpdateOne) SetParentID(u uint32) *DeptUpdateOne

SetParentID sets the "parent_id" field.

func (*DeptUpdateOne) SetRemark

func (duo *DeptUpdateOne) SetRemark(s string) *DeptUpdateOne

SetRemark sets the "remark" field.

func (*DeptUpdateOne) SetSort

func (duo *DeptUpdateOne) SetSort(i int32) *DeptUpdateOne

SetSort sets the "sort" field.

func (*DeptUpdateOne) SetState

func (duo *DeptUpdateOne) SetState(i int32) *DeptUpdateOne

SetState sets the "state" field.

func (*DeptUpdateOne) SetUpdatedAt

func (duo *DeptUpdateOne) SetUpdatedAt(t time.Time) *DeptUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*DeptUpdateOne) Where

func (duo *DeptUpdateOne) Where(ps ...predicate.Dept) *DeptUpdateOne

Where appends a list predicates to the DeptUpdate builder.

type DeptUpsert

type DeptUpsert struct {
	*sql.UpdateSet
}

DeptUpsert is the "OnConflict" setter.

func (*DeptUpsert) AddSort

func (u *DeptUpsert) AddSort(v int32) *DeptUpsert

AddSort adds v to the "sort" field.

func (*DeptUpsert) AddState

func (u *DeptUpsert) AddState(v int32) *DeptUpsert

AddState adds v to the "state" field.

func (*DeptUpsert) ClearAncestors

func (u *DeptUpsert) ClearAncestors() *DeptUpsert

ClearAncestors clears the value of the "ancestors" field.

func (*DeptUpsert) ClearDeletedAt

func (u *DeptUpsert) ClearDeletedAt() *DeptUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DeptUpsert) ClearParentID

func (u *DeptUpsert) ClearParentID() *DeptUpsert

ClearParentID clears the value of the "parent_id" field.

func (*DeptUpsert) ClearRemark

func (u *DeptUpsert) ClearRemark() *DeptUpsert

ClearRemark clears the value of the "remark" field.

func (*DeptUpsert) ClearUpdatedAt

func (u *DeptUpsert) ClearUpdatedAt() *DeptUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DeptUpsert) SetAncestors

func (u *DeptUpsert) SetAncestors(v []int) *DeptUpsert

SetAncestors sets the "ancestors" field.

func (*DeptUpsert) SetDeletedAt

func (u *DeptUpsert) SetDeletedAt(v time.Time) *DeptUpsert

SetDeletedAt sets the "deleted_at" field.

func (*DeptUpsert) SetName

func (u *DeptUpsert) SetName(v string) *DeptUpsert

SetName sets the "name" field.

func (*DeptUpsert) SetParentID

func (u *DeptUpsert) SetParentID(v uint32) *DeptUpsert

SetParentID sets the "parent_id" field.

func (*DeptUpsert) SetRemark

func (u *DeptUpsert) SetRemark(v string) *DeptUpsert

SetRemark sets the "remark" field.

func (*DeptUpsert) SetSort

func (u *DeptUpsert) SetSort(v int32) *DeptUpsert

SetSort sets the "sort" field.

func (*DeptUpsert) SetState

func (u *DeptUpsert) SetState(v int32) *DeptUpsert

SetState sets the "state" field.

func (*DeptUpsert) SetUpdatedAt

func (u *DeptUpsert) SetUpdatedAt(v time.Time) *DeptUpsert

SetUpdatedAt sets the "updated_at" field.

func (*DeptUpsert) UpdateAncestors

func (u *DeptUpsert) UpdateAncestors() *DeptUpsert

UpdateAncestors sets the "ancestors" field to the value that was provided on create.

func (*DeptUpsert) UpdateDeletedAt

func (u *DeptUpsert) UpdateDeletedAt() *DeptUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*DeptUpsert) UpdateName

func (u *DeptUpsert) UpdateName() *DeptUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*DeptUpsert) UpdateParentID

func (u *DeptUpsert) UpdateParentID() *DeptUpsert

UpdateParentID sets the "parent_id" field to the value that was provided on create.

func (*DeptUpsert) UpdateRemark

func (u *DeptUpsert) UpdateRemark() *DeptUpsert

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*DeptUpsert) UpdateSort

func (u *DeptUpsert) UpdateSort() *DeptUpsert

UpdateSort sets the "sort" field to the value that was provided on create.

func (*DeptUpsert) UpdateState

func (u *DeptUpsert) UpdateState() *DeptUpsert

UpdateState sets the "state" field to the value that was provided on create.

func (*DeptUpsert) UpdateUpdatedAt

func (u *DeptUpsert) UpdateUpdatedAt() *DeptUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type DeptUpsertBulk

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

DeptUpsertBulk is the builder for "upsert"-ing a bulk of Dept nodes.

func (*DeptUpsertBulk) AddSort

func (u *DeptUpsertBulk) AddSort(v int32) *DeptUpsertBulk

AddSort adds v to the "sort" field.

func (*DeptUpsertBulk) AddState

func (u *DeptUpsertBulk) AddState(v int32) *DeptUpsertBulk

AddState adds v to the "state" field.

func (*DeptUpsertBulk) ClearAncestors

func (u *DeptUpsertBulk) ClearAncestors() *DeptUpsertBulk

ClearAncestors clears the value of the "ancestors" field.

func (*DeptUpsertBulk) ClearDeletedAt

func (u *DeptUpsertBulk) ClearDeletedAt() *DeptUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DeptUpsertBulk) ClearParentID

func (u *DeptUpsertBulk) ClearParentID() *DeptUpsertBulk

ClearParentID clears the value of the "parent_id" field.

func (*DeptUpsertBulk) ClearRemark

func (u *DeptUpsertBulk) ClearRemark() *DeptUpsertBulk

ClearRemark clears the value of the "remark" field.

func (*DeptUpsertBulk) ClearUpdatedAt

func (u *DeptUpsertBulk) ClearUpdatedAt() *DeptUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DeptUpsertBulk) DoNothing

func (u *DeptUpsertBulk) DoNothing() *DeptUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DeptUpsertBulk) Exec

func (u *DeptUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DeptUpsertBulk) ExecX

func (u *DeptUpsertBulk) ExecX(ctx context.Context)

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

func (*DeptUpsertBulk) Ignore

func (u *DeptUpsertBulk) Ignore() *DeptUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Dept.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*DeptUpsertBulk) SetAncestors

func (u *DeptUpsertBulk) SetAncestors(v []int) *DeptUpsertBulk

SetAncestors sets the "ancestors" field.

func (*DeptUpsertBulk) SetDeletedAt

func (u *DeptUpsertBulk) SetDeletedAt(v time.Time) *DeptUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*DeptUpsertBulk) SetName

func (u *DeptUpsertBulk) SetName(v string) *DeptUpsertBulk

SetName sets the "name" field.

func (*DeptUpsertBulk) SetParentID

func (u *DeptUpsertBulk) SetParentID(v uint32) *DeptUpsertBulk

SetParentID sets the "parent_id" field.

func (*DeptUpsertBulk) SetRemark

func (u *DeptUpsertBulk) SetRemark(v string) *DeptUpsertBulk

SetRemark sets the "remark" field.

func (*DeptUpsertBulk) SetSort

func (u *DeptUpsertBulk) SetSort(v int32) *DeptUpsertBulk

SetSort sets the "sort" field.

func (*DeptUpsertBulk) SetState

func (u *DeptUpsertBulk) SetState(v int32) *DeptUpsertBulk

SetState sets the "state" field.

func (*DeptUpsertBulk) SetUpdatedAt

func (u *DeptUpsertBulk) SetUpdatedAt(v time.Time) *DeptUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*DeptUpsertBulk) Update

func (u *DeptUpsertBulk) Update(set func(*DeptUpsert)) *DeptUpsertBulk

Update allows overriding fields `UPDATE` values. See the DeptCreateBulk.OnConflict documentation for more info.

func (*DeptUpsertBulk) UpdateAncestors

func (u *DeptUpsertBulk) UpdateAncestors() *DeptUpsertBulk

UpdateAncestors sets the "ancestors" field to the value that was provided on create.

func (*DeptUpsertBulk) UpdateDeletedAt

func (u *DeptUpsertBulk) UpdateDeletedAt() *DeptUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*DeptUpsertBulk) UpdateName

func (u *DeptUpsertBulk) UpdateName() *DeptUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*DeptUpsertBulk) UpdateNewValues

func (u *DeptUpsertBulk) UpdateNewValues() *DeptUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Dept.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(dept.FieldID)
		}),
	).
	Exec(ctx)

func (*DeptUpsertBulk) UpdateParentID

func (u *DeptUpsertBulk) UpdateParentID() *DeptUpsertBulk

UpdateParentID sets the "parent_id" field to the value that was provided on create.

func (*DeptUpsertBulk) UpdateRemark

func (u *DeptUpsertBulk) UpdateRemark() *DeptUpsertBulk

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*DeptUpsertBulk) UpdateSort

func (u *DeptUpsertBulk) UpdateSort() *DeptUpsertBulk

UpdateSort sets the "sort" field to the value that was provided on create.

func (*DeptUpsertBulk) UpdateState

func (u *DeptUpsertBulk) UpdateState() *DeptUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

func (*DeptUpsertBulk) UpdateUpdatedAt

func (u *DeptUpsertBulk) UpdateUpdatedAt() *DeptUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type DeptUpsertOne

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

DeptUpsertOne is the builder for "upsert"-ing

one Dept node.

func (*DeptUpsertOne) AddSort

func (u *DeptUpsertOne) AddSort(v int32) *DeptUpsertOne

AddSort adds v to the "sort" field.

func (*DeptUpsertOne) AddState

func (u *DeptUpsertOne) AddState(v int32) *DeptUpsertOne

AddState adds v to the "state" field.

func (*DeptUpsertOne) ClearAncestors

func (u *DeptUpsertOne) ClearAncestors() *DeptUpsertOne

ClearAncestors clears the value of the "ancestors" field.

func (*DeptUpsertOne) ClearDeletedAt

func (u *DeptUpsertOne) ClearDeletedAt() *DeptUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*DeptUpsertOne) ClearParentID

func (u *DeptUpsertOne) ClearParentID() *DeptUpsertOne

ClearParentID clears the value of the "parent_id" field.

func (*DeptUpsertOne) ClearRemark

func (u *DeptUpsertOne) ClearRemark() *DeptUpsertOne

ClearRemark clears the value of the "remark" field.

func (*DeptUpsertOne) ClearUpdatedAt

func (u *DeptUpsertOne) ClearUpdatedAt() *DeptUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*DeptUpsertOne) DoNothing

func (u *DeptUpsertOne) DoNothing() *DeptUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*DeptUpsertOne) Exec

func (u *DeptUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*DeptUpsertOne) ExecX

func (u *DeptUpsertOne) ExecX(ctx context.Context)

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

func (*DeptUpsertOne) ID

func (u *DeptUpsertOne) ID(ctx context.Context) (id uint32, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*DeptUpsertOne) IDX

func (u *DeptUpsertOne) IDX(ctx context.Context) uint32

IDX is like ID, but panics if an error occurs.

func (*DeptUpsertOne) Ignore

func (u *DeptUpsertOne) Ignore() *DeptUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Dept.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*DeptUpsertOne) SetAncestors

func (u *DeptUpsertOne) SetAncestors(v []int) *DeptUpsertOne

SetAncestors sets the "ancestors" field.

func (*DeptUpsertOne) SetDeletedAt

func (u *DeptUpsertOne) SetDeletedAt(v time.Time) *DeptUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*DeptUpsertOne) SetName

func (u *DeptUpsertOne) SetName(v string) *DeptUpsertOne

SetName sets the "name" field.

func (*DeptUpsertOne) SetParentID

func (u *DeptUpsertOne) SetParentID(v uint32) *DeptUpsertOne

SetParentID sets the "parent_id" field.

func (*DeptUpsertOne) SetRemark

func (u *DeptUpsertOne) SetRemark(v string) *DeptUpsertOne

SetRemark sets the "remark" field.

func (*DeptUpsertOne) SetSort

func (u *DeptUpsertOne) SetSort(v int32) *DeptUpsertOne

SetSort sets the "sort" field.

func (*DeptUpsertOne) SetState

func (u *DeptUpsertOne) SetState(v int32) *DeptUpsertOne

SetState sets the "state" field.

func (*DeptUpsertOne) SetUpdatedAt

func (u *DeptUpsertOne) SetUpdatedAt(v time.Time) *DeptUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*DeptUpsertOne) Update

func (u *DeptUpsertOne) Update(set func(*DeptUpsert)) *DeptUpsertOne

Update allows overriding fields `UPDATE` values. See the DeptCreate.OnConflict documentation for more info.

func (*DeptUpsertOne) UpdateAncestors

func (u *DeptUpsertOne) UpdateAncestors() *DeptUpsertOne

UpdateAncestors sets the "ancestors" field to the value that was provided on create.

func (*DeptUpsertOne) UpdateDeletedAt

func (u *DeptUpsertOne) UpdateDeletedAt() *DeptUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*DeptUpsertOne) UpdateName

func (u *DeptUpsertOne) UpdateName() *DeptUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*DeptUpsertOne) UpdateNewValues

func (u *DeptUpsertOne) UpdateNewValues() *DeptUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Dept.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(dept.FieldID)
		}),
	).
	Exec(ctx)

func (*DeptUpsertOne) UpdateParentID

func (u *DeptUpsertOne) UpdateParentID() *DeptUpsertOne

UpdateParentID sets the "parent_id" field to the value that was provided on create.

func (*DeptUpsertOne) UpdateRemark

func (u *DeptUpsertOne) UpdateRemark() *DeptUpsertOne

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*DeptUpsertOne) UpdateSort

func (u *DeptUpsertOne) UpdateSort() *DeptUpsertOne

UpdateSort sets the "sort" field to the value that was provided on create.

func (*DeptUpsertOne) UpdateState

func (u *DeptUpsertOne) UpdateState() *DeptUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

func (*DeptUpsertOne) UpdateUpdatedAt

func (u *DeptUpsertOne) UpdateUpdatedAt() *DeptUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Depts

type Depts []*Dept

Depts is a parsable slice of Dept.

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 Member

type Member struct {

	// ID of the ent.
	// id
	ID uint32 `json:"id,omitempty"`
	// 创建时间
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// 更新时间
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// 删除时间
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// 备注
	Remark *string `json:"remark,omitempty"`
	// 排序
	Sort *int32 `json:"sort,omitempty"`
	// 状态 0 UNSPECIFIED 开启 1 -> ACTIVE 关闭 2 -> INACTIVE, 禁用 3 -> BANNED
	State *int32 `json:"state,omitempty"`
	// 会员名
	Username string `json:"username,omitempty"`
	// 密码
	Password string `json:"password,omitempty"`
	// 昵称
	Nickname string `json:"nickname,omitempty"`
	// 手机号
	Phone string `json:"phone,omitempty"`
	// 电子邮箱
	Email string `json:"email,omitempty"`
	// 头像
	Avatar string `json:"avatar,omitempty"`
	// 个人说明
	Description string `json:"description,omitempty"`
	// contains filtered or unexported fields
}

会员表

func (*Member) String

func (m *Member) String() string

String implements the fmt.Stringer.

func (*Member) Unwrap

func (m *Member) Unwrap() *Member

Unwrap unwraps the Member 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 (*Member) Update

func (m *Member) Update() *MemberUpdateOne

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

func (*Member) Value

func (m *Member) Value(name string) (ent.Value, error)

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

type MemberClient

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

MemberClient is a client for the Member schema.

func NewMemberClient

func NewMemberClient(c config) *MemberClient

NewMemberClient returns a client for the Member from the given config.

func (*MemberClient) Create

func (c *MemberClient) Create() *MemberCreate

Create returns a builder for creating a Member entity.

func (*MemberClient) CreateBulk

func (c *MemberClient) CreateBulk(builders ...*MemberCreate) *MemberCreateBulk

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

func (*MemberClient) Delete

func (c *MemberClient) Delete() *MemberDelete

Delete returns a delete builder for Member.

func (*MemberClient) DeleteOne

func (c *MemberClient) DeleteOne(m *Member) *MemberDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MemberClient) DeleteOneID

func (c *MemberClient) DeleteOneID(id uint32) *MemberDeleteOne

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

func (*MemberClient) Get

func (c *MemberClient) Get(ctx context.Context, id uint32) (*Member, error)

Get returns a Member entity by its id.

func (*MemberClient) GetX

func (c *MemberClient) GetX(ctx context.Context, id uint32) *Member

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

func (*MemberClient) Hooks

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

Hooks returns the client hooks.

func (*MemberClient) Intercept

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

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

func (*MemberClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MemberClient) MapCreateBulk

func (c *MemberClient) MapCreateBulk(slice any, setFunc func(*MemberCreate, int)) *MemberCreateBulk

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 (*MemberClient) Query

func (c *MemberClient) Query() *MemberQuery

Query returns a query builder for Member.

func (*MemberClient) Update

func (c *MemberClient) Update() *MemberUpdate

Update returns an update builder for Member.

func (*MemberClient) UpdateOne

func (c *MemberClient) UpdateOne(m *Member) *MemberUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MemberClient) UpdateOneID

func (c *MemberClient) UpdateOneID(id uint32) *MemberUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MemberClient) Use

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

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

type MemberCreate

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

MemberCreate is the builder for creating a Member entity.

func (*MemberCreate) Exec

func (mc *MemberCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberCreate) ExecX

func (mc *MemberCreate) ExecX(ctx context.Context)

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

func (*MemberCreate) Mutation

func (mc *MemberCreate) Mutation() *MemberMutation

Mutation returns the MemberMutation object of the builder.

func (*MemberCreate) OnConflict

func (mc *MemberCreate) OnConflict(opts ...sql.ConflictOption) *MemberUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Member.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.MemberUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*MemberCreate) OnConflictColumns

func (mc *MemberCreate) OnConflictColumns(columns ...string) *MemberUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Member.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*MemberCreate) Save

func (mc *MemberCreate) Save(ctx context.Context) (*Member, error)

Save creates the Member in the database.

func (*MemberCreate) SaveX

func (mc *MemberCreate) SaveX(ctx context.Context) *Member

SaveX calls Save and panics if Save returns an error.

func (*MemberCreate) SetAvatar

func (mc *MemberCreate) SetAvatar(s string) *MemberCreate

SetAvatar sets the "avatar" field.

func (*MemberCreate) SetCreatedAt

func (mc *MemberCreate) SetCreatedAt(t time.Time) *MemberCreate

SetCreatedAt sets the "created_at" field.

func (*MemberCreate) SetDeletedAt

func (mc *MemberCreate) SetDeletedAt(t time.Time) *MemberCreate

SetDeletedAt sets the "deleted_at" field.

func (*MemberCreate) SetDescription

func (mc *MemberCreate) SetDescription(s string) *MemberCreate

SetDescription sets the "description" field.

func (*MemberCreate) SetEmail

func (mc *MemberCreate) SetEmail(s string) *MemberCreate

SetEmail sets the "email" field.

func (*MemberCreate) SetID

func (mc *MemberCreate) SetID(u uint32) *MemberCreate

SetID sets the "id" field.

func (*MemberCreate) SetNickname

func (mc *MemberCreate) SetNickname(s string) *MemberCreate

SetNickname sets the "nickname" field.

func (*MemberCreate) SetNillableAvatar

func (mc *MemberCreate) SetNillableAvatar(s *string) *MemberCreate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*MemberCreate) SetNillableCreatedAt

func (mc *MemberCreate) SetNillableCreatedAt(t *time.Time) *MemberCreate

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

func (*MemberCreate) SetNillableDeletedAt

func (mc *MemberCreate) SetNillableDeletedAt(t *time.Time) *MemberCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MemberCreate) SetNillableDescription

func (mc *MemberCreate) SetNillableDescription(s *string) *MemberCreate

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

func (*MemberCreate) SetNillableEmail

func (mc *MemberCreate) SetNillableEmail(s *string) *MemberCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*MemberCreate) SetNillableNickname

func (mc *MemberCreate) SetNillableNickname(s *string) *MemberCreate

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*MemberCreate) SetNillablePassword

func (mc *MemberCreate) SetNillablePassword(s *string) *MemberCreate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*MemberCreate) SetNillableRemark

func (mc *MemberCreate) SetNillableRemark(s *string) *MemberCreate

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

func (*MemberCreate) SetNillableSort

func (mc *MemberCreate) SetNillableSort(i *int32) *MemberCreate

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

func (*MemberCreate) SetNillableState

func (mc *MemberCreate) SetNillableState(i *int32) *MemberCreate

SetNillableState sets the "state" field if the given value is not nil.

func (*MemberCreate) SetNillableUpdatedAt

func (mc *MemberCreate) SetNillableUpdatedAt(t *time.Time) *MemberCreate

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

func (*MemberCreate) SetPassword

func (mc *MemberCreate) SetPassword(s string) *MemberCreate

SetPassword sets the "password" field.

func (*MemberCreate) SetPhone

func (mc *MemberCreate) SetPhone(s string) *MemberCreate

SetPhone sets the "phone" field.

func (*MemberCreate) SetRemark

func (mc *MemberCreate) SetRemark(s string) *MemberCreate

SetRemark sets the "remark" field.

func (*MemberCreate) SetSort

func (mc *MemberCreate) SetSort(i int32) *MemberCreate

SetSort sets the "sort" field.

func (*MemberCreate) SetState

func (mc *MemberCreate) SetState(i int32) *MemberCreate

SetState sets the "state" field.

func (*MemberCreate) SetUpdatedAt

func (mc *MemberCreate) SetUpdatedAt(t time.Time) *MemberCreate

SetUpdatedAt sets the "updated_at" field.

func (*MemberCreate) SetUsername

func (mc *MemberCreate) SetUsername(s string) *MemberCreate

SetUsername sets the "username" field.

type MemberCreateBulk

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

MemberCreateBulk is the builder for creating many Member entities in bulk.

func (*MemberCreateBulk) Exec

func (mcb *MemberCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberCreateBulk) ExecX

func (mcb *MemberCreateBulk) ExecX(ctx context.Context)

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

func (*MemberCreateBulk) OnConflict

func (mcb *MemberCreateBulk) OnConflict(opts ...sql.ConflictOption) *MemberUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Member.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.MemberUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*MemberCreateBulk) OnConflictColumns

func (mcb *MemberCreateBulk) OnConflictColumns(columns ...string) *MemberUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Member.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*MemberCreateBulk) Save

func (mcb *MemberCreateBulk) Save(ctx context.Context) ([]*Member, error)

Save creates the Member entities in the database.

func (*MemberCreateBulk) SaveX

func (mcb *MemberCreateBulk) SaveX(ctx context.Context) []*Member

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

type MemberDelete

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

MemberDelete is the builder for deleting a Member entity.

func (*MemberDelete) Exec

func (md *MemberDelete) Exec(ctx context.Context) (int, error)

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

func (*MemberDelete) ExecX

func (md *MemberDelete) ExecX(ctx context.Context) int

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

func (*MemberDelete) Where

func (md *MemberDelete) Where(ps ...predicate.Member) *MemberDelete

Where appends a list predicates to the MemberDelete builder.

type MemberDeleteOne

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

MemberDeleteOne is the builder for deleting a single Member entity.

func (*MemberDeleteOne) Exec

func (mdo *MemberDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MemberDeleteOne) ExecX

func (mdo *MemberDeleteOne) ExecX(ctx context.Context)

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

func (*MemberDeleteOne) Where

func (mdo *MemberDeleteOne) Where(ps ...predicate.Member) *MemberDeleteOne

Where appends a list predicates to the MemberDelete builder.

type MemberFilter

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

MemberFilter provides a generic filtering capability at runtime for MemberQuery.

func (*MemberFilter) Where

func (f *MemberFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*MemberFilter) WhereAvatar

func (f *MemberFilter) WhereAvatar(p entql.StringP)

WhereAvatar applies the entql string predicate on the avatar field.

func (*MemberFilter) WhereCreatedAt

func (f *MemberFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*MemberFilter) WhereDeletedAt

func (f *MemberFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*MemberFilter) WhereDescription

func (f *MemberFilter) WhereDescription(p entql.StringP)

WhereDescription applies the entql string predicate on the description field.

func (*MemberFilter) WhereEmail

func (f *MemberFilter) WhereEmail(p entql.StringP)

WhereEmail applies the entql string predicate on the email field.

func (*MemberFilter) WhereID

func (f *MemberFilter) WhereID(p entql.Uint32P)

WhereID applies the entql uint32 predicate on the id field.

func (*MemberFilter) WhereNickname

func (f *MemberFilter) WhereNickname(p entql.StringP)

WhereNickname applies the entql string predicate on the nickname field.

func (*MemberFilter) WherePassword

func (f *MemberFilter) WherePassword(p entql.StringP)

WherePassword applies the entql string predicate on the password field.

func (*MemberFilter) WherePhone

func (f *MemberFilter) WherePhone(p entql.StringP)

WherePhone applies the entql string predicate on the phone field.

func (*MemberFilter) WhereRemark

func (f *MemberFilter) WhereRemark(p entql.StringP)

WhereRemark applies the entql string predicate on the remark field.

func (*MemberFilter) WhereSort

func (f *MemberFilter) WhereSort(p entql.Int32P)

WhereSort applies the entql int32 predicate on the sort field.

func (*MemberFilter) WhereState

func (f *MemberFilter) WhereState(p entql.Int32P)

WhereState applies the entql int32 predicate on the state field.

func (*MemberFilter) WhereUpdatedAt

func (f *MemberFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

func (*MemberFilter) WhereUsername

func (f *MemberFilter) WhereUsername(p entql.StringP)

WhereUsername applies the entql string predicate on the username field.

type MemberGroupBy

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

MemberGroupBy is the group-by builder for Member entities.

func (*MemberGroupBy) Aggregate

func (mgb *MemberGroupBy) Aggregate(fns ...AggregateFunc) *MemberGroupBy

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

func (*MemberGroupBy) Bool

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

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

func (*MemberGroupBy) BoolX

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

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

func (*MemberGroupBy) Bools

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

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

func (*MemberGroupBy) BoolsX

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

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

func (*MemberGroupBy) Float64

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

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

func (*MemberGroupBy) Float64X

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

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

func (*MemberGroupBy) Float64s

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

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

func (*MemberGroupBy) Float64sX

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

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

func (*MemberGroupBy) Int

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

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

func (*MemberGroupBy) IntX

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

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

func (*MemberGroupBy) Ints

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

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

func (*MemberGroupBy) IntsX

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

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

func (*MemberGroupBy) Scan

func (mgb *MemberGroupBy) Scan(ctx context.Context, v any) error

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

func (*MemberGroupBy) ScanX

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

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

func (*MemberGroupBy) String

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

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

func (*MemberGroupBy) StringX

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

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

func (*MemberGroupBy) Strings

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

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

func (*MemberGroupBy) StringsX

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

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

type MemberMutation

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

MemberMutation represents an operation that mutates the Member nodes in the graph.

func (*MemberMutation) AddField

func (m *MemberMutation) 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 (*MemberMutation) AddSort

func (m *MemberMutation) AddSort(i int32)

AddSort adds i to the "sort" field.

func (*MemberMutation) AddState

func (m *MemberMutation) AddState(i int32)

AddState adds i to the "state" field.

func (*MemberMutation) AddedEdges

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

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

func (*MemberMutation) AddedField

func (m *MemberMutation) 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 (*MemberMutation) AddedFields

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

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

func (*MemberMutation) AddedIDs

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

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

func (*MemberMutation) AddedSort

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

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

func (*MemberMutation) AddedState

func (m *MemberMutation) AddedState() (r int32, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*MemberMutation) Avatar

func (m *MemberMutation) Avatar() (r string, exists bool)

Avatar returns the value of the "avatar" field in the mutation.

func (*MemberMutation) ClearCreatedAt

func (m *MemberMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*MemberMutation) ClearDeletedAt

func (m *MemberMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MemberMutation) ClearEdge

func (m *MemberMutation) 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 (*MemberMutation) ClearField

func (m *MemberMutation) 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 (*MemberMutation) ClearRemark

func (m *MemberMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*MemberMutation) ClearUpdatedAt

func (m *MemberMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MemberMutation) ClearedEdges

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

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

func (*MemberMutation) ClearedFields

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

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

func (MemberMutation) Client

func (m MemberMutation) 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 (*MemberMutation) CreatedAt

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

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

func (*MemberMutation) CreatedAtCleared

func (m *MemberMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*MemberMutation) DeletedAt

func (m *MemberMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*MemberMutation) DeletedAtCleared

func (m *MemberMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*MemberMutation) Description

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

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

func (*MemberMutation) EdgeCleared

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

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

func (*MemberMutation) Email

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

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

func (*MemberMutation) Field

func (m *MemberMutation) 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 (*MemberMutation) FieldCleared

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

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

func (*MemberMutation) Fields

func (m *MemberMutation) 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 (*MemberMutation) Filter

func (m *MemberMutation) Filter() *MemberFilter

Filter returns an entql.Where implementation to apply filters on the MemberMutation builder.

func (*MemberMutation) ID

func (m *MemberMutation) ID() (id uint32, 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 (*MemberMutation) IDs

func (m *MemberMutation) IDs(ctx context.Context) ([]uint32, 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 (*MemberMutation) Nickname

func (m *MemberMutation) Nickname() (r string, exists bool)

Nickname returns the value of the "nickname" field in the mutation.

func (*MemberMutation) OldAvatar

func (m *MemberMutation) OldAvatar(ctx context.Context) (v string, err error)

OldAvatar returns the old "avatar" field's value of the Member entity. If the Member 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 (*MemberMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Member entity. If the Member 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 (*MemberMutation) OldDeletedAt

func (m *MemberMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Member entity. If the Member 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 (*MemberMutation) OldDescription

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

OldDescription returns the old "description" field's value of the Member entity. If the Member 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 (*MemberMutation) OldEmail

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

OldEmail returns the old "email" field's value of the Member entity. If the Member 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 (*MemberMutation) OldField

func (m *MemberMutation) 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 (*MemberMutation) OldNickname

func (m *MemberMutation) OldNickname(ctx context.Context) (v string, err error)

OldNickname returns the old "nickname" field's value of the Member entity. If the Member 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 (*MemberMutation) OldPassword

func (m *MemberMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the Member entity. If the Member 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 (*MemberMutation) OldPhone

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

OldPhone returns the old "phone" field's value of the Member entity. If the Member 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 (*MemberMutation) OldRemark

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

OldRemark returns the old "remark" field's value of the Member entity. If the Member 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 (*MemberMutation) OldSort

func (m *MemberMutation) OldSort(ctx context.Context) (v *int32, err error)

OldSort returns the old "sort" field's value of the Member entity. If the Member 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 (*MemberMutation) OldState

func (m *MemberMutation) OldState(ctx context.Context) (v *int32, err error)

OldState returns the old "state" field's value of the Member entity. If the Member 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 (*MemberMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Member entity. If the Member 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 (*MemberMutation) OldUsername

func (m *MemberMutation) OldUsername(ctx context.Context) (v string, err error)

OldUsername returns the old "username" field's value of the Member entity. If the Member 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 (*MemberMutation) Op

func (m *MemberMutation) Op() Op

Op returns the operation name.

func (*MemberMutation) Password

func (m *MemberMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*MemberMutation) Phone

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

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

func (*MemberMutation) Remark

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

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

func (*MemberMutation) RemarkCleared

func (m *MemberMutation) RemarkCleared() bool

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

func (*MemberMutation) RemovedEdges

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

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

func (*MemberMutation) RemovedIDs

func (m *MemberMutation) 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 (*MemberMutation) ResetAvatar

func (m *MemberMutation) ResetAvatar()

ResetAvatar resets all changes to the "avatar" field.

func (*MemberMutation) ResetCreatedAt

func (m *MemberMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MemberMutation) ResetDeletedAt

func (m *MemberMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*MemberMutation) ResetDescription

func (m *MemberMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*MemberMutation) ResetEdge

func (m *MemberMutation) 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 (*MemberMutation) ResetEmail

func (m *MemberMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*MemberMutation) ResetField

func (m *MemberMutation) 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 (*MemberMutation) ResetNickname

func (m *MemberMutation) ResetNickname()

ResetNickname resets all changes to the "nickname" field.

func (*MemberMutation) ResetPassword

func (m *MemberMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*MemberMutation) ResetPhone

func (m *MemberMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*MemberMutation) ResetRemark

func (m *MemberMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*MemberMutation) ResetSort

func (m *MemberMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*MemberMutation) ResetState

func (m *MemberMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*MemberMutation) ResetUpdatedAt

func (m *MemberMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MemberMutation) ResetUsername

func (m *MemberMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*MemberMutation) SetAvatar

func (m *MemberMutation) SetAvatar(s string)

SetAvatar sets the "avatar" field.

func (*MemberMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*MemberMutation) SetDeletedAt

func (m *MemberMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*MemberMutation) SetDescription

func (m *MemberMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*MemberMutation) SetEmail

func (m *MemberMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*MemberMutation) SetField

func (m *MemberMutation) 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 (*MemberMutation) SetID

func (m *MemberMutation) SetID(id uint32)

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

func (*MemberMutation) SetNickname

func (m *MemberMutation) SetNickname(s string)

SetNickname sets the "nickname" field.

func (*MemberMutation) SetOp

func (m *MemberMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MemberMutation) SetPassword

func (m *MemberMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*MemberMutation) SetPhone

func (m *MemberMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*MemberMutation) SetRemark

func (m *MemberMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*MemberMutation) SetSort

func (m *MemberMutation) SetSort(i int32)

SetSort sets the "sort" field.

func (*MemberMutation) SetState

func (m *MemberMutation) SetState(i int32)

SetState sets the "state" field.

func (*MemberMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*MemberMutation) SetUsername

func (m *MemberMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*MemberMutation) Sort

func (m *MemberMutation) Sort() (r int32, exists bool)

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

func (*MemberMutation) State

func (m *MemberMutation) State() (r int32, exists bool)

State returns the value of the "state" field in the mutation.

func (MemberMutation) Tx

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

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

func (*MemberMutation) Type

func (m *MemberMutation) Type() string

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

func (*MemberMutation) UpdatedAt

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

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

func (*MemberMutation) UpdatedAtCleared

func (m *MemberMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*MemberMutation) Username

func (m *MemberMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*MemberMutation) Where

func (m *MemberMutation) Where(ps ...predicate.Member)

Where appends a list predicates to the MemberMutation builder.

func (*MemberMutation) WhereP

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

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

type MemberQuery

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

MemberQuery is the builder for querying Member entities.

func (*MemberQuery) Aggregate

func (mq *MemberQuery) Aggregate(fns ...AggregateFunc) *MemberSelect

Aggregate returns a MemberSelect configured with the given aggregations.

func (*MemberQuery) All

func (mq *MemberQuery) All(ctx context.Context) ([]*Member, error)

All executes the query and returns a list of Members.

func (*MemberQuery) AllX

func (mq *MemberQuery) AllX(ctx context.Context) []*Member

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

func (*MemberQuery) Clone

func (mq *MemberQuery) Clone() *MemberQuery

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

func (*MemberQuery) Count

func (mq *MemberQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MemberQuery) CountX

func (mq *MemberQuery) CountX(ctx context.Context) int

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

func (*MemberQuery) Exist

func (mq *MemberQuery) Exist(ctx context.Context) (bool, error)

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

func (*MemberQuery) ExistX

func (mq *MemberQuery) ExistX(ctx context.Context) bool

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

func (*MemberQuery) Filter

func (mq *MemberQuery) Filter() *MemberFilter

Filter returns a Filter implementation to apply filters on the MemberQuery builder.

func (*MemberQuery) First

func (mq *MemberQuery) First(ctx context.Context) (*Member, error)

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

func (*MemberQuery) FirstID

func (mq *MemberQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*MemberQuery) FirstIDX

func (mq *MemberQuery) FirstIDX(ctx context.Context) uint32

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

func (*MemberQuery) FirstX

func (mq *MemberQuery) FirstX(ctx context.Context) *Member

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

func (*MemberQuery) GroupBy

func (mq *MemberQuery) GroupBy(field string, fields ...string) *MemberGroupBy

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.Member.Query().
	GroupBy(member.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MemberQuery) IDs

func (mq *MemberQuery) IDs(ctx context.Context) (ids []uint32, err error)

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

func (*MemberQuery) IDsX

func (mq *MemberQuery) IDsX(ctx context.Context) []uint32

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

func (*MemberQuery) Limit

func (mq *MemberQuery) Limit(limit int) *MemberQuery

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

func (*MemberQuery) Modify

func (mq *MemberQuery) Modify(modifiers ...func(s *sql.Selector)) *MemberSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*MemberQuery) Offset

func (mq *MemberQuery) Offset(offset int) *MemberQuery

Offset to start from.

func (*MemberQuery) Only

func (mq *MemberQuery) Only(ctx context.Context) (*Member, error)

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

func (*MemberQuery) OnlyID

func (mq *MemberQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*MemberQuery) OnlyIDX

func (mq *MemberQuery) OnlyIDX(ctx context.Context) uint32

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

func (*MemberQuery) OnlyX

func (mq *MemberQuery) OnlyX(ctx context.Context) *Member

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

func (*MemberQuery) Order

func (mq *MemberQuery) Order(o ...member.OrderOption) *MemberQuery

Order specifies how the records should be ordered.

func (*MemberQuery) Select

func (mq *MemberQuery) Select(fields ...string) *MemberSelect

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.Member.Query().
	Select(member.FieldCreatedAt).
	Scan(ctx, &v)

func (*MemberQuery) Unique

func (mq *MemberQuery) Unique(unique bool) *MemberQuery

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 (*MemberQuery) Where

func (mq *MemberQuery) Where(ps ...predicate.Member) *MemberQuery

Where adds a new predicate for the MemberQuery builder.

type MemberSelect

type MemberSelect struct {
	*MemberQuery
	// contains filtered or unexported fields
}

MemberSelect is the builder for selecting fields of Member entities.

func (*MemberSelect) Aggregate

func (ms *MemberSelect) Aggregate(fns ...AggregateFunc) *MemberSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MemberSelect) Bool

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

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

func (*MemberSelect) BoolX

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

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

func (*MemberSelect) Bools

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

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

func (*MemberSelect) BoolsX

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

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

func (*MemberSelect) Float64

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

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

func (*MemberSelect) Float64X

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

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

func (*MemberSelect) Float64s

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

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

func (*MemberSelect) Float64sX

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

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

func (*MemberSelect) Int

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

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

func (*MemberSelect) IntX

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

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

func (*MemberSelect) Ints

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

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

func (*MemberSelect) IntsX

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

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

func (*MemberSelect) Modify

func (ms *MemberSelect) Modify(modifiers ...func(s *sql.Selector)) *MemberSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*MemberSelect) Scan

func (ms *MemberSelect) Scan(ctx context.Context, v any) error

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

func (*MemberSelect) ScanX

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

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

func (*MemberSelect) String

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

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

func (*MemberSelect) StringX

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

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

func (*MemberSelect) Strings

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

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

func (*MemberSelect) StringsX

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

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

type MemberUpdate

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

MemberUpdate is the builder for updating Member entities.

func (*MemberUpdate) AddSort

func (mu *MemberUpdate) AddSort(i int32) *MemberUpdate

AddSort adds i to the "sort" field.

func (*MemberUpdate) AddState

func (mu *MemberUpdate) AddState(i int32) *MemberUpdate

AddState adds i to the "state" field.

func (*MemberUpdate) ClearDeletedAt

func (mu *MemberUpdate) ClearDeletedAt() *MemberUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MemberUpdate) ClearRemark

func (mu *MemberUpdate) ClearRemark() *MemberUpdate

ClearRemark clears the value of the "remark" field.

func (*MemberUpdate) ClearUpdatedAt

func (mu *MemberUpdate) ClearUpdatedAt() *MemberUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MemberUpdate) Exec

func (mu *MemberUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberUpdate) ExecX

func (mu *MemberUpdate) ExecX(ctx context.Context)

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

func (*MemberUpdate) Modify

func (mu *MemberUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MemberUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*MemberUpdate) Mutation

func (mu *MemberUpdate) Mutation() *MemberMutation

Mutation returns the MemberMutation object of the builder.

func (*MemberUpdate) Save

func (mu *MemberUpdate) Save(ctx context.Context) (int, error)

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

func (*MemberUpdate) SaveX

func (mu *MemberUpdate) SaveX(ctx context.Context) int

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

func (*MemberUpdate) SetAvatar

func (mu *MemberUpdate) SetAvatar(s string) *MemberUpdate

SetAvatar sets the "avatar" field.

func (*MemberUpdate) SetDeletedAt

func (mu *MemberUpdate) SetDeletedAt(t time.Time) *MemberUpdate

SetDeletedAt sets the "deleted_at" field.

func (*MemberUpdate) SetDescription

func (mu *MemberUpdate) SetDescription(s string) *MemberUpdate

SetDescription sets the "description" field.

func (*MemberUpdate) SetEmail

func (mu *MemberUpdate) SetEmail(s string) *MemberUpdate

SetEmail sets the "email" field.

func (*MemberUpdate) SetNickname

func (mu *MemberUpdate) SetNickname(s string) *MemberUpdate

SetNickname sets the "nickname" field.

func (*MemberUpdate) SetNillableAvatar

func (mu *MemberUpdate) SetNillableAvatar(s *string) *MemberUpdate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*MemberUpdate) SetNillableDeletedAt

func (mu *MemberUpdate) SetNillableDeletedAt(t *time.Time) *MemberUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MemberUpdate) SetNillableDescription

func (mu *MemberUpdate) SetNillableDescription(s *string) *MemberUpdate

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

func (*MemberUpdate) SetNillableEmail

func (mu *MemberUpdate) SetNillableEmail(s *string) *MemberUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*MemberUpdate) SetNillableNickname

func (mu *MemberUpdate) SetNillableNickname(s *string) *MemberUpdate

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*MemberUpdate) SetNillablePassword

func (mu *MemberUpdate) SetNillablePassword(s *string) *MemberUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*MemberUpdate) SetNillablePhone

func (mu *MemberUpdate) SetNillablePhone(s *string) *MemberUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*MemberUpdate) SetNillableRemark

func (mu *MemberUpdate) SetNillableRemark(s *string) *MemberUpdate

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

func (*MemberUpdate) SetNillableSort

func (mu *MemberUpdate) SetNillableSort(i *int32) *MemberUpdate

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

func (*MemberUpdate) SetNillableState

func (mu *MemberUpdate) SetNillableState(i *int32) *MemberUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*MemberUpdate) SetNillableUpdatedAt

func (mu *MemberUpdate) SetNillableUpdatedAt(t *time.Time) *MemberUpdate

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

func (*MemberUpdate) SetPassword

func (mu *MemberUpdate) SetPassword(s string) *MemberUpdate

SetPassword sets the "password" field.

func (*MemberUpdate) SetPhone

func (mu *MemberUpdate) SetPhone(s string) *MemberUpdate

SetPhone sets the "phone" field.

func (*MemberUpdate) SetRemark

func (mu *MemberUpdate) SetRemark(s string) *MemberUpdate

SetRemark sets the "remark" field.

func (*MemberUpdate) SetSort

func (mu *MemberUpdate) SetSort(i int32) *MemberUpdate

SetSort sets the "sort" field.

func (*MemberUpdate) SetState

func (mu *MemberUpdate) SetState(i int32) *MemberUpdate

SetState sets the "state" field.

func (*MemberUpdate) SetUpdatedAt

func (mu *MemberUpdate) SetUpdatedAt(t time.Time) *MemberUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MemberUpdate) Where

func (mu *MemberUpdate) Where(ps ...predicate.Member) *MemberUpdate

Where appends a list predicates to the MemberUpdate builder.

type MemberUpdateOne

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

MemberUpdateOne is the builder for updating a single Member entity.

func (*MemberUpdateOne) AddSort

func (muo *MemberUpdateOne) AddSort(i int32) *MemberUpdateOne

AddSort adds i to the "sort" field.

func (*MemberUpdateOne) AddState

func (muo *MemberUpdateOne) AddState(i int32) *MemberUpdateOne

AddState adds i to the "state" field.

func (*MemberUpdateOne) ClearDeletedAt

func (muo *MemberUpdateOne) ClearDeletedAt() *MemberUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MemberUpdateOne) ClearRemark

func (muo *MemberUpdateOne) ClearRemark() *MemberUpdateOne

ClearRemark clears the value of the "remark" field.

func (*MemberUpdateOne) ClearUpdatedAt

func (muo *MemberUpdateOne) ClearUpdatedAt() *MemberUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MemberUpdateOne) Exec

func (muo *MemberUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MemberUpdateOne) ExecX

func (muo *MemberUpdateOne) ExecX(ctx context.Context)

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

func (*MemberUpdateOne) Modify

func (muo *MemberUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MemberUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*MemberUpdateOne) Mutation

func (muo *MemberUpdateOne) Mutation() *MemberMutation

Mutation returns the MemberMutation object of the builder.

func (*MemberUpdateOne) Save

func (muo *MemberUpdateOne) Save(ctx context.Context) (*Member, error)

Save executes the query and returns the updated Member entity.

func (*MemberUpdateOne) SaveX

func (muo *MemberUpdateOne) SaveX(ctx context.Context) *Member

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

func (*MemberUpdateOne) Select

func (muo *MemberUpdateOne) Select(field string, fields ...string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetAvatar

func (muo *MemberUpdateOne) SetAvatar(s string) *MemberUpdateOne

SetAvatar sets the "avatar" field.

func (*MemberUpdateOne) SetDeletedAt

func (muo *MemberUpdateOne) SetDeletedAt(t time.Time) *MemberUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*MemberUpdateOne) SetDescription

func (muo *MemberUpdateOne) SetDescription(s string) *MemberUpdateOne

SetDescription sets the "description" field.

func (*MemberUpdateOne) SetEmail

func (muo *MemberUpdateOne) SetEmail(s string) *MemberUpdateOne

SetEmail sets the "email" field.

func (*MemberUpdateOne) SetNickname

func (muo *MemberUpdateOne) SetNickname(s string) *MemberUpdateOne

SetNickname sets the "nickname" field.

func (*MemberUpdateOne) SetNillableAvatar

func (muo *MemberUpdateOne) SetNillableAvatar(s *string) *MemberUpdateOne

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*MemberUpdateOne) SetNillableDeletedAt

func (muo *MemberUpdateOne) SetNillableDeletedAt(t *time.Time) *MemberUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*MemberUpdateOne) SetNillableDescription

func (muo *MemberUpdateOne) SetNillableDescription(s *string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNillableEmail

func (muo *MemberUpdateOne) SetNillableEmail(s *string) *MemberUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*MemberUpdateOne) SetNillableNickname

func (muo *MemberUpdateOne) SetNillableNickname(s *string) *MemberUpdateOne

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*MemberUpdateOne) SetNillablePassword

func (muo *MemberUpdateOne) SetNillablePassword(s *string) *MemberUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*MemberUpdateOne) SetNillablePhone

func (muo *MemberUpdateOne) SetNillablePhone(s *string) *MemberUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*MemberUpdateOne) SetNillableRemark

func (muo *MemberUpdateOne) SetNillableRemark(s *string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNillableSort

func (muo *MemberUpdateOne) SetNillableSort(i *int32) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNillableState

func (muo *MemberUpdateOne) SetNillableState(i *int32) *MemberUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*MemberUpdateOne) SetNillableUpdatedAt

func (muo *MemberUpdateOne) SetNillableUpdatedAt(t *time.Time) *MemberUpdateOne

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

func (*MemberUpdateOne) SetPassword

func (muo *MemberUpdateOne) SetPassword(s string) *MemberUpdateOne

SetPassword sets the "password" field.

func (*MemberUpdateOne) SetPhone

func (muo *MemberUpdateOne) SetPhone(s string) *MemberUpdateOne

SetPhone sets the "phone" field.

func (*MemberUpdateOne) SetRemark

func (muo *MemberUpdateOne) SetRemark(s string) *MemberUpdateOne

SetRemark sets the "remark" field.

func (*MemberUpdateOne) SetSort

func (muo *MemberUpdateOne) SetSort(i int32) *MemberUpdateOne

SetSort sets the "sort" field.

func (*MemberUpdateOne) SetState

func (muo *MemberUpdateOne) SetState(i int32) *MemberUpdateOne

SetState sets the "state" field.

func (*MemberUpdateOne) SetUpdatedAt

func (muo *MemberUpdateOne) SetUpdatedAt(t time.Time) *MemberUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MemberUpdateOne) Where

func (muo *MemberUpdateOne) Where(ps ...predicate.Member) *MemberUpdateOne

Where appends a list predicates to the MemberUpdate builder.

type MemberUpsert

type MemberUpsert struct {
	*sql.UpdateSet
}

MemberUpsert is the "OnConflict" setter.

func (*MemberUpsert) AddSort

func (u *MemberUpsert) AddSort(v int32) *MemberUpsert

AddSort adds v to the "sort" field.

func (*MemberUpsert) AddState

func (u *MemberUpsert) AddState(v int32) *MemberUpsert

AddState adds v to the "state" field.

func (*MemberUpsert) ClearDeletedAt

func (u *MemberUpsert) ClearDeletedAt() *MemberUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MemberUpsert) ClearRemark

func (u *MemberUpsert) ClearRemark() *MemberUpsert

ClearRemark clears the value of the "remark" field.

func (*MemberUpsert) ClearUpdatedAt

func (u *MemberUpsert) ClearUpdatedAt() *MemberUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MemberUpsert) SetAvatar

func (u *MemberUpsert) SetAvatar(v string) *MemberUpsert

SetAvatar sets the "avatar" field.

func (*MemberUpsert) SetDeletedAt

func (u *MemberUpsert) SetDeletedAt(v time.Time) *MemberUpsert

SetDeletedAt sets the "deleted_at" field.

func (*MemberUpsert) SetDescription

func (u *MemberUpsert) SetDescription(v string) *MemberUpsert

SetDescription sets the "description" field.

func (*MemberUpsert) SetEmail

func (u *MemberUpsert) SetEmail(v string) *MemberUpsert

SetEmail sets the "email" field.

func (*MemberUpsert) SetNickname

func (u *MemberUpsert) SetNickname(v string) *MemberUpsert

SetNickname sets the "nickname" field.

func (*MemberUpsert) SetPassword

func (u *MemberUpsert) SetPassword(v string) *MemberUpsert

SetPassword sets the "password" field.

func (*MemberUpsert) SetPhone

func (u *MemberUpsert) SetPhone(v string) *MemberUpsert

SetPhone sets the "phone" field.

func (*MemberUpsert) SetRemark

func (u *MemberUpsert) SetRemark(v string) *MemberUpsert

SetRemark sets the "remark" field.

func (*MemberUpsert) SetSort

func (u *MemberUpsert) SetSort(v int32) *MemberUpsert

SetSort sets the "sort" field.

func (*MemberUpsert) SetState

func (u *MemberUpsert) SetState(v int32) *MemberUpsert

SetState sets the "state" field.

func (*MemberUpsert) SetUpdatedAt

func (u *MemberUpsert) SetUpdatedAt(v time.Time) *MemberUpsert

SetUpdatedAt sets the "updated_at" field.

func (*MemberUpsert) UpdateAvatar

func (u *MemberUpsert) UpdateAvatar() *MemberUpsert

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*MemberUpsert) UpdateDeletedAt

func (u *MemberUpsert) UpdateDeletedAt() *MemberUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*MemberUpsert) UpdateDescription

func (u *MemberUpsert) UpdateDescription() *MemberUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*MemberUpsert) UpdateEmail

func (u *MemberUpsert) UpdateEmail() *MemberUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*MemberUpsert) UpdateNickname

func (u *MemberUpsert) UpdateNickname() *MemberUpsert

UpdateNickname sets the "nickname" field to the value that was provided on create.

func (*MemberUpsert) UpdatePassword

func (u *MemberUpsert) UpdatePassword() *MemberUpsert

UpdatePassword sets the "password" field to the value that was provided on create.

func (*MemberUpsert) UpdatePhone

func (u *MemberUpsert) UpdatePhone() *MemberUpsert

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*MemberUpsert) UpdateRemark

func (u *MemberUpsert) UpdateRemark() *MemberUpsert

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*MemberUpsert) UpdateSort

func (u *MemberUpsert) UpdateSort() *MemberUpsert

UpdateSort sets the "sort" field to the value that was provided on create.

func (*MemberUpsert) UpdateState

func (u *MemberUpsert) UpdateState() *MemberUpsert

UpdateState sets the "state" field to the value that was provided on create.

func (*MemberUpsert) UpdateUpdatedAt

func (u *MemberUpsert) UpdateUpdatedAt() *MemberUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type MemberUpsertBulk

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

MemberUpsertBulk is the builder for "upsert"-ing a bulk of Member nodes.

func (*MemberUpsertBulk) AddSort

func (u *MemberUpsertBulk) AddSort(v int32) *MemberUpsertBulk

AddSort adds v to the "sort" field.

func (*MemberUpsertBulk) AddState

func (u *MemberUpsertBulk) AddState(v int32) *MemberUpsertBulk

AddState adds v to the "state" field.

func (*MemberUpsertBulk) ClearDeletedAt

func (u *MemberUpsertBulk) ClearDeletedAt() *MemberUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MemberUpsertBulk) ClearRemark

func (u *MemberUpsertBulk) ClearRemark() *MemberUpsertBulk

ClearRemark clears the value of the "remark" field.

func (*MemberUpsertBulk) ClearUpdatedAt

func (u *MemberUpsertBulk) ClearUpdatedAt() *MemberUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MemberUpsertBulk) DoNothing

func (u *MemberUpsertBulk) DoNothing() *MemberUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*MemberUpsertBulk) Exec

func (u *MemberUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberUpsertBulk) ExecX

func (u *MemberUpsertBulk) ExecX(ctx context.Context)

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

func (*MemberUpsertBulk) Ignore

func (u *MemberUpsertBulk) Ignore() *MemberUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Member.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*MemberUpsertBulk) SetAvatar

func (u *MemberUpsertBulk) SetAvatar(v string) *MemberUpsertBulk

SetAvatar sets the "avatar" field.

func (*MemberUpsertBulk) SetDeletedAt

func (u *MemberUpsertBulk) SetDeletedAt(v time.Time) *MemberUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*MemberUpsertBulk) SetDescription

func (u *MemberUpsertBulk) SetDescription(v string) *MemberUpsertBulk

SetDescription sets the "description" field.

func (*MemberUpsertBulk) SetEmail

func (u *MemberUpsertBulk) SetEmail(v string) *MemberUpsertBulk

SetEmail sets the "email" field.

func (*MemberUpsertBulk) SetNickname

func (u *MemberUpsertBulk) SetNickname(v string) *MemberUpsertBulk

SetNickname sets the "nickname" field.

func (*MemberUpsertBulk) SetPassword

func (u *MemberUpsertBulk) SetPassword(v string) *MemberUpsertBulk

SetPassword sets the "password" field.

func (*MemberUpsertBulk) SetPhone

func (u *MemberUpsertBulk) SetPhone(v string) *MemberUpsertBulk

SetPhone sets the "phone" field.

func (*MemberUpsertBulk) SetRemark

func (u *MemberUpsertBulk) SetRemark(v string) *MemberUpsertBulk

SetRemark sets the "remark" field.

func (*MemberUpsertBulk) SetSort

func (u *MemberUpsertBulk) SetSort(v int32) *MemberUpsertBulk

SetSort sets the "sort" field.

func (*MemberUpsertBulk) SetState

func (u *MemberUpsertBulk) SetState(v int32) *MemberUpsertBulk

SetState sets the "state" field.

func (*MemberUpsertBulk) SetUpdatedAt

func (u *MemberUpsertBulk) SetUpdatedAt(v time.Time) *MemberUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*MemberUpsertBulk) Update

func (u *MemberUpsertBulk) Update(set func(*MemberUpsert)) *MemberUpsertBulk

Update allows overriding fields `UPDATE` values. See the MemberCreateBulk.OnConflict documentation for more info.

func (*MemberUpsertBulk) UpdateAvatar

func (u *MemberUpsertBulk) UpdateAvatar() *MemberUpsertBulk

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*MemberUpsertBulk) UpdateDeletedAt

func (u *MemberUpsertBulk) UpdateDeletedAt() *MemberUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*MemberUpsertBulk) UpdateDescription

func (u *MemberUpsertBulk) UpdateDescription() *MemberUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*MemberUpsertBulk) UpdateEmail

func (u *MemberUpsertBulk) UpdateEmail() *MemberUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*MemberUpsertBulk) UpdateNewValues

func (u *MemberUpsertBulk) UpdateNewValues() *MemberUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Member.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(member.FieldID)
		}),
	).
	Exec(ctx)

func (*MemberUpsertBulk) UpdateNickname

func (u *MemberUpsertBulk) UpdateNickname() *MemberUpsertBulk

UpdateNickname sets the "nickname" field to the value that was provided on create.

func (*MemberUpsertBulk) UpdatePassword

func (u *MemberUpsertBulk) UpdatePassword() *MemberUpsertBulk

UpdatePassword sets the "password" field to the value that was provided on create.

func (*MemberUpsertBulk) UpdatePhone

func (u *MemberUpsertBulk) UpdatePhone() *MemberUpsertBulk

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*MemberUpsertBulk) UpdateRemark

func (u *MemberUpsertBulk) UpdateRemark() *MemberUpsertBulk

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*MemberUpsertBulk) UpdateSort

func (u *MemberUpsertBulk) UpdateSort() *MemberUpsertBulk

UpdateSort sets the "sort" field to the value that was provided on create.

func (*MemberUpsertBulk) UpdateState

func (u *MemberUpsertBulk) UpdateState() *MemberUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

func (*MemberUpsertBulk) UpdateUpdatedAt

func (u *MemberUpsertBulk) UpdateUpdatedAt() *MemberUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type MemberUpsertOne

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

MemberUpsertOne is the builder for "upsert"-ing

one Member node.

func (*MemberUpsertOne) AddSort

func (u *MemberUpsertOne) AddSort(v int32) *MemberUpsertOne

AddSort adds v to the "sort" field.

func (*MemberUpsertOne) AddState

func (u *MemberUpsertOne) AddState(v int32) *MemberUpsertOne

AddState adds v to the "state" field.

func (*MemberUpsertOne) ClearDeletedAt

func (u *MemberUpsertOne) ClearDeletedAt() *MemberUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*MemberUpsertOne) ClearRemark

func (u *MemberUpsertOne) ClearRemark() *MemberUpsertOne

ClearRemark clears the value of the "remark" field.

func (*MemberUpsertOne) ClearUpdatedAt

func (u *MemberUpsertOne) ClearUpdatedAt() *MemberUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MemberUpsertOne) DoNothing

func (u *MemberUpsertOne) DoNothing() *MemberUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*MemberUpsertOne) Exec

func (u *MemberUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberUpsertOne) ExecX

func (u *MemberUpsertOne) ExecX(ctx context.Context)

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

func (*MemberUpsertOne) ID

func (u *MemberUpsertOne) ID(ctx context.Context) (id uint32, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*MemberUpsertOne) IDX

func (u *MemberUpsertOne) IDX(ctx context.Context) uint32

IDX is like ID, but panics if an error occurs.

func (*MemberUpsertOne) Ignore

func (u *MemberUpsertOne) Ignore() *MemberUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Member.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*MemberUpsertOne) SetAvatar

func (u *MemberUpsertOne) SetAvatar(v string) *MemberUpsertOne

SetAvatar sets the "avatar" field.

func (*MemberUpsertOne) SetDeletedAt

func (u *MemberUpsertOne) SetDeletedAt(v time.Time) *MemberUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*MemberUpsertOne) SetDescription

func (u *MemberUpsertOne) SetDescription(v string) *MemberUpsertOne

SetDescription sets the "description" field.

func (*MemberUpsertOne) SetEmail

func (u *MemberUpsertOne) SetEmail(v string) *MemberUpsertOne

SetEmail sets the "email" field.

func (*MemberUpsertOne) SetNickname

func (u *MemberUpsertOne) SetNickname(v string) *MemberUpsertOne

SetNickname sets the "nickname" field.

func (*MemberUpsertOne) SetPassword

func (u *MemberUpsertOne) SetPassword(v string) *MemberUpsertOne

SetPassword sets the "password" field.

func (*MemberUpsertOne) SetPhone

func (u *MemberUpsertOne) SetPhone(v string) *MemberUpsertOne

SetPhone sets the "phone" field.

func (*MemberUpsertOne) SetRemark

func (u *MemberUpsertOne) SetRemark(v string) *MemberUpsertOne

SetRemark sets the "remark" field.

func (*MemberUpsertOne) SetSort

func (u *MemberUpsertOne) SetSort(v int32) *MemberUpsertOne

SetSort sets the "sort" field.

func (*MemberUpsertOne) SetState

func (u *MemberUpsertOne) SetState(v int32) *MemberUpsertOne

SetState sets the "state" field.

func (*MemberUpsertOne) SetUpdatedAt

func (u *MemberUpsertOne) SetUpdatedAt(v time.Time) *MemberUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*MemberUpsertOne) Update

func (u *MemberUpsertOne) Update(set func(*MemberUpsert)) *MemberUpsertOne

Update allows overriding fields `UPDATE` values. See the MemberCreate.OnConflict documentation for more info.

func (*MemberUpsertOne) UpdateAvatar

func (u *MemberUpsertOne) UpdateAvatar() *MemberUpsertOne

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*MemberUpsertOne) UpdateDeletedAt

func (u *MemberUpsertOne) UpdateDeletedAt() *MemberUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*MemberUpsertOne) UpdateDescription

func (u *MemberUpsertOne) UpdateDescription() *MemberUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*MemberUpsertOne) UpdateEmail

func (u *MemberUpsertOne) UpdateEmail() *MemberUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*MemberUpsertOne) UpdateNewValues

func (u *MemberUpsertOne) UpdateNewValues() *MemberUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Member.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(member.FieldID)
		}),
	).
	Exec(ctx)

func (*MemberUpsertOne) UpdateNickname

func (u *MemberUpsertOne) UpdateNickname() *MemberUpsertOne

UpdateNickname sets the "nickname" field to the value that was provided on create.

func (*MemberUpsertOne) UpdatePassword

func (u *MemberUpsertOne) UpdatePassword() *MemberUpsertOne

UpdatePassword sets the "password" field to the value that was provided on create.

func (*MemberUpsertOne) UpdatePhone

func (u *MemberUpsertOne) UpdatePhone() *MemberUpsertOne

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*MemberUpsertOne) UpdateRemark

func (u *MemberUpsertOne) UpdateRemark() *MemberUpsertOne

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*MemberUpsertOne) UpdateSort

func (u *MemberUpsertOne) UpdateSort() *MemberUpsertOne

UpdateSort sets the "sort" field to the value that was provided on create.

func (*MemberUpsertOne) UpdateState

func (u *MemberUpsertOne) UpdateState() *MemberUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

func (*MemberUpsertOne) UpdateUpdatedAt

func (u *MemberUpsertOne) UpdateUpdatedAt() *MemberUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Members

type Members []*Member

Members is a parsable slice of Member.

type Menu struct {

	// ID of the ent.
	// id
	ID uint32 `json:"id,omitempty"`
	// 创建时间
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// 更新时间
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// 删除时间
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// 备注
	Remark *string `json:"remark,omitempty"`
	// 排序
	Sort *int32 `json:"sort,omitempty"`
	// 状态 0 UNSPECIFIED 开启 1 -> ACTIVE 关闭 2 -> INACTIVE, 禁用 3 -> BANNED
	State *int32 `json:"state,omitempty"`
	// 名称
	Name *string `json:"name,omitempty"`
	// 菜单标题
	Title *string `json:"title,omitempty"`
	// 父级ID
	ParentID *uint32 `json:"parent_id,omitempty"`
	// 菜单类型 0 UNSPECIFIED, 目录 1 -> FOLDER, 菜单 2 -> MENU, 按钮 3 -> BUTTON
	Type *int32 `json:"type,omitempty"`
	// 路径,当其类型为'按钮'的时候对应的数据操作名,例如:/user.service.v1.UserService/Login
	Path *string `json:"path,omitempty"`
	// 前端页面组件
	Component *string `json:"component,omitempty"`
	// 图标
	Icon *string `json:"icon,omitempty"`
	// 是否外链
	IsExt *bool `json:"is_ext,omitempty"`
	// 外链地址
	ExtURL *string `json:"ext_url,omitempty"`
	// 权限代码 例如:sys:menu
	Permissions []string `json:"permissions,omitempty"`
	// 跳转路径
	Redirect *string `json:"redirect,omitempty"`
	// 当前激活菜单
	CurrentActiveMenu *string `json:"current_active_menu,omitempty"`
	// 是否缓存
	KeepAlive *bool `json:"keep_alive,omitempty"`
	// 是否显示
	Visible *bool `json:"visible,omitempty"`
	// 是否显示在标签页导航
	HideTab *bool `json:"hide_tab,omitempty"`
	// 是否显示在菜单导航
	HideMenu *bool `json:"hide_menu,omitempty"`
	// 是否显示在面包屑导航
	HideBreadcrumb *bool `json:"hide_breadcrumb,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
}

菜单表

func (m *Menu) QueryChildren() *MenuQuery

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

func (m *Menu) QueryParent() *MenuQuery

QueryParent queries the "parent" 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 uint32) *MenuDeleteOne

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

func (c *MenuClient) Get(ctx context.Context, id uint32) (*Menu, error)

Get returns a Menu entity by its id.

func (c *MenuClient) GetX(ctx context.Context, id uint32) *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) QueryParent(m *Menu) *MenuQuery

QueryParent queries the parent 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 uint32) *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 ...uint32) *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) Exec(ctx context.Context) error

Exec executes the query.

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 (mc *MenuCreate) OnConflict(opts ...sql.ConflictOption) *MenuUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Menu.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.MenuUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)
func (mc *MenuCreate) OnConflictColumns(columns ...string) *MenuUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Menu.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)
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) 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) SetCurrentActiveMenu(s string) *MenuCreate

SetCurrentActiveMenu sets the "current_active_menu" field.

func (mc *MenuCreate) SetDeletedAt(t time.Time) *MenuCreate

SetDeletedAt sets the "deleted_at" field.

func (mc *MenuCreate) SetExtURL(s string) *MenuCreate

SetExtURL sets the "ext_url" field.

func (mc *MenuCreate) SetHideBreadcrumb(b bool) *MenuCreate

SetHideBreadcrumb sets the "hide_breadcrumb" 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 uint32) *MenuCreate

SetID sets the "id" field.

func (mc *MenuCreate) SetIcon(s string) *MenuCreate

SetIcon sets the "icon" field.

func (mc *MenuCreate) SetIsExt(b bool) *MenuCreate

SetIsExt sets the "is_ext" field.

func (mc *MenuCreate) SetKeepAlive(b bool) *MenuCreate

SetKeepAlive sets the "keep_alive" field.

func (mc *MenuCreate) SetName(s string) *MenuCreate

SetName sets the "name" field.

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) SetNillableCurrentActiveMenu(s *string) *MenuCreate

SetNillableCurrentActiveMenu sets the "current_active_menu" field if the given value is not nil.

func (mc *MenuCreate) SetNillableDeletedAt(t *time.Time) *MenuCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (mc *MenuCreate) SetNillableExtURL(s *string) *MenuCreate

SetNillableExtURL sets the "ext_url" 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) 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) SetNillableIcon(s *string) *MenuCreate

SetNillableIcon sets the "icon" field if the given value is not nil.

func (mc *MenuCreate) SetNillableIsExt(b *bool) *MenuCreate

SetNillableIsExt sets the "is_ext" field if the given value is not nil.

func (mc *MenuCreate) SetNillableKeepAlive(b *bool) *MenuCreate

SetNillableKeepAlive sets the "keep_alive" field if the given value is not nil.

func (mc *MenuCreate) SetNillableName(s *string) *MenuCreate

SetNillableName sets the "name" field if the given value is not nil.

func (mc *MenuCreate) SetNillableParentID(u *uint32) *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) SetNillableRedirect(s *string) *MenuCreate

SetNillableRedirect sets the "redirect" field if the given value is not nil.

func (mc *MenuCreate) SetNillableRemark(s *string) *MenuCreate

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

func (mc *MenuCreate) SetNillableSort(i *int32) *MenuCreate

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

func (mc *MenuCreate) SetNillableState(i *int32) *MenuCreate

SetNillableState sets the "state" field if the given value is not nil.

func (mc *MenuCreate) SetNillableTitle(s *string) *MenuCreate

SetNillableTitle sets the "title" field if the given value is not nil.

func (mc *MenuCreate) SetNillableType(i *int32) *MenuCreate

SetNillableType sets the "type" 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 (mc *MenuCreate) SetNillableVisible(b *bool) *MenuCreate

SetNillableVisible sets the "visible" field if the given value is not nil.

func (mc *MenuCreate) SetParent(m *Menu) *MenuCreate

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

func (mc *MenuCreate) SetParentID(u uint32) *MenuCreate

SetParentID sets the "parent_id" field.

func (mc *MenuCreate) SetPath(s string) *MenuCreate

SetPath sets the "path" field.

func (mc *MenuCreate) SetPermissions(s []string) *MenuCreate

SetPermissions sets the "permissions" field.

func (mc *MenuCreate) SetRedirect(s string) *MenuCreate

SetRedirect sets the "redirect" field.

func (mc *MenuCreate) SetRemark(s string) *MenuCreate

SetRemark sets the "remark" field.

func (mc *MenuCreate) SetSort(i int32) *MenuCreate

SetSort sets the "sort" field.

func (mc *MenuCreate) SetState(i int32) *MenuCreate

SetState sets the "state" field.

func (mc *MenuCreate) SetTitle(s string) *MenuCreate

SetTitle sets the "title" field.

func (mc *MenuCreate) SetType(i int32) *MenuCreate

SetType sets the "type" field.

func (mc *MenuCreate) SetUpdatedAt(t time.Time) *MenuCreate

SetUpdatedAt sets the "updated_at" field.

func (mc *MenuCreate) SetVisible(b bool) *MenuCreate

SetVisible sets the "visible" 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 (mcb *MenuCreateBulk) ExecX(ctx context.Context)

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

func (mcb *MenuCreateBulk) OnConflict(opts ...sql.ConflictOption) *MenuUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Menu.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.MenuUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)
func (mcb *MenuCreateBulk) OnConflictColumns(columns ...string) *MenuUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Menu.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)
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 (md *MenuDelete) ExecX(ctx context.Context) int

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

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 {
	// 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.

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

MenuFilter provides a generic filtering capability at runtime for MenuQuery.

func (f *MenuFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (f *MenuFilter) WhereComponent(p entql.StringP)

WhereComponent applies the entql string predicate on the component field.

func (f *MenuFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (f *MenuFilter) WhereCurrentActiveMenu(p entql.StringP)

WhereCurrentActiveMenu applies the entql string predicate on the current_active_menu field.

func (f *MenuFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (f *MenuFilter) WhereExtURL(p entql.StringP)

WhereExtURL applies the entql string predicate on the ext_url field.

func (f *MenuFilter) WhereHasChildren()

WhereHasChildren applies a predicate to check if query has an edge children.

func (f *MenuFilter) WhereHasChildrenWith(preds ...predicate.Menu)

WhereHasChildrenWith applies a predicate to check if query has an edge children with a given conditions (other predicates).

func (f *MenuFilter) WhereHasParent()

WhereHasParent applies a predicate to check if query has an edge parent.

func (f *MenuFilter) WhereHasParentWith(preds ...predicate.Menu)

WhereHasParentWith applies a predicate to check if query has an edge parent with a given conditions (other predicates).

func (f *MenuFilter) WhereHideBreadcrumb(p entql.BoolP)

WhereHideBreadcrumb applies the entql bool predicate on the hide_breadcrumb field.

func (f *MenuFilter) WhereHideMenu(p entql.BoolP)

WhereHideMenu applies the entql bool predicate on the hide_menu field.

func (f *MenuFilter) WhereHideTab(p entql.BoolP)

WhereHideTab applies the entql bool predicate on the hide_tab field.

func (f *MenuFilter) WhereID(p entql.Uint32P)

WhereID applies the entql uint32 predicate on the id field.

func (f *MenuFilter) WhereIcon(p entql.StringP)

WhereIcon applies the entql string predicate on the icon field.

func (f *MenuFilter) WhereIsExt(p entql.BoolP)

WhereIsExt applies the entql bool predicate on the is_ext field.

func (f *MenuFilter) WhereKeepAlive(p entql.BoolP)

WhereKeepAlive applies the entql bool predicate on the keep_alive field.

func (f *MenuFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

func (f *MenuFilter) WhereParentID(p entql.Uint32P)

WhereParentID applies the entql uint32 predicate on the parent_id field.

func (f *MenuFilter) WherePath(p entql.StringP)

WherePath applies the entql string predicate on the path field.

func (f *MenuFilter) WherePermissions(p entql.BytesP)

WherePermissions applies the entql json.RawMessage predicate on the permissions field.

func (f *MenuFilter) WhereRedirect(p entql.StringP)

WhereRedirect applies the entql string predicate on the redirect field.

func (f *MenuFilter) WhereRemark(p entql.StringP)

WhereRemark applies the entql string predicate on the remark field.

func (f *MenuFilter) WhereSort(p entql.Int32P)

WhereSort applies the entql int32 predicate on the sort field.

func (f *MenuFilter) WhereState(p entql.Int32P)

WhereState applies the entql int32 predicate on the state field.

func (f *MenuFilter) WhereTitle(p entql.StringP)

WhereTitle applies the entql string predicate on the title field.

func (f *MenuFilter) WhereType(p entql.Int32P)

WhereType applies the entql int32 predicate on the type field.

func (f *MenuFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

func (f *MenuFilter) WhereVisible(p entql.BoolP)

WhereVisible applies the entql bool predicate on the visible field.

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 ...uint32)

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

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) AddSort(i int32)

AddSort adds i to the "sort" field.

func (m *MenuMutation) AddState(i int32)

AddState adds i to the "state" field.

func (m *MenuMutation) AddType(i int32)

AddType adds i to the "type" field.

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) AddedSort() (r int32, exists bool)

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

func (m *MenuMutation) AddedState() (r int32, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (m *MenuMutation) AddedType() (r int32, exists bool)

AddedType returns the value that was added to the "type" field in this mutation.

func (m *MenuMutation) AppendPermissions(s []string)

AppendPermissions adds s to the "permissions" field.

func (m *MenuMutation) AppendedPermissions() ([]string, bool)

AppendedPermissions returns the list of values that were appended to the "permissions" field 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 []uint32)

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

func (m *MenuMutation) ClearChildren()

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

func (m *MenuMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (m *MenuMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" 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) 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) ClearPermissions()

ClearPermissions clears the value of the "permissions" field.

func (m *MenuMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (m *MenuMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

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) CreatedAt() (r time.Time, exists bool)

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

func (m *MenuMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (m *MenuMutation) CurrentActiveMenu() (r string, exists bool)

CurrentActiveMenu returns the value of the "current_active_menu" field in the mutation.

func (m *MenuMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (m *MenuMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" 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 (m *MenuMutation) ExtURL() (r string, exists bool)

ExtURL returns the value of the "ext_url" field in the mutation.

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) Filter() *MenuFilter

Filter returns an entql.Where implementation to apply filters on the MenuMutation builder.

func (m *MenuMutation) GetType() (r int32, exists bool)

GetType returns the value of the "type" field in the mutation.

func (m *MenuMutation) HideBreadcrumb() (r bool, exists bool)

HideBreadcrumb returns the value of the "hide_breadcrumb" field in the mutation.

func (m *MenuMutation) HideMenu() (r bool, exists bool)

HideMenu returns the value of the "hide_menu" field in the mutation.

func (m *MenuMutation) HideTab() (r bool, exists bool)

HideTab returns the value of the "hide_tab" field in the mutation.

func (m *MenuMutation) ID() (id uint32, 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) ([]uint32, 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) IsExt() (r bool, exists bool)

IsExt returns the value of the "is_ext" field in the mutation.

func (m *MenuMutation) KeepAlive() (r bool, exists bool)

KeepAlive returns the value of the "keep_alive" 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) 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) OldCurrentActiveMenu(ctx context.Context) (v *string, err error)

OldCurrentActiveMenu returns the old "current_active_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) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_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) OldExtURL(ctx context.Context) (v *string, err error)

OldExtURL returns the old "ext_url" 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) 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) 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) OldIsExt(ctx context.Context) (v *bool, err error)

OldIsExt returns the old "is_ext" 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) OldKeepAlive(ctx context.Context) (v *bool, err error)

OldKeepAlive returns the old "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) 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 *uint32, 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) OldPermissions(ctx context.Context) (v []string, err error)

OldPermissions returns the old "permissions" 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) OldRemark(ctx context.Context) (v *string, err error)

OldRemark returns the old "remark" 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 *int32, 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) OldState(ctx context.Context) (v *int32, err error)

OldState returns the old "state" 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) OldType(ctx context.Context) (v *int32, err error)

OldType returns the old "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) 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) OldVisible(ctx context.Context) (v *bool, err error)

OldVisible returns the old "visible" 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 uint32, 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 []uint32)

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) Permissions() (r []string, exists bool)

Permissions returns the value of the "permissions" field in the mutation.

func (m *MenuMutation) PermissionsCleared() bool

PermissionsCleared returns if the "permissions" 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) Remark() (r string, exists bool)

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

func (m *MenuMutation) RemarkCleared() bool

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

func (m *MenuMutation) RemoveChildIDs(ids ...uint32)

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

func (m *MenuMutation) RemovedChildrenIDs() (ids []uint32)

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) 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) ResetCurrentActiveMenu()

ResetCurrentActiveMenu resets all changes to the "current_active_menu" field.

func (m *MenuMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" 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) ResetExtURL()

ResetExtURL resets all changes to the "ext_url" field.

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) ResetHideBreadcrumb()

ResetHideBreadcrumb resets all changes to the "hide_breadcrumb" 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) ResetIsExt()

ResetIsExt resets all changes to the "is_ext" field.

func (m *MenuMutation) ResetKeepAlive()

ResetKeepAlive resets all changes to the "keep_alive" 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) ResetPermissions()

ResetPermissions resets all changes to the "permissions" field.

func (m *MenuMutation) ResetRedirect()

ResetRedirect resets all changes to the "redirect" field.

func (m *MenuMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (m *MenuMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (m *MenuMutation) ResetState()

ResetState resets all changes to the "state" field.

func (m *MenuMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (m *MenuMutation) ResetType()

ResetType resets all changes to the "type" field.

func (m *MenuMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (m *MenuMutation) ResetVisible()

ResetVisible resets all changes to the "visible" 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) SetCurrentActiveMenu(s string)

SetCurrentActiveMenu sets the "current_active_menu" field.

func (m *MenuMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (m *MenuMutation) SetExtURL(s string)

SetExtURL sets the "ext_url" 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) SetHideBreadcrumb(b bool)

SetHideBreadcrumb sets the "hide_breadcrumb" 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 uint32)

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) SetIsExt(b bool)

SetIsExt sets the "is_ext" field.

func (m *MenuMutation) SetKeepAlive(b bool)

SetKeepAlive sets the "keep_alive" 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 uint32)

SetParentID sets the "parent_id" field.

func (m *MenuMutation) SetPath(s string)

SetPath sets the "path" field.

func (m *MenuMutation) SetPermissions(s []string)

SetPermissions sets the "permissions" field.

func (m *MenuMutation) SetRedirect(s string)

SetRedirect sets the "redirect" field.

func (m *MenuMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (m *MenuMutation) SetSort(i int32)

SetSort sets the "sort" field.

func (m *MenuMutation) SetState(i int32)

SetState sets the "state" field.

func (m *MenuMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (m *MenuMutation) SetType(i int32)

SetType sets the "type" field.

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

SetUpdatedAt sets the "updated_at" field.

func (m *MenuMutation) SetVisible(b bool)

SetVisible sets the "visible" field.

func (m *MenuMutation) Sort() (r int32, exists bool)

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

func (m *MenuMutation) State() (r int32, exists bool)

State returns the value of the "state" 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) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (m *MenuMutation) Visible() (r bool, exists bool)

Visible returns the value of the "visible" 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 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 (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) Filter() *MenuFilter

Filter returns a Filter implementation to apply filters on the MenuQuery builder.

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 uint32, 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) uint32

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 []uint32, err error)

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

func (mq *MenuQuery) IDsX(ctx context.Context) []uint32

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) Modify(modifiers ...func(s *sql.Selector)) *MenuSelect

Modify adds a query modifier for attaching custom logic to queries.

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 uint32, 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) uint32

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 (mq *MenuQuery) QueryChildren() *MenuQuery

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

func (mq *MenuQuery) QueryParent() *MenuQuery

QueryParent chains the current query on the "parent" 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.

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 (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 (ms *MenuSelect) Modify(modifiers ...func(s *sql.Selector)) *MenuSelect

Modify adds a query modifier for attaching custom logic to queries.

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 ...uint32) *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) AddSort(i int32) *MenuUpdate

AddSort adds i to the "sort" field.

func (mu *MenuUpdate) AddState(i int32) *MenuUpdate

AddState adds i to the "state" field.

func (mu *MenuUpdate) AddType(i int32) *MenuUpdate

AddType adds i to the "type" field.

func (mu *MenuUpdate) AppendPermissions(s []string) *MenuUpdate

AppendPermissions appends s to the "permissions" field.

func (mu *MenuUpdate) ClearChildren() *MenuUpdate

ClearChildren clears all "children" edges to the Menu entity.

func (mu *MenuUpdate) ClearDeletedAt() *MenuUpdate

ClearDeletedAt clears the value of the "deleted_at" 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) ClearPermissions() *MenuUpdate

ClearPermissions clears the value of the "permissions" field.

func (mu *MenuUpdate) ClearRemark() *MenuUpdate

ClearRemark clears the value of the "remark" field.

func (mu *MenuUpdate) ClearUpdatedAt() *MenuUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (mu *MenuUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (mu *MenuUpdate) ExecX(ctx context.Context)

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

func (mu *MenuUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MenuUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (mu *MenuUpdate) Mutation() *MenuMutation

Mutation returns the MenuMutation object of the builder.

func (mu *MenuUpdate) RemoveChildIDs(ids ...uint32) *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) 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) SetComponent(s string) *MenuUpdate

SetComponent sets the "component" field.

func (mu *MenuUpdate) SetCurrentActiveMenu(s string) *MenuUpdate

SetCurrentActiveMenu sets the "current_active_menu" field.

func (mu *MenuUpdate) SetDeletedAt(t time.Time) *MenuUpdate

SetDeletedAt sets the "deleted_at" field.

func (mu *MenuUpdate) SetExtURL(s string) *MenuUpdate

SetExtURL sets the "ext_url" field.

func (mu *MenuUpdate) SetHideBreadcrumb(b bool) *MenuUpdate

SetHideBreadcrumb sets the "hide_breadcrumb" 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) SetIsExt(b bool) *MenuUpdate

SetIsExt sets the "is_ext" field.

func (mu *MenuUpdate) SetKeepAlive(b bool) *MenuUpdate

SetKeepAlive sets the "keep_alive" field.

func (mu *MenuUpdate) SetName(s string) *MenuUpdate

SetName sets the "name" field.

func (mu *MenuUpdate) SetNillableComponent(s *string) *MenuUpdate

SetNillableComponent sets the "component" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableCurrentActiveMenu(s *string) *MenuUpdate

SetNillableCurrentActiveMenu sets the "current_active_menu" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableDeletedAt(t *time.Time) *MenuUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableExtURL(s *string) *MenuUpdate

SetNillableExtURL sets the "ext_url" 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) 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) SetNillableIsExt(b *bool) *MenuUpdate

SetNillableIsExt sets the "is_ext" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableKeepAlive(b *bool) *MenuUpdate

SetNillableKeepAlive sets the "keep_alive" 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 *uint32) *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) SetNillableRedirect(s *string) *MenuUpdate

SetNillableRedirect sets the "redirect" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableRemark(s *string) *MenuUpdate

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

func (mu *MenuUpdate) SetNillableSort(i *int32) *MenuUpdate

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

func (mu *MenuUpdate) SetNillableState(i *int32) *MenuUpdate

SetNillableState sets the "state" 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 (mu *MenuUpdate) SetNillableType(i *int32) *MenuUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (mu *MenuUpdate) SetNillableUpdatedAt(t *time.Time) *MenuUpdate

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

func (mu *MenuUpdate) SetNillableVisible(b *bool) *MenuUpdate

SetNillableVisible sets the "visible" field if the given value is not nil.

func (mu *MenuUpdate) SetParent(m *Menu) *MenuUpdate

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

func (mu *MenuUpdate) SetParentID(u uint32) *MenuUpdate

SetParentID sets the "parent_id" field.

func (mu *MenuUpdate) SetPath(s string) *MenuUpdate

SetPath sets the "path" field.

func (mu *MenuUpdate) SetPermissions(s []string) *MenuUpdate

SetPermissions sets the "permissions" field.

func (mu *MenuUpdate) SetRedirect(s string) *MenuUpdate

SetRedirect sets the "redirect" field.

func (mu *MenuUpdate) SetRemark(s string) *MenuUpdate

SetRemark sets the "remark" field.

func (mu *MenuUpdate) SetSort(i int32) *MenuUpdate

SetSort sets the "sort" field.

func (mu *MenuUpdate) SetState(i int32) *MenuUpdate

SetState sets the "state" field.

func (mu *MenuUpdate) SetTitle(s string) *MenuUpdate

SetTitle sets the "title" field.

func (mu *MenuUpdate) SetType(i int32) *MenuUpdate

SetType sets the "type" field.

func (mu *MenuUpdate) SetUpdatedAt(t time.Time) *MenuUpdate

SetUpdatedAt sets the "updated_at" field.

func (mu *MenuUpdate) SetVisible(b bool) *MenuUpdate

SetVisible sets the "visible" 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 ...uint32) *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) AddSort(i int32) *MenuUpdateOne

AddSort adds i to the "sort" field.

func (muo *MenuUpdateOne) AddState(i int32) *MenuUpdateOne

AddState adds i to the "state" field.

func (muo *MenuUpdateOne) AddType(i int32) *MenuUpdateOne

AddType adds i to the "type" field.

func (muo *MenuUpdateOne) AppendPermissions(s []string) *MenuUpdateOne

AppendPermissions appends s to the "permissions" field.

func (muo *MenuUpdateOne) ClearChildren() *MenuUpdateOne

ClearChildren clears all "children" edges to the Menu entity.

func (muo *MenuUpdateOne) ClearDeletedAt() *MenuUpdateOne

ClearDeletedAt clears the value of the "deleted_at" 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) ClearPermissions() *MenuUpdateOne

ClearPermissions clears the value of the "permissions" field.

func (muo *MenuUpdateOne) ClearRemark() *MenuUpdateOne

ClearRemark clears the value of the "remark" field.

func (muo *MenuUpdateOne) ClearUpdatedAt() *MenuUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (muo *MenuUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (muo *MenuUpdateOne) ExecX(ctx context.Context)

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

func (muo *MenuUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *MenuUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (muo *MenuUpdateOne) Mutation() *MenuMutation

Mutation returns the MenuMutation object of the builder.

func (muo *MenuUpdateOne) RemoveChildIDs(ids ...uint32) *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) 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) SetComponent(s string) *MenuUpdateOne

SetComponent sets the "component" field.

func (muo *MenuUpdateOne) SetCurrentActiveMenu(s string) *MenuUpdateOne

SetCurrentActiveMenu sets the "current_active_menu" field.

func (muo *MenuUpdateOne) SetDeletedAt(t time.Time) *MenuUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (muo *MenuUpdateOne) SetExtURL(s string) *MenuUpdateOne

SetExtURL sets the "ext_url" field.

func (muo *MenuUpdateOne) SetHideBreadcrumb(b bool) *MenuUpdateOne

SetHideBreadcrumb sets the "hide_breadcrumb" 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) SetIsExt(b bool) *MenuUpdateOne

SetIsExt sets the "is_ext" field.

func (muo *MenuUpdateOne) SetKeepAlive(b bool) *MenuUpdateOne

SetKeepAlive sets the "keep_alive" field.

func (muo *MenuUpdateOne) SetName(s string) *MenuUpdateOne

SetName sets the "name" field.

func (muo *MenuUpdateOne) SetNillableComponent(s *string) *MenuUpdateOne

SetNillableComponent sets the "component" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableCurrentActiveMenu(s *string) *MenuUpdateOne

SetNillableCurrentActiveMenu sets the "current_active_menu" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableDeletedAt(t *time.Time) *MenuUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableExtURL(s *string) *MenuUpdateOne

SetNillableExtURL sets the "ext_url" 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) 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) SetNillableIsExt(b *bool) *MenuUpdateOne

SetNillableIsExt sets the "is_ext" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableKeepAlive(b *bool) *MenuUpdateOne

SetNillableKeepAlive sets the "keep_alive" 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 *uint32) *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) SetNillableRedirect(s *string) *MenuUpdateOne

SetNillableRedirect sets the "redirect" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableRemark(s *string) *MenuUpdateOne

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

func (muo *MenuUpdateOne) SetNillableSort(i *int32) *MenuUpdateOne

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

func (muo *MenuUpdateOne) SetNillableState(i *int32) *MenuUpdateOne

SetNillableState sets the "state" 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 (muo *MenuUpdateOne) SetNillableType(i *int32) *MenuUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (muo *MenuUpdateOne) SetNillableUpdatedAt(t *time.Time) *MenuUpdateOne

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

func (muo *MenuUpdateOne) SetNillableVisible(b *bool) *MenuUpdateOne

SetNillableVisible sets the "visible" field if the given value is not nil.

func (muo *MenuUpdateOne) SetParent(m *Menu) *MenuUpdateOne

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

func (muo *MenuUpdateOne) SetParentID(u uint32) *MenuUpdateOne

SetParentID sets the "parent_id" field.

func (muo *MenuUpdateOne) SetPath(s string) *MenuUpdateOne

SetPath sets the "path" field.

func (muo *MenuUpdateOne) SetPermissions(s []string) *MenuUpdateOne

SetPermissions sets the "permissions" field.

func (muo *MenuUpdateOne) SetRedirect(s string) *MenuUpdateOne

SetRedirect sets the "redirect" field.

func (muo *MenuUpdateOne) SetRemark(s string) *MenuUpdateOne

SetRemark sets the "remark" field.

func (muo *MenuUpdateOne) SetSort(i int32) *MenuUpdateOne

SetSort sets the "sort" field.

func (muo *MenuUpdateOne) SetState(i int32) *MenuUpdateOne

SetState sets the "state" field.

func (muo *MenuUpdateOne) SetTitle(s string) *MenuUpdateOne

SetTitle sets the "title" field.

func (muo *MenuUpdateOne) SetType(i int32) *MenuUpdateOne

SetType sets the "type" field.

func (muo *MenuUpdateOne) SetUpdatedAt(t time.Time) *MenuUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (muo *MenuUpdateOne) SetVisible(b bool) *MenuUpdateOne

SetVisible sets the "visible" field.

func (muo *MenuUpdateOne) Where(ps ...predicate.Menu) *MenuUpdateOne

Where appends a list predicates to the MenuUpdate builder.

type MenuUpsert struct {
	*sql.UpdateSet
}

MenuUpsert is the "OnConflict" setter.

func (u *MenuUpsert) AddSort(v int32) *MenuUpsert

AddSort adds v to the "sort" field.

func (u *MenuUpsert) AddState(v int32) *MenuUpsert

AddState adds v to the "state" field.

func (u *MenuUpsert) AddType(v int32) *MenuUpsert

AddType adds v to the "type" field.

func (u *MenuUpsert) ClearDeletedAt() *MenuUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (u *MenuUpsert) ClearParentID() *MenuUpsert

ClearParentID clears the value of the "parent_id" field.

func (u *MenuUpsert) ClearPermissions() *MenuUpsert

ClearPermissions clears the value of the "permissions" field.

func (u *MenuUpsert) ClearRemark() *MenuUpsert

ClearRemark clears the value of the "remark" field.

func (u *MenuUpsert) ClearUpdatedAt() *MenuUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (u *MenuUpsert) SetComponent(v string) *MenuUpsert

SetComponent sets the "component" field.

func (u *MenuUpsert) SetCurrentActiveMenu(v string) *MenuUpsert

SetCurrentActiveMenu sets the "current_active_menu" field.

func (u *MenuUpsert) SetDeletedAt(v time.Time) *MenuUpsert

SetDeletedAt sets the "deleted_at" field.

func (u *MenuUpsert) SetExtURL(v string) *MenuUpsert

SetExtURL sets the "ext_url" field.

func (u *MenuUpsert) SetHideBreadcrumb(v bool) *MenuUpsert

SetHideBreadcrumb sets the "hide_breadcrumb" field.

func (u *MenuUpsert) SetHideMenu(v bool) *MenuUpsert

SetHideMenu sets the "hide_menu" field.

func (u *MenuUpsert) SetHideTab(v bool) *MenuUpsert

SetHideTab sets the "hide_tab" field.

func (u *MenuUpsert) SetIcon(v string) *MenuUpsert

SetIcon sets the "icon" field.

func (u *MenuUpsert) SetIsExt(v bool) *MenuUpsert

SetIsExt sets the "is_ext" field.

func (u *MenuUpsert) SetKeepAlive(v bool) *MenuUpsert

SetKeepAlive sets the "keep_alive" field.

func (u *MenuUpsert) SetName(v string) *MenuUpsert

SetName sets the "name" field.

func (u *MenuUpsert) SetParentID(v uint32) *MenuUpsert

SetParentID sets the "parent_id" field.

func (u *MenuUpsert) SetPath(v string) *MenuUpsert

SetPath sets the "path" field.

func (u *MenuUpsert) SetPermissions(v []string) *MenuUpsert

SetPermissions sets the "permissions" field.

func (u *MenuUpsert) SetRedirect(v string) *MenuUpsert

SetRedirect sets the "redirect" field.

func (u *MenuUpsert) SetRemark(v string) *MenuUpsert

SetRemark sets the "remark" field.

func (u *MenuUpsert) SetSort(v int32) *MenuUpsert

SetSort sets the "sort" field.

func (u *MenuUpsert) SetState(v int32) *MenuUpsert

SetState sets the "state" field.

func (u *MenuUpsert) SetTitle(v string) *MenuUpsert

SetTitle sets the "title" field.

func (u *MenuUpsert) SetType(v int32) *MenuUpsert

SetType sets the "type" field.

func (u *MenuUpsert) SetUpdatedAt(v time.Time) *MenuUpsert

SetUpdatedAt sets the "updated_at" field.

func (u *MenuUpsert) SetVisible(v bool) *MenuUpsert

SetVisible sets the "visible" field.

func (u *MenuUpsert) UpdateComponent() *MenuUpsert

UpdateComponent sets the "component" field to the value that was provided on create.

func (u *MenuUpsert) UpdateCurrentActiveMenu() *MenuUpsert

UpdateCurrentActiveMenu sets the "current_active_menu" field to the value that was provided on create.

func (u *MenuUpsert) UpdateDeletedAt() *MenuUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (u *MenuUpsert) UpdateExtURL() *MenuUpsert

UpdateExtURL sets the "ext_url" field to the value that was provided on create.

func (u *MenuUpsert) UpdateHideBreadcrumb() *MenuUpsert

UpdateHideBreadcrumb sets the "hide_breadcrumb" field to the value that was provided on create.

func (u *MenuUpsert) UpdateHideMenu() *MenuUpsert

UpdateHideMenu sets the "hide_menu" field to the value that was provided on create.

func (u *MenuUpsert) UpdateHideTab() *MenuUpsert

UpdateHideTab sets the "hide_tab" field to the value that was provided on create.

func (u *MenuUpsert) UpdateIcon() *MenuUpsert

UpdateIcon sets the "icon" field to the value that was provided on create.

func (u *MenuUpsert) UpdateIsExt() *MenuUpsert

UpdateIsExt sets the "is_ext" field to the value that was provided on create.

func (u *MenuUpsert) UpdateKeepAlive() *MenuUpsert

UpdateKeepAlive sets the "keep_alive" field to the value that was provided on create.

func (u *MenuUpsert) UpdateName() *MenuUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (u *MenuUpsert) UpdateParentID() *MenuUpsert

UpdateParentID sets the "parent_id" field to the value that was provided on create.

func (u *MenuUpsert) UpdatePath() *MenuUpsert

UpdatePath sets the "path" field to the value that was provided on create.

func (u *MenuUpsert) UpdatePermissions() *MenuUpsert

UpdatePermissions sets the "permissions" field to the value that was provided on create.

func (u *MenuUpsert) UpdateRedirect() *MenuUpsert

UpdateRedirect sets the "redirect" field to the value that was provided on create.

func (u *MenuUpsert) UpdateRemark() *MenuUpsert

UpdateRemark sets the "remark" field to the value that was provided on create.

func (u *MenuUpsert) UpdateSort() *MenuUpsert

UpdateSort sets the "sort" field to the value that was provided on create.

func (u *MenuUpsert) UpdateState() *MenuUpsert

UpdateState sets the "state" field to the value that was provided on create.

func (u *MenuUpsert) UpdateTitle() *MenuUpsert

UpdateTitle sets the "title" field to the value that was provided on create.

func (u *MenuUpsert) UpdateType() *MenuUpsert

UpdateType sets the "type" field to the value that was provided on create.

func (u *MenuUpsert) UpdateUpdatedAt() *MenuUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (u *MenuUpsert) UpdateVisible() *MenuUpsert

UpdateVisible sets the "visible" field to the value that was provided on create.

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

MenuUpsertBulk is the builder for "upsert"-ing a bulk of Menu nodes.

func (u *MenuUpsertBulk) AddSort(v int32) *MenuUpsertBulk

AddSort adds v to the "sort" field.

func (u *MenuUpsertBulk) AddState(v int32) *MenuUpsertBulk

AddState adds v to the "state" field.

func (u *MenuUpsertBulk) AddType(v int32) *MenuUpsertBulk

AddType adds v to the "type" field.

func (u *MenuUpsertBulk) ClearDeletedAt() *MenuUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (u *MenuUpsertBulk) ClearParentID() *MenuUpsertBulk

ClearParentID clears the value of the "parent_id" field.

func (u *MenuUpsertBulk) ClearPermissions() *MenuUpsertBulk

ClearPermissions clears the value of the "permissions" field.

func (u *MenuUpsertBulk) ClearRemark() *MenuUpsertBulk

ClearRemark clears the value of the "remark" field.

func (u *MenuUpsertBulk) ClearUpdatedAt() *MenuUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (u *MenuUpsertBulk) DoNothing() *MenuUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (u *MenuUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (u *MenuUpsertBulk) ExecX(ctx context.Context)

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

func (u *MenuUpsertBulk) Ignore() *MenuUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Menu.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)
func (u *MenuUpsertBulk) SetComponent(v string) *MenuUpsertBulk

SetComponent sets the "component" field.

func (u *MenuUpsertBulk) SetCurrentActiveMenu(v string) *MenuUpsertBulk

SetCurrentActiveMenu sets the "current_active_menu" field.

func (u *MenuUpsertBulk) SetDeletedAt(v time.Time) *MenuUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (u *MenuUpsertBulk) SetExtURL(v string) *MenuUpsertBulk

SetExtURL sets the "ext_url" field.

func (u *MenuUpsertBulk) SetHideBreadcrumb(v bool) *MenuUpsertBulk

SetHideBreadcrumb sets the "hide_breadcrumb" field.

func (u *MenuUpsertBulk) SetHideMenu(v bool) *MenuUpsertBulk

SetHideMenu sets the "hide_menu" field.

func (u *MenuUpsertBulk) SetHideTab(v bool) *MenuUpsertBulk

SetHideTab sets the "hide_tab" field.

func (u *MenuUpsertBulk) SetIcon(v string) *MenuUpsertBulk

SetIcon sets the "icon" field.

func (u *MenuUpsertBulk) SetIsExt(v bool) *MenuUpsertBulk

SetIsExt sets the "is_ext" field.

func (u *MenuUpsertBulk) SetKeepAlive(v bool) *MenuUpsertBulk

SetKeepAlive sets the "keep_alive" field.

func (u *MenuUpsertBulk) SetName(v string) *MenuUpsertBulk

SetName sets the "name" field.

func (u *MenuUpsertBulk) SetParentID(v uint32) *MenuUpsertBulk

SetParentID sets the "parent_id" field.

func (u *MenuUpsertBulk) SetPath(v string) *MenuUpsertBulk

SetPath sets the "path" field.

func (u *MenuUpsertBulk) SetPermissions(v []string) *MenuUpsertBulk

SetPermissions sets the "permissions" field.

func (u *MenuUpsertBulk) SetRedirect(v string) *MenuUpsertBulk

SetRedirect sets the "redirect" field.

func (u *MenuUpsertBulk) SetRemark(v string) *MenuUpsertBulk

SetRemark sets the "remark" field.

func (u *MenuUpsertBulk) SetSort(v int32) *MenuUpsertBulk

SetSort sets the "sort" field.

func (u *MenuUpsertBulk) SetState(v int32) *MenuUpsertBulk

SetState sets the "state" field.

func (u *MenuUpsertBulk) SetTitle(v string) *MenuUpsertBulk

SetTitle sets the "title" field.

func (u *MenuUpsertBulk) SetType(v int32) *MenuUpsertBulk

SetType sets the "type" field.

func (u *MenuUpsertBulk) SetUpdatedAt(v time.Time) *MenuUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (u *MenuUpsertBulk) SetVisible(v bool) *MenuUpsertBulk

SetVisible sets the "visible" field.

func (u *MenuUpsertBulk) Update(set func(*MenuUpsert)) *MenuUpsertBulk

Update allows overriding fields `UPDATE` values. See the MenuCreateBulk.OnConflict documentation for more info.

func (u *MenuUpsertBulk) UpdateComponent() *MenuUpsertBulk

UpdateComponent sets the "component" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateCurrentActiveMenu() *MenuUpsertBulk

UpdateCurrentActiveMenu sets the "current_active_menu" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateDeletedAt() *MenuUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateExtURL() *MenuUpsertBulk

UpdateExtURL sets the "ext_url" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateHideBreadcrumb() *MenuUpsertBulk

UpdateHideBreadcrumb sets the "hide_breadcrumb" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateHideMenu() *MenuUpsertBulk

UpdateHideMenu sets the "hide_menu" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateHideTab() *MenuUpsertBulk

UpdateHideTab sets the "hide_tab" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateIcon() *MenuUpsertBulk

UpdateIcon sets the "icon" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateIsExt() *MenuUpsertBulk

UpdateIsExt sets the "is_ext" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateKeepAlive() *MenuUpsertBulk

UpdateKeepAlive sets the "keep_alive" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateName() *MenuUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateNewValues() *MenuUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Menu.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(menu.FieldID)
		}),
	).
	Exec(ctx)
func (u *MenuUpsertBulk) UpdateParentID() *MenuUpsertBulk

UpdateParentID sets the "parent_id" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdatePath() *MenuUpsertBulk

UpdatePath sets the "path" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdatePermissions() *MenuUpsertBulk

UpdatePermissions sets the "permissions" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateRedirect() *MenuUpsertBulk

UpdateRedirect sets the "redirect" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateRemark() *MenuUpsertBulk

UpdateRemark sets the "remark" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateSort() *MenuUpsertBulk

UpdateSort sets the "sort" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateState() *MenuUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateTitle() *MenuUpsertBulk

UpdateTitle sets the "title" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateType() *MenuUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateUpdatedAt() *MenuUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (u *MenuUpsertBulk) UpdateVisible() *MenuUpsertBulk

UpdateVisible sets the "visible" field to the value that was provided on create.

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

MenuUpsertOne is the builder for "upsert"-ing

one Menu node.
func (u *MenuUpsertOne) AddSort(v int32) *MenuUpsertOne

AddSort adds v to the "sort" field.

func (u *MenuUpsertOne) AddState(v int32) *MenuUpsertOne

AddState adds v to the "state" field.

func (u *MenuUpsertOne) AddType(v int32) *MenuUpsertOne

AddType adds v to the "type" field.

func (u *MenuUpsertOne) ClearDeletedAt() *MenuUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (u *MenuUpsertOne) ClearParentID() *MenuUpsertOne

ClearParentID clears the value of the "parent_id" field.

func (u *MenuUpsertOne) ClearPermissions() *MenuUpsertOne

ClearPermissions clears the value of the "permissions" field.

func (u *MenuUpsertOne) ClearRemark() *MenuUpsertOne

ClearRemark clears the value of the "remark" field.

func (u *MenuUpsertOne) ClearUpdatedAt() *MenuUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (u *MenuUpsertOne) DoNothing() *MenuUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (u *MenuUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (u *MenuUpsertOne) ExecX(ctx context.Context)

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

func (u *MenuUpsertOne) ID(ctx context.Context) (id uint32, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (u *MenuUpsertOne) IDX(ctx context.Context) uint32

IDX is like ID, but panics if an error occurs.

func (u *MenuUpsertOne) Ignore() *MenuUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Menu.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)
func (u *MenuUpsertOne) SetComponent(v string) *MenuUpsertOne

SetComponent sets the "component" field.

func (u *MenuUpsertOne) SetCurrentActiveMenu(v string) *MenuUpsertOne

SetCurrentActiveMenu sets the "current_active_menu" field.

func (u *MenuUpsertOne) SetDeletedAt(v time.Time) *MenuUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (u *MenuUpsertOne) SetExtURL(v string) *MenuUpsertOne

SetExtURL sets the "ext_url" field.

func (u *MenuUpsertOne) SetHideBreadcrumb(v bool) *MenuUpsertOne

SetHideBreadcrumb sets the "hide_breadcrumb" field.

func (u *MenuUpsertOne) SetHideMenu(v bool) *MenuUpsertOne

SetHideMenu sets the "hide_menu" field.

func (u *MenuUpsertOne) SetHideTab(v bool) *MenuUpsertOne

SetHideTab sets the "hide_tab" field.

func (u *MenuUpsertOne) SetIcon(v string) *MenuUpsertOne

SetIcon sets the "icon" field.

func (u *MenuUpsertOne) SetIsExt(v bool) *MenuUpsertOne

SetIsExt sets the "is_ext" field.

func (u *MenuUpsertOne) SetKeepAlive(v bool) *MenuUpsertOne

SetKeepAlive sets the "keep_alive" field.

func (u *MenuUpsertOne) SetName(v string) *MenuUpsertOne

SetName sets the "name" field.

func (u *MenuUpsertOne) SetParentID(v uint32) *MenuUpsertOne

SetParentID sets the "parent_id" field.

func (u *MenuUpsertOne) SetPath(v string) *MenuUpsertOne

SetPath sets the "path" field.

func (u *MenuUpsertOne) SetPermissions(v []string) *MenuUpsertOne

SetPermissions sets the "permissions" field.

func (u *MenuUpsertOne) SetRedirect(v string) *MenuUpsertOne

SetRedirect sets the "redirect" field.

func (u *MenuUpsertOne) SetRemark(v string) *MenuUpsertOne

SetRemark sets the "remark" field.

func (u *MenuUpsertOne) SetSort(v int32) *MenuUpsertOne

SetSort sets the "sort" field.

func (u *MenuUpsertOne) SetState(v int32) *MenuUpsertOne

SetState sets the "state" field.

func (u *MenuUpsertOne) SetTitle(v string) *MenuUpsertOne

SetTitle sets the "title" field.

func (u *MenuUpsertOne) SetType(v int32) *MenuUpsertOne

SetType sets the "type" field.

func (u *MenuUpsertOne) SetUpdatedAt(v time.Time) *MenuUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (u *MenuUpsertOne) SetVisible(v bool) *MenuUpsertOne

SetVisible sets the "visible" field.

func (u *MenuUpsertOne) Update(set func(*MenuUpsert)) *MenuUpsertOne

Update allows overriding fields `UPDATE` values. See the MenuCreate.OnConflict documentation for more info.

func (u *MenuUpsertOne) UpdateComponent() *MenuUpsertOne

UpdateComponent sets the "component" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateCurrentActiveMenu() *MenuUpsertOne

UpdateCurrentActiveMenu sets the "current_active_menu" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateDeletedAt() *MenuUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateExtURL() *MenuUpsertOne

UpdateExtURL sets the "ext_url" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateHideBreadcrumb() *MenuUpsertOne

UpdateHideBreadcrumb sets the "hide_breadcrumb" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateHideMenu() *MenuUpsertOne

UpdateHideMenu sets the "hide_menu" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateHideTab() *MenuUpsertOne

UpdateHideTab sets the "hide_tab" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateIcon() *MenuUpsertOne

UpdateIcon sets the "icon" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateIsExt() *MenuUpsertOne

UpdateIsExt sets the "is_ext" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateKeepAlive() *MenuUpsertOne

UpdateKeepAlive sets the "keep_alive" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateName() *MenuUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateNewValues() *MenuUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Menu.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(menu.FieldID)
		}),
	).
	Exec(ctx)
func (u *MenuUpsertOne) UpdateParentID() *MenuUpsertOne

UpdateParentID sets the "parent_id" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdatePath() *MenuUpsertOne

UpdatePath sets the "path" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdatePermissions() *MenuUpsertOne

UpdatePermissions sets the "permissions" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateRedirect() *MenuUpsertOne

UpdateRedirect sets the "redirect" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateRemark() *MenuUpsertOne

UpdateRemark sets the "remark" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateSort() *MenuUpsertOne

UpdateSort sets the "sort" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateState() *MenuUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateTitle() *MenuUpsertOne

UpdateTitle sets the "title" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateType() *MenuUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateUpdatedAt() *MenuUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

func (u *MenuUpsertOne) UpdateVisible() *MenuUpsertOne

UpdateVisible sets the "visible" field to the value that was provided on create.

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 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 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 Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Post

type Post struct {

	// ID of the ent.
	// id
	ID uint32 `json:"id,omitempty"`
	// 创建时间
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// 更新时间
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// 删除时间
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// 备注
	Remark *string `json:"remark,omitempty"`
	// 排序
	Sort *int32 `json:"sort,omitempty"`
	// 状态 0 UNSPECIFIED 开启 1 -> ACTIVE 关闭 2 -> INACTIVE, 禁用 3 -> BANNED
	State *int32 `json:"state,omitempty"`
	// 名称
	Name *string `json:"name,omitempty"`
	// contains filtered or unexported fields
}

岗位表

func (*Post) String

func (po *Post) String() string

String implements the fmt.Stringer.

func (*Post) Unwrap

func (po *Post) Unwrap() *Post

Unwrap unwraps the Post 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 (*Post) Update

func (po *Post) Update() *PostUpdateOne

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

func (*Post) Value

func (po *Post) Value(name string) (ent.Value, error)

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

type PostClient

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

PostClient is a client for the Post schema.

func NewPostClient

func NewPostClient(c config) *PostClient

NewPostClient returns a client for the Post from the given config.

func (*PostClient) Create

func (c *PostClient) Create() *PostCreate

Create returns a builder for creating a Post entity.

func (*PostClient) CreateBulk

func (c *PostClient) CreateBulk(builders ...*PostCreate) *PostCreateBulk

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

func (*PostClient) Delete

func (c *PostClient) Delete() *PostDelete

Delete returns a delete builder for Post.

func (*PostClient) DeleteOne

func (c *PostClient) DeleteOne(po *Post) *PostDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PostClient) DeleteOneID

func (c *PostClient) DeleteOneID(id uint32) *PostDeleteOne

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

func (*PostClient) Get

func (c *PostClient) Get(ctx context.Context, id uint32) (*Post, error)

Get returns a Post entity by its id.

func (*PostClient) GetX

func (c *PostClient) GetX(ctx context.Context, id uint32) *Post

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

func (*PostClient) Hooks

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

Hooks returns the client hooks.

func (*PostClient) Intercept

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

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

func (*PostClient) Interceptors

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

Interceptors returns the client interceptors.

func (*PostClient) MapCreateBulk

func (c *PostClient) MapCreateBulk(slice any, setFunc func(*PostCreate, int)) *PostCreateBulk

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 (*PostClient) Query

func (c *PostClient) Query() *PostQuery

Query returns a query builder for Post.

func (*PostClient) Update

func (c *PostClient) Update() *PostUpdate

Update returns an update builder for Post.

func (*PostClient) UpdateOne

func (c *PostClient) UpdateOne(po *Post) *PostUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PostClient) UpdateOneID

func (c *PostClient) UpdateOneID(id uint32) *PostUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PostClient) Use

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

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

type PostCreate

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

PostCreate is the builder for creating a Post entity.

func (*PostCreate) Exec

func (pc *PostCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PostCreate) ExecX

func (pc *PostCreate) ExecX(ctx context.Context)

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

func (*PostCreate) Mutation

func (pc *PostCreate) Mutation() *PostMutation

Mutation returns the PostMutation object of the builder.

func (*PostCreate) OnConflict

func (pc *PostCreate) OnConflict(opts ...sql.ConflictOption) *PostUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Post.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PostUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*PostCreate) OnConflictColumns

func (pc *PostCreate) OnConflictColumns(columns ...string) *PostUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Post.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PostCreate) Save

func (pc *PostCreate) Save(ctx context.Context) (*Post, error)

Save creates the Post in the database.

func (*PostCreate) SaveX

func (pc *PostCreate) SaveX(ctx context.Context) *Post

SaveX calls Save and panics if Save returns an error.

func (*PostCreate) SetCreatedAt

func (pc *PostCreate) SetCreatedAt(t time.Time) *PostCreate

SetCreatedAt sets the "created_at" field.

func (*PostCreate) SetDeletedAt

func (pc *PostCreate) SetDeletedAt(t time.Time) *PostCreate

SetDeletedAt sets the "deleted_at" field.

func (*PostCreate) SetID

func (pc *PostCreate) SetID(u uint32) *PostCreate

SetID sets the "id" field.

func (*PostCreate) SetName

func (pc *PostCreate) SetName(s string) *PostCreate

SetName sets the "name" field.

func (*PostCreate) SetNillableCreatedAt

func (pc *PostCreate) SetNillableCreatedAt(t *time.Time) *PostCreate

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

func (*PostCreate) SetNillableDeletedAt

func (pc *PostCreate) SetNillableDeletedAt(t *time.Time) *PostCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PostCreate) SetNillableName

func (pc *PostCreate) SetNillableName(s *string) *PostCreate

SetNillableName sets the "name" field if the given value is not nil.

func (*PostCreate) SetNillableRemark

func (pc *PostCreate) SetNillableRemark(s *string) *PostCreate

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

func (*PostCreate) SetNillableSort

func (pc *PostCreate) SetNillableSort(i *int32) *PostCreate

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

func (*PostCreate) SetNillableState

func (pc *PostCreate) SetNillableState(i *int32) *PostCreate

SetNillableState sets the "state" field if the given value is not nil.

func (*PostCreate) SetNillableUpdatedAt

func (pc *PostCreate) SetNillableUpdatedAt(t *time.Time) *PostCreate

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

func (*PostCreate) SetRemark

func (pc *PostCreate) SetRemark(s string) *PostCreate

SetRemark sets the "remark" field.

func (*PostCreate) SetSort

func (pc *PostCreate) SetSort(i int32) *PostCreate

SetSort sets the "sort" field.

func (*PostCreate) SetState

func (pc *PostCreate) SetState(i int32) *PostCreate

SetState sets the "state" field.

func (*PostCreate) SetUpdatedAt

func (pc *PostCreate) SetUpdatedAt(t time.Time) *PostCreate

SetUpdatedAt sets the "updated_at" field.

type PostCreateBulk

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

PostCreateBulk is the builder for creating many Post entities in bulk.

func (*PostCreateBulk) Exec

func (pcb *PostCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PostCreateBulk) ExecX

func (pcb *PostCreateBulk) ExecX(ctx context.Context)

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

func (*PostCreateBulk) OnConflict

func (pcb *PostCreateBulk) OnConflict(opts ...sql.ConflictOption) *PostUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Post.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.PostUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*PostCreateBulk) OnConflictColumns

func (pcb *PostCreateBulk) OnConflictColumns(columns ...string) *PostUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Post.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*PostCreateBulk) Save

func (pcb *PostCreateBulk) Save(ctx context.Context) ([]*Post, error)

Save creates the Post entities in the database.

func (*PostCreateBulk) SaveX

func (pcb *PostCreateBulk) SaveX(ctx context.Context) []*Post

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

type PostDelete

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

PostDelete is the builder for deleting a Post entity.

func (*PostDelete) Exec

func (pd *PostDelete) Exec(ctx context.Context) (int, error)

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

func (*PostDelete) ExecX

func (pd *PostDelete) ExecX(ctx context.Context) int

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

func (*PostDelete) Where

func (pd *PostDelete) Where(ps ...predicate.Post) *PostDelete

Where appends a list predicates to the PostDelete builder.

type PostDeleteOne

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

PostDeleteOne is the builder for deleting a single Post entity.

func (*PostDeleteOne) Exec

func (pdo *PostDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PostDeleteOne) ExecX

func (pdo *PostDeleteOne) ExecX(ctx context.Context)

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

func (*PostDeleteOne) Where

func (pdo *PostDeleteOne) Where(ps ...predicate.Post) *PostDeleteOne

Where appends a list predicates to the PostDelete builder.

type PostFilter

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

PostFilter provides a generic filtering capability at runtime for PostQuery.

func (*PostFilter) Where

func (f *PostFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*PostFilter) WhereCreatedAt

func (f *PostFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*PostFilter) WhereDeletedAt

func (f *PostFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*PostFilter) WhereID

func (f *PostFilter) WhereID(p entql.Uint32P)

WhereID applies the entql uint32 predicate on the id field.

func (*PostFilter) WhereName

func (f *PostFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

func (*PostFilter) WhereRemark

func (f *PostFilter) WhereRemark(p entql.StringP)

WhereRemark applies the entql string predicate on the remark field.

func (*PostFilter) WhereSort

func (f *PostFilter) WhereSort(p entql.Int32P)

WhereSort applies the entql int32 predicate on the sort field.

func (*PostFilter) WhereState

func (f *PostFilter) WhereState(p entql.Int32P)

WhereState applies the entql int32 predicate on the state field.

func (*PostFilter) WhereUpdatedAt

func (f *PostFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

type PostGroupBy

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

PostGroupBy is the group-by builder for Post entities.

func (*PostGroupBy) Aggregate

func (pgb *PostGroupBy) Aggregate(fns ...AggregateFunc) *PostGroupBy

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

func (*PostGroupBy) Bool

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

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

func (*PostGroupBy) BoolX

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

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

func (*PostGroupBy) Bools

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

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

func (*PostGroupBy) BoolsX

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

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

func (*PostGroupBy) Float64

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

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

func (*PostGroupBy) Float64X

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

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

func (*PostGroupBy) Float64s

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

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

func (*PostGroupBy) Float64sX

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

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

func (*PostGroupBy) Int

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

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

func (*PostGroupBy) IntX

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

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

func (*PostGroupBy) Ints

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

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

func (*PostGroupBy) IntsX

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

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

func (*PostGroupBy) Scan

func (pgb *PostGroupBy) Scan(ctx context.Context, v any) error

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

func (*PostGroupBy) ScanX

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

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

func (*PostGroupBy) String

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

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

func (*PostGroupBy) StringX

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

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

func (*PostGroupBy) Strings

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

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

func (*PostGroupBy) StringsX

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

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

type PostMutation

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

PostMutation represents an operation that mutates the Post nodes in the graph.

func (*PostMutation) AddField

func (m *PostMutation) 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 (*PostMutation) AddSort

func (m *PostMutation) AddSort(i int32)

AddSort adds i to the "sort" field.

func (*PostMutation) AddState

func (m *PostMutation) AddState(i int32)

AddState adds i to the "state" field.

func (*PostMutation) AddedEdges

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

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

func (*PostMutation) AddedField

func (m *PostMutation) 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 (*PostMutation) AddedFields

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

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

func (*PostMutation) AddedIDs

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

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

func (*PostMutation) AddedSort

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

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

func (*PostMutation) AddedState

func (m *PostMutation) AddedState() (r int32, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*PostMutation) ClearCreatedAt

func (m *PostMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*PostMutation) ClearDeletedAt

func (m *PostMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PostMutation) ClearEdge

func (m *PostMutation) 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 (*PostMutation) ClearField

func (m *PostMutation) 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 (*PostMutation) ClearRemark

func (m *PostMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*PostMutation) ClearUpdatedAt

func (m *PostMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PostMutation) ClearedEdges

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

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

func (*PostMutation) ClearedFields

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

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

func (PostMutation) Client

func (m PostMutation) 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 (*PostMutation) CreatedAt

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

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

func (*PostMutation) CreatedAtCleared

func (m *PostMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*PostMutation) DeletedAt

func (m *PostMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*PostMutation) DeletedAtCleared

func (m *PostMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*PostMutation) EdgeCleared

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

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

func (*PostMutation) Field

func (m *PostMutation) 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 (*PostMutation) FieldCleared

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

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

func (*PostMutation) Fields

func (m *PostMutation) 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 (*PostMutation) Filter

func (m *PostMutation) Filter() *PostFilter

Filter returns an entql.Where implementation to apply filters on the PostMutation builder.

func (*PostMutation) ID

func (m *PostMutation) ID() (id uint32, 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 (*PostMutation) IDs

func (m *PostMutation) IDs(ctx context.Context) ([]uint32, 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 (*PostMutation) Name

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

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

func (*PostMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Post entity. If the Post 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 (*PostMutation) OldDeletedAt

func (m *PostMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Post entity. If the Post 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 (*PostMutation) OldField

func (m *PostMutation) 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 (*PostMutation) OldName

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

OldName returns the old "name" field's value of the Post entity. If the Post 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 (*PostMutation) OldRemark

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

OldRemark returns the old "remark" field's value of the Post entity. If the Post 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 (*PostMutation) OldSort

func (m *PostMutation) OldSort(ctx context.Context) (v *int32, err error)

OldSort returns the old "sort" field's value of the Post entity. If the Post 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 (*PostMutation) OldState

func (m *PostMutation) OldState(ctx context.Context) (v *int32, err error)

OldState returns the old "state" field's value of the Post entity. If the Post 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 (*PostMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Post entity. If the Post 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 (*PostMutation) Op

func (m *PostMutation) Op() Op

Op returns the operation name.

func (*PostMutation) Remark

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

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

func (*PostMutation) RemarkCleared

func (m *PostMutation) RemarkCleared() bool

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

func (*PostMutation) RemovedEdges

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

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

func (*PostMutation) RemovedIDs

func (m *PostMutation) 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 (*PostMutation) ResetCreatedAt

func (m *PostMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PostMutation) ResetDeletedAt

func (m *PostMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*PostMutation) ResetEdge

func (m *PostMutation) 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 (*PostMutation) ResetField

func (m *PostMutation) 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 (*PostMutation) ResetName

func (m *PostMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*PostMutation) ResetRemark

func (m *PostMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*PostMutation) ResetSort

func (m *PostMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*PostMutation) ResetState

func (m *PostMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*PostMutation) ResetUpdatedAt

func (m *PostMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PostMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*PostMutation) SetDeletedAt

func (m *PostMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*PostMutation) SetField

func (m *PostMutation) 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 (*PostMutation) SetID

func (m *PostMutation) SetID(id uint32)

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

func (*PostMutation) SetName

func (m *PostMutation) SetName(s string)

SetName sets the "name" field.

func (*PostMutation) SetOp

func (m *PostMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PostMutation) SetRemark

func (m *PostMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*PostMutation) SetSort

func (m *PostMutation) SetSort(i int32)

SetSort sets the "sort" field.

func (*PostMutation) SetState

func (m *PostMutation) SetState(i int32)

SetState sets the "state" field.

func (*PostMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*PostMutation) Sort

func (m *PostMutation) Sort() (r int32, exists bool)

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

func (*PostMutation) State

func (m *PostMutation) State() (r int32, exists bool)

State returns the value of the "state" field in the mutation.

func (PostMutation) Tx

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

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

func (*PostMutation) Type

func (m *PostMutation) Type() string

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

func (*PostMutation) UpdatedAt

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

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

func (*PostMutation) UpdatedAtCleared

func (m *PostMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*PostMutation) Where

func (m *PostMutation) Where(ps ...predicate.Post)

Where appends a list predicates to the PostMutation builder.

func (*PostMutation) WhereP

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

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

type PostQuery

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

PostQuery is the builder for querying Post entities.

func (*PostQuery) Aggregate

func (pq *PostQuery) Aggregate(fns ...AggregateFunc) *PostSelect

Aggregate returns a PostSelect configured with the given aggregations.

func (*PostQuery) All

func (pq *PostQuery) All(ctx context.Context) ([]*Post, error)

All executes the query and returns a list of Posts.

func (*PostQuery) AllX

func (pq *PostQuery) AllX(ctx context.Context) []*Post

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

func (*PostQuery) Clone

func (pq *PostQuery) Clone() *PostQuery

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

func (*PostQuery) Count

func (pq *PostQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PostQuery) CountX

func (pq *PostQuery) CountX(ctx context.Context) int

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

func (*PostQuery) Exist

func (pq *PostQuery) Exist(ctx context.Context) (bool, error)

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

func (*PostQuery) ExistX

func (pq *PostQuery) ExistX(ctx context.Context) bool

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

func (*PostQuery) Filter

func (pq *PostQuery) Filter() *PostFilter

Filter returns a Filter implementation to apply filters on the PostQuery builder.

func (*PostQuery) First

func (pq *PostQuery) First(ctx context.Context) (*Post, error)

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

func (*PostQuery) FirstID

func (pq *PostQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*PostQuery) FirstIDX

func (pq *PostQuery) FirstIDX(ctx context.Context) uint32

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

func (*PostQuery) FirstX

func (pq *PostQuery) FirstX(ctx context.Context) *Post

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

func (*PostQuery) GroupBy

func (pq *PostQuery) GroupBy(field string, fields ...string) *PostGroupBy

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.Post.Query().
	GroupBy(post.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PostQuery) IDs

func (pq *PostQuery) IDs(ctx context.Context) (ids []uint32, err error)

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

func (*PostQuery) IDsX

func (pq *PostQuery) IDsX(ctx context.Context) []uint32

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

func (*PostQuery) Limit

func (pq *PostQuery) Limit(limit int) *PostQuery

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

func (*PostQuery) Modify

func (pq *PostQuery) Modify(modifiers ...func(s *sql.Selector)) *PostSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*PostQuery) Offset

func (pq *PostQuery) Offset(offset int) *PostQuery

Offset to start from.

func (*PostQuery) Only

func (pq *PostQuery) Only(ctx context.Context) (*Post, error)

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

func (*PostQuery) OnlyID

func (pq *PostQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*PostQuery) OnlyIDX

func (pq *PostQuery) OnlyIDX(ctx context.Context) uint32

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

func (*PostQuery) OnlyX

func (pq *PostQuery) OnlyX(ctx context.Context) *Post

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

func (*PostQuery) Order

func (pq *PostQuery) Order(o ...post.OrderOption) *PostQuery

Order specifies how the records should be ordered.

func (*PostQuery) Select

func (pq *PostQuery) Select(fields ...string) *PostSelect

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.Post.Query().
	Select(post.FieldCreatedAt).
	Scan(ctx, &v)

func (*PostQuery) Unique

func (pq *PostQuery) Unique(unique bool) *PostQuery

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 (*PostQuery) Where

func (pq *PostQuery) Where(ps ...predicate.Post) *PostQuery

Where adds a new predicate for the PostQuery builder.

type PostSelect

type PostSelect struct {
	*PostQuery
	// contains filtered or unexported fields
}

PostSelect is the builder for selecting fields of Post entities.

func (*PostSelect) Aggregate

func (ps *PostSelect) Aggregate(fns ...AggregateFunc) *PostSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PostSelect) Bool

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

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

func (*PostSelect) BoolX

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

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

func (*PostSelect) Bools

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

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

func (*PostSelect) BoolsX

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

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

func (*PostSelect) Float64

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

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

func (*PostSelect) Float64X

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

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

func (*PostSelect) Float64s

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

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

func (*PostSelect) Float64sX

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

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

func (*PostSelect) Int

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

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

func (*PostSelect) IntX

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

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

func (*PostSelect) Ints

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

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

func (*PostSelect) IntsX

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

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

func (*PostSelect) Modify

func (ps *PostSelect) Modify(modifiers ...func(s *sql.Selector)) *PostSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*PostSelect) Scan

func (ps *PostSelect) Scan(ctx context.Context, v any) error

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

func (*PostSelect) ScanX

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

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

func (*PostSelect) String

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

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

func (*PostSelect) StringX

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

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

func (*PostSelect) Strings

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

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

func (*PostSelect) StringsX

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

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

type PostUpdate

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

PostUpdate is the builder for updating Post entities.

func (*PostUpdate) AddSort

func (pu *PostUpdate) AddSort(i int32) *PostUpdate

AddSort adds i to the "sort" field.

func (*PostUpdate) AddState

func (pu *PostUpdate) AddState(i int32) *PostUpdate

AddState adds i to the "state" field.

func (*PostUpdate) ClearDeletedAt

func (pu *PostUpdate) ClearDeletedAt() *PostUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PostUpdate) ClearRemark

func (pu *PostUpdate) ClearRemark() *PostUpdate

ClearRemark clears the value of the "remark" field.

func (*PostUpdate) ClearUpdatedAt

func (pu *PostUpdate) ClearUpdatedAt() *PostUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PostUpdate) Exec

func (pu *PostUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PostUpdate) ExecX

func (pu *PostUpdate) ExecX(ctx context.Context)

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

func (*PostUpdate) Modify

func (pu *PostUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PostUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*PostUpdate) Mutation

func (pu *PostUpdate) Mutation() *PostMutation

Mutation returns the PostMutation object of the builder.

func (*PostUpdate) Save

func (pu *PostUpdate) Save(ctx context.Context) (int, error)

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

func (*PostUpdate) SaveX

func (pu *PostUpdate) SaveX(ctx context.Context) int

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

func (*PostUpdate) SetDeletedAt

func (pu *PostUpdate) SetDeletedAt(t time.Time) *PostUpdate

SetDeletedAt sets the "deleted_at" field.

func (*PostUpdate) SetName

func (pu *PostUpdate) SetName(s string) *PostUpdate

SetName sets the "name" field.

func (*PostUpdate) SetNillableDeletedAt

func (pu *PostUpdate) SetNillableDeletedAt(t *time.Time) *PostUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PostUpdate) SetNillableName

func (pu *PostUpdate) SetNillableName(s *string) *PostUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*PostUpdate) SetNillableRemark

func (pu *PostUpdate) SetNillableRemark(s *string) *PostUpdate

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

func (*PostUpdate) SetNillableSort

func (pu *PostUpdate) SetNillableSort(i *int32) *PostUpdate

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

func (*PostUpdate) SetNillableState

func (pu *PostUpdate) SetNillableState(i *int32) *PostUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*PostUpdate) SetNillableUpdatedAt

func (pu *PostUpdate) SetNillableUpdatedAt(t *time.Time) *PostUpdate

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

func (*PostUpdate) SetRemark

func (pu *PostUpdate) SetRemark(s string) *PostUpdate

SetRemark sets the "remark" field.

func (*PostUpdate) SetSort

func (pu *PostUpdate) SetSort(i int32) *PostUpdate

SetSort sets the "sort" field.

func (*PostUpdate) SetState

func (pu *PostUpdate) SetState(i int32) *PostUpdate

SetState sets the "state" field.

func (*PostUpdate) SetUpdatedAt

func (pu *PostUpdate) SetUpdatedAt(t time.Time) *PostUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PostUpdate) Where

func (pu *PostUpdate) Where(ps ...predicate.Post) *PostUpdate

Where appends a list predicates to the PostUpdate builder.

type PostUpdateOne

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

PostUpdateOne is the builder for updating a single Post entity.

func (*PostUpdateOne) AddSort

func (puo *PostUpdateOne) AddSort(i int32) *PostUpdateOne

AddSort adds i to the "sort" field.

func (*PostUpdateOne) AddState

func (puo *PostUpdateOne) AddState(i int32) *PostUpdateOne

AddState adds i to the "state" field.

func (*PostUpdateOne) ClearDeletedAt

func (puo *PostUpdateOne) ClearDeletedAt() *PostUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PostUpdateOne) ClearRemark

func (puo *PostUpdateOne) ClearRemark() *PostUpdateOne

ClearRemark clears the value of the "remark" field.

func (*PostUpdateOne) ClearUpdatedAt

func (puo *PostUpdateOne) ClearUpdatedAt() *PostUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PostUpdateOne) Exec

func (puo *PostUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PostUpdateOne) ExecX

func (puo *PostUpdateOne) ExecX(ctx context.Context)

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

func (*PostUpdateOne) Modify

func (puo *PostUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *PostUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*PostUpdateOne) Mutation

func (puo *PostUpdateOne) Mutation() *PostMutation

Mutation returns the PostMutation object of the builder.

func (*PostUpdateOne) Save

func (puo *PostUpdateOne) Save(ctx context.Context) (*Post, error)

Save executes the query and returns the updated Post entity.

func (*PostUpdateOne) SaveX

func (puo *PostUpdateOne) SaveX(ctx context.Context) *Post

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

func (*PostUpdateOne) Select

func (puo *PostUpdateOne) Select(field string, fields ...string) *PostUpdateOne

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

func (*PostUpdateOne) SetDeletedAt

func (puo *PostUpdateOne) SetDeletedAt(t time.Time) *PostUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*PostUpdateOne) SetName

func (puo *PostUpdateOne) SetName(s string) *PostUpdateOne

SetName sets the "name" field.

func (*PostUpdateOne) SetNillableDeletedAt

func (puo *PostUpdateOne) SetNillableDeletedAt(t *time.Time) *PostUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*PostUpdateOne) SetNillableName

func (puo *PostUpdateOne) SetNillableName(s *string) *PostUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*PostUpdateOne) SetNillableRemark

func (puo *PostUpdateOne) SetNillableRemark(s *string) *PostUpdateOne

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

func (*PostUpdateOne) SetNillableSort

func (puo *PostUpdateOne) SetNillableSort(i *int32) *PostUpdateOne

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

func (*PostUpdateOne) SetNillableState

func (puo *PostUpdateOne) SetNillableState(i *int32) *PostUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*PostUpdateOne) SetNillableUpdatedAt

func (puo *PostUpdateOne) SetNillableUpdatedAt(t *time.Time) *PostUpdateOne

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

func (*PostUpdateOne) SetRemark

func (puo *PostUpdateOne) SetRemark(s string) *PostUpdateOne

SetRemark sets the "remark" field.

func (*PostUpdateOne) SetSort

func (puo *PostUpdateOne) SetSort(i int32) *PostUpdateOne

SetSort sets the "sort" field.

func (*PostUpdateOne) SetState

func (puo *PostUpdateOne) SetState(i int32) *PostUpdateOne

SetState sets the "state" field.

func (*PostUpdateOne) SetUpdatedAt

func (puo *PostUpdateOne) SetUpdatedAt(t time.Time) *PostUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PostUpdateOne) Where

func (puo *PostUpdateOne) Where(ps ...predicate.Post) *PostUpdateOne

Where appends a list predicates to the PostUpdate builder.

type PostUpsert

type PostUpsert struct {
	*sql.UpdateSet
}

PostUpsert is the "OnConflict" setter.

func (*PostUpsert) AddSort

func (u *PostUpsert) AddSort(v int32) *PostUpsert

AddSort adds v to the "sort" field.

func (*PostUpsert) AddState

func (u *PostUpsert) AddState(v int32) *PostUpsert

AddState adds v to the "state" field.

func (*PostUpsert) ClearDeletedAt

func (u *PostUpsert) ClearDeletedAt() *PostUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PostUpsert) ClearRemark

func (u *PostUpsert) ClearRemark() *PostUpsert

ClearRemark clears the value of the "remark" field.

func (*PostUpsert) ClearUpdatedAt

func (u *PostUpsert) ClearUpdatedAt() *PostUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PostUpsert) SetDeletedAt

func (u *PostUpsert) SetDeletedAt(v time.Time) *PostUpsert

SetDeletedAt sets the "deleted_at" field.

func (*PostUpsert) SetName

func (u *PostUpsert) SetName(v string) *PostUpsert

SetName sets the "name" field.

func (*PostUpsert) SetRemark

func (u *PostUpsert) SetRemark(v string) *PostUpsert

SetRemark sets the "remark" field.

func (*PostUpsert) SetSort

func (u *PostUpsert) SetSort(v int32) *PostUpsert

SetSort sets the "sort" field.

func (*PostUpsert) SetState

func (u *PostUpsert) SetState(v int32) *PostUpsert

SetState sets the "state" field.

func (*PostUpsert) SetUpdatedAt

func (u *PostUpsert) SetUpdatedAt(v time.Time) *PostUpsert

SetUpdatedAt sets the "updated_at" field.

func (*PostUpsert) UpdateDeletedAt

func (u *PostUpsert) UpdateDeletedAt() *PostUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*PostUpsert) UpdateName

func (u *PostUpsert) UpdateName() *PostUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*PostUpsert) UpdateRemark

func (u *PostUpsert) UpdateRemark() *PostUpsert

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*PostUpsert) UpdateSort

func (u *PostUpsert) UpdateSort() *PostUpsert

UpdateSort sets the "sort" field to the value that was provided on create.

func (*PostUpsert) UpdateState

func (u *PostUpsert) UpdateState() *PostUpsert

UpdateState sets the "state" field to the value that was provided on create.

func (*PostUpsert) UpdateUpdatedAt

func (u *PostUpsert) UpdateUpdatedAt() *PostUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type PostUpsertBulk

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

PostUpsertBulk is the builder for "upsert"-ing a bulk of Post nodes.

func (*PostUpsertBulk) AddSort

func (u *PostUpsertBulk) AddSort(v int32) *PostUpsertBulk

AddSort adds v to the "sort" field.

func (*PostUpsertBulk) AddState

func (u *PostUpsertBulk) AddState(v int32) *PostUpsertBulk

AddState adds v to the "state" field.

func (*PostUpsertBulk) ClearDeletedAt

func (u *PostUpsertBulk) ClearDeletedAt() *PostUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PostUpsertBulk) ClearRemark

func (u *PostUpsertBulk) ClearRemark() *PostUpsertBulk

ClearRemark clears the value of the "remark" field.

func (*PostUpsertBulk) ClearUpdatedAt

func (u *PostUpsertBulk) ClearUpdatedAt() *PostUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PostUpsertBulk) DoNothing

func (u *PostUpsertBulk) DoNothing() *PostUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PostUpsertBulk) Exec

func (u *PostUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PostUpsertBulk) ExecX

func (u *PostUpsertBulk) ExecX(ctx context.Context)

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

func (*PostUpsertBulk) Ignore

func (u *PostUpsertBulk) Ignore() *PostUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Post.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*PostUpsertBulk) SetDeletedAt

func (u *PostUpsertBulk) SetDeletedAt(v time.Time) *PostUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*PostUpsertBulk) SetName

func (u *PostUpsertBulk) SetName(v string) *PostUpsertBulk

SetName sets the "name" field.

func (*PostUpsertBulk) SetRemark

func (u *PostUpsertBulk) SetRemark(v string) *PostUpsertBulk

SetRemark sets the "remark" field.

func (*PostUpsertBulk) SetSort

func (u *PostUpsertBulk) SetSort(v int32) *PostUpsertBulk

SetSort sets the "sort" field.

func (*PostUpsertBulk) SetState

func (u *PostUpsertBulk) SetState(v int32) *PostUpsertBulk

SetState sets the "state" field.

func (*PostUpsertBulk) SetUpdatedAt

func (u *PostUpsertBulk) SetUpdatedAt(v time.Time) *PostUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*PostUpsertBulk) Update

func (u *PostUpsertBulk) Update(set func(*PostUpsert)) *PostUpsertBulk

Update allows overriding fields `UPDATE` values. See the PostCreateBulk.OnConflict documentation for more info.

func (*PostUpsertBulk) UpdateDeletedAt

func (u *PostUpsertBulk) UpdateDeletedAt() *PostUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*PostUpsertBulk) UpdateName

func (u *PostUpsertBulk) UpdateName() *PostUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*PostUpsertBulk) UpdateNewValues

func (u *PostUpsertBulk) UpdateNewValues() *PostUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Post.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(post.FieldID)
		}),
	).
	Exec(ctx)

func (*PostUpsertBulk) UpdateRemark

func (u *PostUpsertBulk) UpdateRemark() *PostUpsertBulk

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*PostUpsertBulk) UpdateSort

func (u *PostUpsertBulk) UpdateSort() *PostUpsertBulk

UpdateSort sets the "sort" field to the value that was provided on create.

func (*PostUpsertBulk) UpdateState

func (u *PostUpsertBulk) UpdateState() *PostUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

func (*PostUpsertBulk) UpdateUpdatedAt

func (u *PostUpsertBulk) UpdateUpdatedAt() *PostUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type PostUpsertOne

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

PostUpsertOne is the builder for "upsert"-ing

one Post node.

func (*PostUpsertOne) AddSort

func (u *PostUpsertOne) AddSort(v int32) *PostUpsertOne

AddSort adds v to the "sort" field.

func (*PostUpsertOne) AddState

func (u *PostUpsertOne) AddState(v int32) *PostUpsertOne

AddState adds v to the "state" field.

func (*PostUpsertOne) ClearDeletedAt

func (u *PostUpsertOne) ClearDeletedAt() *PostUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PostUpsertOne) ClearRemark

func (u *PostUpsertOne) ClearRemark() *PostUpsertOne

ClearRemark clears the value of the "remark" field.

func (*PostUpsertOne) ClearUpdatedAt

func (u *PostUpsertOne) ClearUpdatedAt() *PostUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PostUpsertOne) DoNothing

func (u *PostUpsertOne) DoNothing() *PostUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*PostUpsertOne) Exec

func (u *PostUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*PostUpsertOne) ExecX

func (u *PostUpsertOne) ExecX(ctx context.Context)

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

func (*PostUpsertOne) ID

func (u *PostUpsertOne) ID(ctx context.Context) (id uint32, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*PostUpsertOne) IDX

func (u *PostUpsertOne) IDX(ctx context.Context) uint32

IDX is like ID, but panics if an error occurs.

func (*PostUpsertOne) Ignore

func (u *PostUpsertOne) Ignore() *PostUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Post.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*PostUpsertOne) SetDeletedAt

func (u *PostUpsertOne) SetDeletedAt(v time.Time) *PostUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*PostUpsertOne) SetName

func (u *PostUpsertOne) SetName(v string) *PostUpsertOne

SetName sets the "name" field.

func (*PostUpsertOne) SetRemark

func (u *PostUpsertOne) SetRemark(v string) *PostUpsertOne

SetRemark sets the "remark" field.

func (*PostUpsertOne) SetSort

func (u *PostUpsertOne) SetSort(v int32) *PostUpsertOne

SetSort sets the "sort" field.

func (*PostUpsertOne) SetState

func (u *PostUpsertOne) SetState(v int32) *PostUpsertOne

SetState sets the "state" field.

func (*PostUpsertOne) SetUpdatedAt

func (u *PostUpsertOne) SetUpdatedAt(v time.Time) *PostUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*PostUpsertOne) Update

func (u *PostUpsertOne) Update(set func(*PostUpsert)) *PostUpsertOne

Update allows overriding fields `UPDATE` values. See the PostCreate.OnConflict documentation for more info.

func (*PostUpsertOne) UpdateDeletedAt

func (u *PostUpsertOne) UpdateDeletedAt() *PostUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*PostUpsertOne) UpdateName

func (u *PostUpsertOne) UpdateName() *PostUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*PostUpsertOne) UpdateNewValues

func (u *PostUpsertOne) UpdateNewValues() *PostUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Post.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(post.FieldID)
		}),
	).
	Exec(ctx)

func (*PostUpsertOne) UpdateRemark

func (u *PostUpsertOne) UpdateRemark() *PostUpsertOne

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*PostUpsertOne) UpdateSort

func (u *PostUpsertOne) UpdateSort() *PostUpsertOne

UpdateSort sets the "sort" field to the value that was provided on create.

func (*PostUpsertOne) UpdateState

func (u *PostUpsertOne) UpdateState() *PostUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

func (*PostUpsertOne) UpdateUpdatedAt

func (u *PostUpsertOne) UpdateUpdatedAt() *PostUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Posts

type Posts []*Post

Posts is a parsable slice of Post.

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
	ID uint32 `json:"id,omitempty"`
	// 创建时间
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// 更新时间
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// 删除时间
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// 备注
	Remark *string `json:"remark,omitempty"`
	// 排序
	Sort *int32 `json:"sort,omitempty"`
	// 状态 0 UNSPECIFIED 开启 1 -> ACTIVE 关闭 2 -> INACTIVE, 禁用 3 -> BANNED
	State *int32 `json:"state,omitempty"`
	// 名称
	Name *string `json:"name,omitempty"`
	// 默认路由
	DefaultRouter *string `json:"default_router,omitempty"`
	// 数据范围(0:未指定 1:全部数据权限 2:本人数据权限 3:本部门数据权限 4:本部门及以下数据权限 5:自定部门数据权限 )
	DataScope *int32 `json:"data_scope,omitempty"`
	// 菜单树选择项是否关联显示
	MenuCheckStrictly *int32 `json:"menu_check_strictly,omitempty"`
	// 部门树选择项是否关联显示
	DeptCheckStrictly *int32 `json:"dept_check_strictly,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
}

角色表

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

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 uint32) *RoleDeleteOne

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

func (*RoleClient) Get

func (c *RoleClient) Get(ctx context.Context, id uint32) (*Role, error)

Get returns a Role entity by its id.

func (*RoleClient) GetX

func (c *RoleClient) GetX(ctx context.Context, id uint32) *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

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) 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 uint32) *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) AddUserIDs

func (rc *RoleCreate) AddUserIDs(ids ...uint32) *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) 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) OnConflict

func (rc *RoleCreate) OnConflict(opts ...sql.ConflictOption) *RoleUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Role.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RoleUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*RoleCreate) OnConflictColumns

func (rc *RoleCreate) OnConflictColumns(columns ...string) *RoleUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

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) SetCreatedAt

func (rc *RoleCreate) SetCreatedAt(t time.Time) *RoleCreate

SetCreatedAt sets the "created_at" field.

func (*RoleCreate) SetDataScope

func (rc *RoleCreate) SetDataScope(i int32) *RoleCreate

SetDataScope sets the "data_scope" field.

func (*RoleCreate) SetDefaultRouter

func (rc *RoleCreate) SetDefaultRouter(s string) *RoleCreate

SetDefaultRouter sets the "default_router" field.

func (*RoleCreate) SetDeletedAt

func (rc *RoleCreate) SetDeletedAt(t time.Time) *RoleCreate

SetDeletedAt sets the "deleted_at" field.

func (*RoleCreate) SetDeptCheckStrictly

func (rc *RoleCreate) SetDeptCheckStrictly(i int32) *RoleCreate

SetDeptCheckStrictly sets the "dept_check_strictly" field.

func (*RoleCreate) SetID

func (rc *RoleCreate) SetID(u uint32) *RoleCreate

SetID sets the "id" field.

func (*RoleCreate) SetMenuCheckStrictly

func (rc *RoleCreate) SetMenuCheckStrictly(i int32) *RoleCreate

SetMenuCheckStrictly sets the "menu_check_strictly" 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) SetNillableDataScope

func (rc *RoleCreate) SetNillableDataScope(i *int32) *RoleCreate

SetNillableDataScope sets the "data_scope" 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) SetNillableDeletedAt

func (rc *RoleCreate) SetNillableDeletedAt(t *time.Time) *RoleCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RoleCreate) SetNillableDeptCheckStrictly

func (rc *RoleCreate) SetNillableDeptCheckStrictly(i *int32) *RoleCreate

SetNillableDeptCheckStrictly sets the "dept_check_strictly" field if the given value is not nil.

func (*RoleCreate) SetNillableMenuCheckStrictly

func (rc *RoleCreate) SetNillableMenuCheckStrictly(i *int32) *RoleCreate

SetNillableMenuCheckStrictly sets the "menu_check_strictly" field if the given value is not nil.

func (*RoleCreate) SetNillableName

func (rc *RoleCreate) SetNillableName(s *string) *RoleCreate

SetNillableName sets the "name" 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(i *int32) *RoleCreate

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

func (*RoleCreate) SetNillableState

func (rc *RoleCreate) SetNillableState(i *int32) *RoleCreate

SetNillableState sets the "state" 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) SetRemark

func (rc *RoleCreate) SetRemark(s string) *RoleCreate

SetRemark sets the "remark" field.

func (*RoleCreate) SetSort

func (rc *RoleCreate) SetSort(i int32) *RoleCreate

SetSort sets the "sort" field.

func (*RoleCreate) SetState

func (rc *RoleCreate) SetState(i int32) *RoleCreate

SetState sets the "state" 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) ExecX

func (rcb *RoleCreateBulk) ExecX(ctx context.Context)

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

func (*RoleCreateBulk) OnConflict

func (rcb *RoleCreateBulk) OnConflict(opts ...sql.ConflictOption) *RoleUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Role.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.RoleUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*RoleCreateBulk) OnConflictColumns

func (rcb *RoleCreateBulk) OnConflictColumns(columns ...string) *RoleUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

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) ExecX

func (rd *RoleDelete) ExecX(ctx context.Context) int

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

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 {
	// 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) 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 RoleFilter

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

RoleFilter provides a generic filtering capability at runtime for RoleQuery.

func (*RoleFilter) Where

func (f *RoleFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*RoleFilter) WhereCreatedAt

func (f *RoleFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*RoleFilter) WhereDataScope

func (f *RoleFilter) WhereDataScope(p entql.Int32P)

WhereDataScope applies the entql int32 predicate on the data_scope field.

func (*RoleFilter) WhereDefaultRouter

func (f *RoleFilter) WhereDefaultRouter(p entql.StringP)

WhereDefaultRouter applies the entql string predicate on the default_router field.

func (*RoleFilter) WhereDeletedAt

func (f *RoleFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*RoleFilter) WhereDeptCheckStrictly

func (f *RoleFilter) WhereDeptCheckStrictly(p entql.Int32P)

WhereDeptCheckStrictly applies the entql int32 predicate on the dept_check_strictly field.

func (*RoleFilter) WhereHasUsers

func (f *RoleFilter) WhereHasUsers()

WhereHasUsers applies a predicate to check if query has an edge users.

func (*RoleFilter) WhereHasUsersWith

func (f *RoleFilter) WhereHasUsersWith(preds ...predicate.User)

WhereHasUsersWith applies a predicate to check if query has an edge users with a given conditions (other predicates).

func (*RoleFilter) WhereID

func (f *RoleFilter) WhereID(p entql.Uint32P)

WhereID applies the entql uint32 predicate on the id field.

func (*RoleFilter) WhereMenuCheckStrictly

func (f *RoleFilter) WhereMenuCheckStrictly(p entql.Int32P)

WhereMenuCheckStrictly applies the entql int32 predicate on the menu_check_strictly field.

func (*RoleFilter) WhereName

func (f *RoleFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

func (*RoleFilter) WhereRemark

func (f *RoleFilter) WhereRemark(p entql.StringP)

WhereRemark applies the entql string predicate on the remark field.

func (*RoleFilter) WhereSort

func (f *RoleFilter) WhereSort(p entql.Int32P)

WhereSort applies the entql int32 predicate on the sort field.

func (*RoleFilter) WhereState

func (f *RoleFilter) WhereState(p entql.Int32P)

WhereState applies the entql int32 predicate on the state field.

func (*RoleFilter) WhereUpdatedAt

func (f *RoleFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

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) AddDataScope

func (m *RoleMutation) AddDataScope(i int32)

AddDataScope adds i to the "data_scope" field.

func (*RoleMutation) AddDeptCheckStrictly

func (m *RoleMutation) AddDeptCheckStrictly(i int32)

AddDeptCheckStrictly adds i to the "dept_check_strictly" field.

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) AddMenuCheckStrictly

func (m *RoleMutation) AddMenuCheckStrictly(i int32)

AddMenuCheckStrictly adds i to the "menu_check_strictly" field.

func (*RoleMutation) AddSort

func (m *RoleMutation) AddSort(i int32)

AddSort adds i to the "sort" field.

func (*RoleMutation) AddState

func (m *RoleMutation) AddState(i int32)

AddState adds i to the "state" field.

func (*RoleMutation) AddUserIDs

func (m *RoleMutation) AddUserIDs(ids ...uint32)

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

func (*RoleMutation) AddedDataScope

func (m *RoleMutation) AddedDataScope() (r int32, exists bool)

AddedDataScope returns the value that was added to the "data_scope" field in this mutation.

func (*RoleMutation) AddedDeptCheckStrictly

func (m *RoleMutation) AddedDeptCheckStrictly() (r int32, exists bool)

AddedDeptCheckStrictly returns the value that was added to the "dept_check_strictly" field in this mutation.

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) AddedMenuCheckStrictly

func (m *RoleMutation) AddedMenuCheckStrictly() (r int32, exists bool)

AddedMenuCheckStrictly returns the value that was added to the "menu_check_strictly" field 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) AddedState

func (m *RoleMutation) AddedState() (r int32, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*RoleMutation) ClearCreatedAt

func (m *RoleMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*RoleMutation) ClearDeletedAt

func (m *RoleMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

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) ClearRemark

func (m *RoleMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*RoleMutation) ClearUpdatedAt

func (m *RoleMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" 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) CreatedAt

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

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

func (*RoleMutation) CreatedAtCleared

func (m *RoleMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*RoleMutation) DataScope

func (m *RoleMutation) DataScope() (r int32, exists bool)

DataScope returns the value of the "data_scope" 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) DeletedAt

func (m *RoleMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*RoleMutation) DeletedAtCleared

func (m *RoleMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*RoleMutation) DeptCheckStrictly

func (m *RoleMutation) DeptCheckStrictly() (r int32, exists bool)

DeptCheckStrictly returns the value of the "dept_check_strictly" 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) 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) Filter

func (m *RoleMutation) Filter() *RoleFilter

Filter returns an entql.Where implementation to apply filters on the RoleMutation builder.

func (*RoleMutation) ID

func (m *RoleMutation) ID() (id uint32, 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) ([]uint32, 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) MenuCheckStrictly

func (m *RoleMutation) MenuCheckStrictly() (r int32, exists bool)

MenuCheckStrictly returns the value of the "menu_check_strictly" field 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) 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) OldDataScope

func (m *RoleMutation) OldDataScope(ctx context.Context) (v *int32, err error)

OldDataScope returns the old "data_scope" 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) OldDeletedAt

func (m *RoleMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_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) OldDeptCheckStrictly

func (m *RoleMutation) OldDeptCheckStrictly(ctx context.Context) (v *int32, err error)

OldDeptCheckStrictly returns the old "dept_check_strictly" 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) OldMenuCheckStrictly

func (m *RoleMutation) OldMenuCheckStrictly(ctx context.Context) (v *int32, err error)

OldMenuCheckStrictly returns the old "menu_check_strictly" 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) 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 *int32, 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) OldState

func (m *RoleMutation) OldState(ctx context.Context) (v *int32, err error)

OldState returns the old "state" 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) Remark

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

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

func (*RoleMutation) RemarkCleared

func (m *RoleMutation) RemarkCleared() bool

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

func (*RoleMutation) RemoveUserIDs

func (m *RoleMutation) RemoveUserIDs(ids ...uint32)

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) RemovedUsersIDs

func (m *RoleMutation) RemovedUsersIDs() (ids []uint32)

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

func (*RoleMutation) ResetCreatedAt

func (m *RoleMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*RoleMutation) ResetDataScope

func (m *RoleMutation) ResetDataScope()

ResetDataScope resets all changes to the "data_scope" field.

func (*RoleMutation) ResetDefaultRouter

func (m *RoleMutation) ResetDefaultRouter()

ResetDefaultRouter resets all changes to the "default_router" field.

func (*RoleMutation) ResetDeletedAt

func (m *RoleMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*RoleMutation) ResetDeptCheckStrictly

func (m *RoleMutation) ResetDeptCheckStrictly()

ResetDeptCheckStrictly resets all changes to the "dept_check_strictly" 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) ResetMenuCheckStrictly

func (m *RoleMutation) ResetMenuCheckStrictly()

ResetMenuCheckStrictly resets all changes to the "menu_check_strictly" field.

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) ResetState

func (m *RoleMutation) ResetState()

ResetState resets all changes to the "state" 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) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*RoleMutation) SetDataScope

func (m *RoleMutation) SetDataScope(i int32)

SetDataScope sets the "data_scope" field.

func (*RoleMutation) SetDefaultRouter

func (m *RoleMutation) SetDefaultRouter(s string)

SetDefaultRouter sets the "default_router" field.

func (*RoleMutation) SetDeletedAt

func (m *RoleMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*RoleMutation) SetDeptCheckStrictly

func (m *RoleMutation) SetDeptCheckStrictly(i int32)

SetDeptCheckStrictly sets the "dept_check_strictly" 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 uint32)

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

func (*RoleMutation) SetMenuCheckStrictly

func (m *RoleMutation) SetMenuCheckStrictly(i int32)

SetMenuCheckStrictly sets the "menu_check_strictly" field.

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(i int32)

SetSort sets the "sort" field.

func (*RoleMutation) SetState

func (m *RoleMutation) SetState(i int32)

SetState sets the "state" 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 int32, exists bool)

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

func (*RoleMutation) State

func (m *RoleMutation) State() (r int32, exists bool)

State returns the value of the "state" field in the 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) UpdatedAtCleared

func (m *RoleMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this 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 []uint32)

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 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) 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) Filter

func (rq *RoleQuery) Filter() *RoleFilter

Filter returns a Filter implementation to apply filters on the RoleQuery builder.

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 uint32, 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) uint32

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 []uint32, err error)

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

func (*RoleQuery) IDsX

func (rq *RoleQuery) IDsX(ctx context.Context) []uint32

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) Modify

func (rq *RoleQuery) Modify(modifiers ...func(s *sql.Selector)) *RoleSelect

Modify adds a query modifier for attaching custom logic to queries.

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 uint32, 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) uint32

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) 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) 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) 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) Modify

func (rs *RoleSelect) Modify(modifiers ...func(s *sql.Selector)) *RoleSelect

Modify adds a query modifier for attaching custom logic to queries.

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) AddDataScope

func (ru *RoleUpdate) AddDataScope(i int32) *RoleUpdate

AddDataScope adds i to the "data_scope" field.

func (*RoleUpdate) AddDeptCheckStrictly

func (ru *RoleUpdate) AddDeptCheckStrictly(i int32) *RoleUpdate

AddDeptCheckStrictly adds i to the "dept_check_strictly" field.

func (*RoleUpdate) AddMenuCheckStrictly

func (ru *RoleUpdate) AddMenuCheckStrictly(i int32) *RoleUpdate

AddMenuCheckStrictly adds i to the "menu_check_strictly" field.

func (*RoleUpdate) AddSort

func (ru *RoleUpdate) AddSort(i int32) *RoleUpdate

AddSort adds i to the "sort" field.

func (*RoleUpdate) AddState

func (ru *RoleUpdate) AddState(i int32) *RoleUpdate

AddState adds i to the "state" field.

func (*RoleUpdate) AddUserIDs

func (ru *RoleUpdate) AddUserIDs(ids ...uint32) *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) ClearDeletedAt

func (ru *RoleUpdate) ClearDeletedAt() *RoleUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*RoleUpdate) ClearRemark

func (ru *RoleUpdate) ClearRemark() *RoleUpdate

ClearRemark clears the value of the "remark" field.

func (*RoleUpdate) ClearUpdatedAt

func (ru *RoleUpdate) ClearUpdatedAt() *RoleUpdate

ClearUpdatedAt clears the value of the "updated_at" 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) ExecX

func (ru *RoleUpdate) ExecX(ctx context.Context)

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

func (*RoleUpdate) Modify

func (ru *RoleUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RoleUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*RoleUpdate) Mutation

func (ru *RoleUpdate) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdate) RemoveUserIDs

func (ru *RoleUpdate) RemoveUserIDs(ids ...uint32) *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) SetDataScope

func (ru *RoleUpdate) SetDataScope(i int32) *RoleUpdate

SetDataScope sets the "data_scope" field.

func (*RoleUpdate) SetDefaultRouter

func (ru *RoleUpdate) SetDefaultRouter(s string) *RoleUpdate

SetDefaultRouter sets the "default_router" field.

func (*RoleUpdate) SetDeletedAt

func (ru *RoleUpdate) SetDeletedAt(t time.Time) *RoleUpdate

SetDeletedAt sets the "deleted_at" field.

func (*RoleUpdate) SetDeptCheckStrictly

func (ru *RoleUpdate) SetDeptCheckStrictly(i int32) *RoleUpdate

SetDeptCheckStrictly sets the "dept_check_strictly" field.

func (*RoleUpdate) SetMenuCheckStrictly

func (ru *RoleUpdate) SetMenuCheckStrictly(i int32) *RoleUpdate

SetMenuCheckStrictly sets the "menu_check_strictly" field.

func (*RoleUpdate) SetName

func (ru *RoleUpdate) SetName(s string) *RoleUpdate

SetName sets the "name" field.

func (*RoleUpdate) SetNillableDataScope

func (ru *RoleUpdate) SetNillableDataScope(i *int32) *RoleUpdate

SetNillableDataScope sets the "data_scope" 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) SetNillableDeletedAt

func (ru *RoleUpdate) SetNillableDeletedAt(t *time.Time) *RoleUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RoleUpdate) SetNillableDeptCheckStrictly

func (ru *RoleUpdate) SetNillableDeptCheckStrictly(i *int32) *RoleUpdate

SetNillableDeptCheckStrictly sets the "dept_check_strictly" field if the given value is not nil.

func (*RoleUpdate) SetNillableMenuCheckStrictly

func (ru *RoleUpdate) SetNillableMenuCheckStrictly(i *int32) *RoleUpdate

SetNillableMenuCheckStrictly sets the "menu_check_strictly" field if the given value is not nil.

func (*RoleUpdate) SetNillableName

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(i *int32) *RoleUpdate

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

func (*RoleUpdate) SetNillableState

func (ru *RoleUpdate) SetNillableState(i *int32) *RoleUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*RoleUpdate) SetNillableUpdatedAt

func (ru *RoleUpdate) SetNillableUpdatedAt(t *time.Time) *RoleUpdate

SetNillableUpdatedAt sets the "updated_at" field if the given value 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(i int32) *RoleUpdate

SetSort sets the "sort" field.

func (*RoleUpdate) SetState

func (ru *RoleUpdate) SetState(i int32) *RoleUpdate

SetState sets the "state" 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) AddDataScope

func (ruo *RoleUpdateOne) AddDataScope(i int32) *RoleUpdateOne

AddDataScope adds i to the "data_scope" field.

func (*RoleUpdateOne) AddDeptCheckStrictly

func (ruo *RoleUpdateOne) AddDeptCheckStrictly(i int32) *RoleUpdateOne

AddDeptCheckStrictly adds i to the "dept_check_strictly" field.

func (*RoleUpdateOne) AddMenuCheckStrictly

func (ruo *RoleUpdateOne) AddMenuCheckStrictly(i int32) *RoleUpdateOne

AddMenuCheckStrictly adds i to the "menu_check_strictly" field.

func (*RoleUpdateOne) AddSort

func (ruo *RoleUpdateOne) AddSort(i int32) *RoleUpdateOne

AddSort adds i to the "sort" field.

func (*RoleUpdateOne) AddState

func (ruo *RoleUpdateOne) AddState(i int32) *RoleUpdateOne

AddState adds i to the "state" field.

func (*RoleUpdateOne) AddUserIDs

func (ruo *RoleUpdateOne) AddUserIDs(ids ...uint32) *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) ClearDeletedAt

func (ruo *RoleUpdateOne) ClearDeletedAt() *RoleUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*RoleUpdateOne) ClearRemark

func (ruo *RoleUpdateOne) ClearRemark() *RoleUpdateOne

ClearRemark clears the value of the "remark" field.

func (*RoleUpdateOne) ClearUpdatedAt

func (ruo *RoleUpdateOne) ClearUpdatedAt() *RoleUpdateOne

ClearUpdatedAt clears the value of the "updated_at" 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) ExecX

func (ruo *RoleUpdateOne) ExecX(ctx context.Context)

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

func (*RoleUpdateOne) Modify

func (ruo *RoleUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *RoleUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*RoleUpdateOne) Mutation

func (ruo *RoleUpdateOne) Mutation() *RoleMutation

Mutation returns the RoleMutation object of the builder.

func (*RoleUpdateOne) RemoveUserIDs

func (ruo *RoleUpdateOne) RemoveUserIDs(ids ...uint32) *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) SetDataScope

func (ruo *RoleUpdateOne) SetDataScope(i int32) *RoleUpdateOne

SetDataScope sets the "data_scope" field.

func (*RoleUpdateOne) SetDefaultRouter

func (ruo *RoleUpdateOne) SetDefaultRouter(s string) *RoleUpdateOne

SetDefaultRouter sets the "default_router" field.

func (*RoleUpdateOne) SetDeletedAt

func (ruo *RoleUpdateOne) SetDeletedAt(t time.Time) *RoleUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*RoleUpdateOne) SetDeptCheckStrictly

func (ruo *RoleUpdateOne) SetDeptCheckStrictly(i int32) *RoleUpdateOne

SetDeptCheckStrictly sets the "dept_check_strictly" field.

func (*RoleUpdateOne) SetMenuCheckStrictly

func (ruo *RoleUpdateOne) SetMenuCheckStrictly(i int32) *RoleUpdateOne

SetMenuCheckStrictly sets the "menu_check_strictly" field.

func (*RoleUpdateOne) SetName

func (ruo *RoleUpdateOne) SetName(s string) *RoleUpdateOne

SetName sets the "name" field.

func (*RoleUpdateOne) SetNillableDataScope

func (ruo *RoleUpdateOne) SetNillableDataScope(i *int32) *RoleUpdateOne

SetNillableDataScope sets the "data_scope" 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) SetNillableDeletedAt

func (ruo *RoleUpdateOne) SetNillableDeletedAt(t *time.Time) *RoleUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableDeptCheckStrictly

func (ruo *RoleUpdateOne) SetNillableDeptCheckStrictly(i *int32) *RoleUpdateOne

SetNillableDeptCheckStrictly sets the "dept_check_strictly" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableMenuCheckStrictly

func (ruo *RoleUpdateOne) SetNillableMenuCheckStrictly(i *int32) *RoleUpdateOne

SetNillableMenuCheckStrictly sets the "menu_check_strictly" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableName

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(i *int32) *RoleUpdateOne

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

func (*RoleUpdateOne) SetNillableState

func (ruo *RoleUpdateOne) SetNillableState(i *int32) *RoleUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*RoleUpdateOne) SetNillableUpdatedAt

func (ruo *RoleUpdateOne) SetNillableUpdatedAt(t *time.Time) *RoleUpdateOne

SetNillableUpdatedAt sets the "updated_at" field if the given value 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(i int32) *RoleUpdateOne

SetSort sets the "sort" field.

func (*RoleUpdateOne) SetState

func (ruo *RoleUpdateOne) SetState(i int32) *RoleUpdateOne

SetState sets the "state" 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 RoleUpsert

type RoleUpsert struct {
	*sql.UpdateSet
}

RoleUpsert is the "OnConflict" setter.

func (*RoleUpsert) AddDataScope

func (u *RoleUpsert) AddDataScope(v int32) *RoleUpsert

AddDataScope adds v to the "data_scope" field.

func (*RoleUpsert) AddDeptCheckStrictly

func (u *RoleUpsert) AddDeptCheckStrictly(v int32) *RoleUpsert

AddDeptCheckStrictly adds v to the "dept_check_strictly" field.

func (*RoleUpsert) AddMenuCheckStrictly

func (u *RoleUpsert) AddMenuCheckStrictly(v int32) *RoleUpsert

AddMenuCheckStrictly adds v to the "menu_check_strictly" field.

func (*RoleUpsert) AddSort

func (u *RoleUpsert) AddSort(v int32) *RoleUpsert

AddSort adds v to the "sort" field.

func (*RoleUpsert) AddState

func (u *RoleUpsert) AddState(v int32) *RoleUpsert

AddState adds v to the "state" field.

func (*RoleUpsert) ClearDeletedAt

func (u *RoleUpsert) ClearDeletedAt() *RoleUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*RoleUpsert) ClearRemark

func (u *RoleUpsert) ClearRemark() *RoleUpsert

ClearRemark clears the value of the "remark" field.

func (*RoleUpsert) ClearUpdatedAt

func (u *RoleUpsert) ClearUpdatedAt() *RoleUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RoleUpsert) SetDataScope

func (u *RoleUpsert) SetDataScope(v int32) *RoleUpsert

SetDataScope sets the "data_scope" field.

func (*RoleUpsert) SetDefaultRouter

func (u *RoleUpsert) SetDefaultRouter(v string) *RoleUpsert

SetDefaultRouter sets the "default_router" field.

func (*RoleUpsert) SetDeletedAt

func (u *RoleUpsert) SetDeletedAt(v time.Time) *RoleUpsert

SetDeletedAt sets the "deleted_at" field.

func (*RoleUpsert) SetDeptCheckStrictly

func (u *RoleUpsert) SetDeptCheckStrictly(v int32) *RoleUpsert

SetDeptCheckStrictly sets the "dept_check_strictly" field.

func (*RoleUpsert) SetMenuCheckStrictly

func (u *RoleUpsert) SetMenuCheckStrictly(v int32) *RoleUpsert

SetMenuCheckStrictly sets the "menu_check_strictly" field.

func (*RoleUpsert) SetName

func (u *RoleUpsert) SetName(v string) *RoleUpsert

SetName sets the "name" field.

func (*RoleUpsert) SetRemark

func (u *RoleUpsert) SetRemark(v string) *RoleUpsert

SetRemark sets the "remark" field.

func (*RoleUpsert) SetSort

func (u *RoleUpsert) SetSort(v int32) *RoleUpsert

SetSort sets the "sort" field.

func (*RoleUpsert) SetState

func (u *RoleUpsert) SetState(v int32) *RoleUpsert

SetState sets the "state" field.

func (*RoleUpsert) SetUpdatedAt

func (u *RoleUpsert) SetUpdatedAt(v time.Time) *RoleUpsert

SetUpdatedAt sets the "updated_at" field.

func (*RoleUpsert) UpdateDataScope

func (u *RoleUpsert) UpdateDataScope() *RoleUpsert

UpdateDataScope sets the "data_scope" field to the value that was provided on create.

func (*RoleUpsert) UpdateDefaultRouter

func (u *RoleUpsert) UpdateDefaultRouter() *RoleUpsert

UpdateDefaultRouter sets the "default_router" field to the value that was provided on create.

func (*RoleUpsert) UpdateDeletedAt

func (u *RoleUpsert) UpdateDeletedAt() *RoleUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*RoleUpsert) UpdateDeptCheckStrictly

func (u *RoleUpsert) UpdateDeptCheckStrictly() *RoleUpsert

UpdateDeptCheckStrictly sets the "dept_check_strictly" field to the value that was provided on create.

func (*RoleUpsert) UpdateMenuCheckStrictly

func (u *RoleUpsert) UpdateMenuCheckStrictly() *RoleUpsert

UpdateMenuCheckStrictly sets the "menu_check_strictly" field to the value that was provided on create.

func (*RoleUpsert) UpdateName

func (u *RoleUpsert) UpdateName() *RoleUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*RoleUpsert) UpdateRemark

func (u *RoleUpsert) UpdateRemark() *RoleUpsert

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*RoleUpsert) UpdateSort

func (u *RoleUpsert) UpdateSort() *RoleUpsert

UpdateSort sets the "sort" field to the value that was provided on create.

func (*RoleUpsert) UpdateState

func (u *RoleUpsert) UpdateState() *RoleUpsert

UpdateState sets the "state" field to the value that was provided on create.

func (*RoleUpsert) UpdateUpdatedAt

func (u *RoleUpsert) UpdateUpdatedAt() *RoleUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type RoleUpsertBulk

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

RoleUpsertBulk is the builder for "upsert"-ing a bulk of Role nodes.

func (*RoleUpsertBulk) AddDataScope

func (u *RoleUpsertBulk) AddDataScope(v int32) *RoleUpsertBulk

AddDataScope adds v to the "data_scope" field.

func (*RoleUpsertBulk) AddDeptCheckStrictly

func (u *RoleUpsertBulk) AddDeptCheckStrictly(v int32) *RoleUpsertBulk

AddDeptCheckStrictly adds v to the "dept_check_strictly" field.

func (*RoleUpsertBulk) AddMenuCheckStrictly

func (u *RoleUpsertBulk) AddMenuCheckStrictly(v int32) *RoleUpsertBulk

AddMenuCheckStrictly adds v to the "menu_check_strictly" field.

func (*RoleUpsertBulk) AddSort

func (u *RoleUpsertBulk) AddSort(v int32) *RoleUpsertBulk

AddSort adds v to the "sort" field.

func (*RoleUpsertBulk) AddState

func (u *RoleUpsertBulk) AddState(v int32) *RoleUpsertBulk

AddState adds v to the "state" field.

func (*RoleUpsertBulk) ClearDeletedAt

func (u *RoleUpsertBulk) ClearDeletedAt() *RoleUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*RoleUpsertBulk) ClearRemark

func (u *RoleUpsertBulk) ClearRemark() *RoleUpsertBulk

ClearRemark clears the value of the "remark" field.

func (*RoleUpsertBulk) ClearUpdatedAt

func (u *RoleUpsertBulk) ClearUpdatedAt() *RoleUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RoleUpsertBulk) DoNothing

func (u *RoleUpsertBulk) DoNothing() *RoleUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RoleUpsertBulk) Exec

func (u *RoleUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpsertBulk) ExecX

func (u *RoleUpsertBulk) ExecX(ctx context.Context)

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

func (*RoleUpsertBulk) Ignore

func (u *RoleUpsertBulk) Ignore() *RoleUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*RoleUpsertBulk) SetDataScope

func (u *RoleUpsertBulk) SetDataScope(v int32) *RoleUpsertBulk

SetDataScope sets the "data_scope" field.

func (*RoleUpsertBulk) SetDefaultRouter

func (u *RoleUpsertBulk) SetDefaultRouter(v string) *RoleUpsertBulk

SetDefaultRouter sets the "default_router" field.

func (*RoleUpsertBulk) SetDeletedAt

func (u *RoleUpsertBulk) SetDeletedAt(v time.Time) *RoleUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*RoleUpsertBulk) SetDeptCheckStrictly

func (u *RoleUpsertBulk) SetDeptCheckStrictly(v int32) *RoleUpsertBulk

SetDeptCheckStrictly sets the "dept_check_strictly" field.

func (*RoleUpsertBulk) SetMenuCheckStrictly

func (u *RoleUpsertBulk) SetMenuCheckStrictly(v int32) *RoleUpsertBulk

SetMenuCheckStrictly sets the "menu_check_strictly" field.

func (*RoleUpsertBulk) SetName

func (u *RoleUpsertBulk) SetName(v string) *RoleUpsertBulk

SetName sets the "name" field.

func (*RoleUpsertBulk) SetRemark

func (u *RoleUpsertBulk) SetRemark(v string) *RoleUpsertBulk

SetRemark sets the "remark" field.

func (*RoleUpsertBulk) SetSort

func (u *RoleUpsertBulk) SetSort(v int32) *RoleUpsertBulk

SetSort sets the "sort" field.

func (*RoleUpsertBulk) SetState

func (u *RoleUpsertBulk) SetState(v int32) *RoleUpsertBulk

SetState sets the "state" field.

func (*RoleUpsertBulk) SetUpdatedAt

func (u *RoleUpsertBulk) SetUpdatedAt(v time.Time) *RoleUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*RoleUpsertBulk) Update

func (u *RoleUpsertBulk) Update(set func(*RoleUpsert)) *RoleUpsertBulk

Update allows overriding fields `UPDATE` values. See the RoleCreateBulk.OnConflict documentation for more info.

func (*RoleUpsertBulk) UpdateDataScope

func (u *RoleUpsertBulk) UpdateDataScope() *RoleUpsertBulk

UpdateDataScope sets the "data_scope" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateDefaultRouter

func (u *RoleUpsertBulk) UpdateDefaultRouter() *RoleUpsertBulk

UpdateDefaultRouter sets the "default_router" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateDeletedAt

func (u *RoleUpsertBulk) UpdateDeletedAt() *RoleUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateDeptCheckStrictly

func (u *RoleUpsertBulk) UpdateDeptCheckStrictly() *RoleUpsertBulk

UpdateDeptCheckStrictly sets the "dept_check_strictly" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateMenuCheckStrictly

func (u *RoleUpsertBulk) UpdateMenuCheckStrictly() *RoleUpsertBulk

UpdateMenuCheckStrictly sets the "menu_check_strictly" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateName

func (u *RoleUpsertBulk) UpdateName() *RoleUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateNewValues

func (u *RoleUpsertBulk) UpdateNewValues() *RoleUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(role.FieldID)
		}),
	).
	Exec(ctx)

func (*RoleUpsertBulk) UpdateRemark

func (u *RoleUpsertBulk) UpdateRemark() *RoleUpsertBulk

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateSort

func (u *RoleUpsertBulk) UpdateSort() *RoleUpsertBulk

UpdateSort sets the "sort" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateState

func (u *RoleUpsertBulk) UpdateState() *RoleUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

func (*RoleUpsertBulk) UpdateUpdatedAt

func (u *RoleUpsertBulk) UpdateUpdatedAt() *RoleUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type RoleUpsertOne

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

RoleUpsertOne is the builder for "upsert"-ing

one Role node.

func (*RoleUpsertOne) AddDataScope

func (u *RoleUpsertOne) AddDataScope(v int32) *RoleUpsertOne

AddDataScope adds v to the "data_scope" field.

func (*RoleUpsertOne) AddDeptCheckStrictly

func (u *RoleUpsertOne) AddDeptCheckStrictly(v int32) *RoleUpsertOne

AddDeptCheckStrictly adds v to the "dept_check_strictly" field.

func (*RoleUpsertOne) AddMenuCheckStrictly

func (u *RoleUpsertOne) AddMenuCheckStrictly(v int32) *RoleUpsertOne

AddMenuCheckStrictly adds v to the "menu_check_strictly" field.

func (*RoleUpsertOne) AddSort

func (u *RoleUpsertOne) AddSort(v int32) *RoleUpsertOne

AddSort adds v to the "sort" field.

func (*RoleUpsertOne) AddState

func (u *RoleUpsertOne) AddState(v int32) *RoleUpsertOne

AddState adds v to the "state" field.

func (*RoleUpsertOne) ClearDeletedAt

func (u *RoleUpsertOne) ClearDeletedAt() *RoleUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*RoleUpsertOne) ClearRemark

func (u *RoleUpsertOne) ClearRemark() *RoleUpsertOne

ClearRemark clears the value of the "remark" field.

func (*RoleUpsertOne) ClearUpdatedAt

func (u *RoleUpsertOne) ClearUpdatedAt() *RoleUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*RoleUpsertOne) DoNothing

func (u *RoleUpsertOne) DoNothing() *RoleUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*RoleUpsertOne) Exec

func (u *RoleUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*RoleUpsertOne) ExecX

func (u *RoleUpsertOne) ExecX(ctx context.Context)

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

func (*RoleUpsertOne) ID

func (u *RoleUpsertOne) ID(ctx context.Context) (id uint32, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*RoleUpsertOne) IDX

func (u *RoleUpsertOne) IDX(ctx context.Context) uint32

IDX is like ID, but panics if an error occurs.

func (*RoleUpsertOne) Ignore

func (u *RoleUpsertOne) Ignore() *RoleUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Role.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*RoleUpsertOne) SetDataScope

func (u *RoleUpsertOne) SetDataScope(v int32) *RoleUpsertOne

SetDataScope sets the "data_scope" field.

func (*RoleUpsertOne) SetDefaultRouter

func (u *RoleUpsertOne) SetDefaultRouter(v string) *RoleUpsertOne

SetDefaultRouter sets the "default_router" field.

func (*RoleUpsertOne) SetDeletedAt

func (u *RoleUpsertOne) SetDeletedAt(v time.Time) *RoleUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*RoleUpsertOne) SetDeptCheckStrictly

func (u *RoleUpsertOne) SetDeptCheckStrictly(v int32) *RoleUpsertOne

SetDeptCheckStrictly sets the "dept_check_strictly" field.

func (*RoleUpsertOne) SetMenuCheckStrictly

func (u *RoleUpsertOne) SetMenuCheckStrictly(v int32) *RoleUpsertOne

SetMenuCheckStrictly sets the "menu_check_strictly" field.

func (*RoleUpsertOne) SetName

func (u *RoleUpsertOne) SetName(v string) *RoleUpsertOne

SetName sets the "name" field.

func (*RoleUpsertOne) SetRemark

func (u *RoleUpsertOne) SetRemark(v string) *RoleUpsertOne

SetRemark sets the "remark" field.

func (*RoleUpsertOne) SetSort

func (u *RoleUpsertOne) SetSort(v int32) *RoleUpsertOne

SetSort sets the "sort" field.

func (*RoleUpsertOne) SetState

func (u *RoleUpsertOne) SetState(v int32) *RoleUpsertOne

SetState sets the "state" field.

func (*RoleUpsertOne) SetUpdatedAt

func (u *RoleUpsertOne) SetUpdatedAt(v time.Time) *RoleUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*RoleUpsertOne) Update

func (u *RoleUpsertOne) Update(set func(*RoleUpsert)) *RoleUpsertOne

Update allows overriding fields `UPDATE` values. See the RoleCreate.OnConflict documentation for more info.

func (*RoleUpsertOne) UpdateDataScope

func (u *RoleUpsertOne) UpdateDataScope() *RoleUpsertOne

UpdateDataScope sets the "data_scope" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateDefaultRouter

func (u *RoleUpsertOne) UpdateDefaultRouter() *RoleUpsertOne

UpdateDefaultRouter sets the "default_router" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateDeletedAt

func (u *RoleUpsertOne) UpdateDeletedAt() *RoleUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateDeptCheckStrictly

func (u *RoleUpsertOne) UpdateDeptCheckStrictly() *RoleUpsertOne

UpdateDeptCheckStrictly sets the "dept_check_strictly" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateMenuCheckStrictly

func (u *RoleUpsertOne) UpdateMenuCheckStrictly() *RoleUpsertOne

UpdateMenuCheckStrictly sets the "menu_check_strictly" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateName

func (u *RoleUpsertOne) UpdateName() *RoleUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateNewValues

func (u *RoleUpsertOne) UpdateNewValues() *RoleUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Role.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(role.FieldID)
		}),
	).
	Exec(ctx)

func (*RoleUpsertOne) UpdateRemark

func (u *RoleUpsertOne) UpdateRemark() *RoleUpsertOne

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateSort

func (u *RoleUpsertOne) UpdateSort() *RoleUpsertOne

UpdateSort sets the "sort" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateState

func (u *RoleUpsertOne) UpdateState() *RoleUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

func (*RoleUpsertOne) UpdateUpdatedAt

func (u *RoleUpsertOne) UpdateUpdatedAt() *RoleUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

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 Tenant

type Tenant struct {

	// ID of the ent.
	// id
	ID uint32 `json:"id,omitempty"`
	// 创建时间
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// 更新时间
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// 删除时间
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// 备注
	Remark *string `json:"remark,omitempty"`
	// 排序
	Sort *int32 `json:"sort,omitempty"`
	// 状态 0 UNSPECIFIED 开启 1 -> ACTIVE 关闭 2 -> INACTIVE, 禁用 3 -> BANNED
	State *int32 `json:"state,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// contains filtered or unexported fields
}

租户表

func (*Tenant) String

func (t *Tenant) String() string

String implements the fmt.Stringer.

func (*Tenant) Unwrap

func (t *Tenant) Unwrap() *Tenant

Unwrap unwraps the Tenant 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 (*Tenant) Update

func (t *Tenant) Update() *TenantUpdateOne

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

func (*Tenant) Value

func (t *Tenant) Value(name string) (ent.Value, error)

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

type TenantClient

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

TenantClient is a client for the Tenant schema.

func NewTenantClient

func NewTenantClient(c config) *TenantClient

NewTenantClient returns a client for the Tenant from the given config.

func (*TenantClient) Create

func (c *TenantClient) Create() *TenantCreate

Create returns a builder for creating a Tenant entity.

func (*TenantClient) CreateBulk

func (c *TenantClient) CreateBulk(builders ...*TenantCreate) *TenantCreateBulk

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

func (*TenantClient) Delete

func (c *TenantClient) Delete() *TenantDelete

Delete returns a delete builder for Tenant.

func (*TenantClient) DeleteOne

func (c *TenantClient) DeleteOne(t *Tenant) *TenantDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TenantClient) DeleteOneID

func (c *TenantClient) DeleteOneID(id uint32) *TenantDeleteOne

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

func (*TenantClient) Get

func (c *TenantClient) Get(ctx context.Context, id uint32) (*Tenant, error)

Get returns a Tenant entity by its id.

func (*TenantClient) GetX

func (c *TenantClient) GetX(ctx context.Context, id uint32) *Tenant

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

func (*TenantClient) Hooks

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

Hooks returns the client hooks.

func (*TenantClient) Intercept

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

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

func (*TenantClient) Interceptors

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

Interceptors returns the client interceptors.

func (*TenantClient) MapCreateBulk

func (c *TenantClient) MapCreateBulk(slice any, setFunc func(*TenantCreate, int)) *TenantCreateBulk

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 (*TenantClient) Query

func (c *TenantClient) Query() *TenantQuery

Query returns a query builder for Tenant.

func (*TenantClient) Update

func (c *TenantClient) Update() *TenantUpdate

Update returns an update builder for Tenant.

func (*TenantClient) UpdateOne

func (c *TenantClient) UpdateOne(t *Tenant) *TenantUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TenantClient) UpdateOneID

func (c *TenantClient) UpdateOneID(id uint32) *TenantUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TenantClient) Use

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

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

type TenantCreate

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

TenantCreate is the builder for creating a Tenant entity.

func (*TenantCreate) Exec

func (tc *TenantCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TenantCreate) ExecX

func (tc *TenantCreate) ExecX(ctx context.Context)

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

func (*TenantCreate) Mutation

func (tc *TenantCreate) Mutation() *TenantMutation

Mutation returns the TenantMutation object of the builder.

func (*TenantCreate) OnConflict

func (tc *TenantCreate) OnConflict(opts ...sql.ConflictOption) *TenantUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tenant.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TenantUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*TenantCreate) OnConflictColumns

func (tc *TenantCreate) OnConflictColumns(columns ...string) *TenantUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tenant.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TenantCreate) Save

func (tc *TenantCreate) Save(ctx context.Context) (*Tenant, error)

Save creates the Tenant in the database.

func (*TenantCreate) SaveX

func (tc *TenantCreate) SaveX(ctx context.Context) *Tenant

SaveX calls Save and panics if Save returns an error.

func (*TenantCreate) SetCreatedAt

func (tc *TenantCreate) SetCreatedAt(t time.Time) *TenantCreate

SetCreatedAt sets the "created_at" field.

func (*TenantCreate) SetDeletedAt

func (tc *TenantCreate) SetDeletedAt(t time.Time) *TenantCreate

SetDeletedAt sets the "deleted_at" field.

func (*TenantCreate) SetID

func (tc *TenantCreate) SetID(u uint32) *TenantCreate

SetID sets the "id" field.

func (*TenantCreate) SetName

func (tc *TenantCreate) SetName(s string) *TenantCreate

SetName sets the "name" field.

func (*TenantCreate) SetNillableCreatedAt

func (tc *TenantCreate) SetNillableCreatedAt(t *time.Time) *TenantCreate

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

func (*TenantCreate) SetNillableDeletedAt

func (tc *TenantCreate) SetNillableDeletedAt(t *time.Time) *TenantCreate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*TenantCreate) SetNillableRemark

func (tc *TenantCreate) SetNillableRemark(s *string) *TenantCreate

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

func (*TenantCreate) SetNillableSort

func (tc *TenantCreate) SetNillableSort(i *int32) *TenantCreate

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

func (*TenantCreate) SetNillableState

func (tc *TenantCreate) SetNillableState(i *int32) *TenantCreate

SetNillableState sets the "state" field if the given value is not nil.

func (*TenantCreate) SetNillableUpdatedAt

func (tc *TenantCreate) SetNillableUpdatedAt(t *time.Time) *TenantCreate

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

func (*TenantCreate) SetRemark

func (tc *TenantCreate) SetRemark(s string) *TenantCreate

SetRemark sets the "remark" field.

func (*TenantCreate) SetSort

func (tc *TenantCreate) SetSort(i int32) *TenantCreate

SetSort sets the "sort" field.

func (*TenantCreate) SetState

func (tc *TenantCreate) SetState(i int32) *TenantCreate

SetState sets the "state" field.

func (*TenantCreate) SetUpdatedAt

func (tc *TenantCreate) SetUpdatedAt(t time.Time) *TenantCreate

SetUpdatedAt sets the "updated_at" field.

type TenantCreateBulk

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

TenantCreateBulk is the builder for creating many Tenant entities in bulk.

func (*TenantCreateBulk) Exec

func (tcb *TenantCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TenantCreateBulk) ExecX

func (tcb *TenantCreateBulk) ExecX(ctx context.Context)

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

func (*TenantCreateBulk) OnConflict

func (tcb *TenantCreateBulk) OnConflict(opts ...sql.ConflictOption) *TenantUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Tenant.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TenantUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*TenantCreateBulk) OnConflictColumns

func (tcb *TenantCreateBulk) OnConflictColumns(columns ...string) *TenantUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Tenant.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TenantCreateBulk) Save

func (tcb *TenantCreateBulk) Save(ctx context.Context) ([]*Tenant, error)

Save creates the Tenant entities in the database.

func (*TenantCreateBulk) SaveX

func (tcb *TenantCreateBulk) SaveX(ctx context.Context) []*Tenant

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

type TenantDelete

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

TenantDelete is the builder for deleting a Tenant entity.

func (*TenantDelete) Exec

func (td *TenantDelete) Exec(ctx context.Context) (int, error)

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

func (*TenantDelete) ExecX

func (td *TenantDelete) ExecX(ctx context.Context) int

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

func (*TenantDelete) Where

func (td *TenantDelete) Where(ps ...predicate.Tenant) *TenantDelete

Where appends a list predicates to the TenantDelete builder.

type TenantDeleteOne

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

TenantDeleteOne is the builder for deleting a single Tenant entity.

func (*TenantDeleteOne) Exec

func (tdo *TenantDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TenantDeleteOne) ExecX

func (tdo *TenantDeleteOne) ExecX(ctx context.Context)

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

func (*TenantDeleteOne) Where

func (tdo *TenantDeleteOne) Where(ps ...predicate.Tenant) *TenantDeleteOne

Where appends a list predicates to the TenantDelete builder.

type TenantFilter

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

TenantFilter provides a generic filtering capability at runtime for TenantQuery.

func (*TenantFilter) Where

func (f *TenantFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*TenantFilter) WhereCreatedAt

func (f *TenantFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*TenantFilter) WhereDeletedAt

func (f *TenantFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*TenantFilter) WhereID

func (f *TenantFilter) WhereID(p entql.Uint32P)

WhereID applies the entql uint32 predicate on the id field.

func (*TenantFilter) WhereName

func (f *TenantFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

func (*TenantFilter) WhereRemark

func (f *TenantFilter) WhereRemark(p entql.StringP)

WhereRemark applies the entql string predicate on the remark field.

func (*TenantFilter) WhereSort

func (f *TenantFilter) WhereSort(p entql.Int32P)

WhereSort applies the entql int32 predicate on the sort field.

func (*TenantFilter) WhereState

func (f *TenantFilter) WhereState(p entql.Int32P)

WhereState applies the entql int32 predicate on the state field.

func (*TenantFilter) WhereUpdatedAt

func (f *TenantFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

type TenantGroupBy

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

TenantGroupBy is the group-by builder for Tenant entities.

func (*TenantGroupBy) Aggregate

func (tgb *TenantGroupBy) Aggregate(fns ...AggregateFunc) *TenantGroupBy

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

func (*TenantGroupBy) Bool

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

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

func (*TenantGroupBy) BoolX

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

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

func (*TenantGroupBy) Bools

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

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

func (*TenantGroupBy) BoolsX

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

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

func (*TenantGroupBy) Float64

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

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

func (*TenantGroupBy) Float64X

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

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

func (*TenantGroupBy) Float64s

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

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

func (*TenantGroupBy) Float64sX

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

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

func (*TenantGroupBy) Int

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

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

func (*TenantGroupBy) IntX

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

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

func (*TenantGroupBy) Ints

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

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

func (*TenantGroupBy) IntsX

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

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

func (*TenantGroupBy) Scan

func (tgb *TenantGroupBy) Scan(ctx context.Context, v any) error

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

func (*TenantGroupBy) ScanX

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

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

func (*TenantGroupBy) String

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

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

func (*TenantGroupBy) StringX

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

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

func (*TenantGroupBy) Strings

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

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

func (*TenantGroupBy) StringsX

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

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

type TenantMutation

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

TenantMutation represents an operation that mutates the Tenant nodes in the graph.

func (*TenantMutation) AddField

func (m *TenantMutation) 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 (*TenantMutation) AddSort

func (m *TenantMutation) AddSort(i int32)

AddSort adds i to the "sort" field.

func (*TenantMutation) AddState

func (m *TenantMutation) AddState(i int32)

AddState adds i to the "state" field.

func (*TenantMutation) AddedEdges

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

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

func (*TenantMutation) AddedField

func (m *TenantMutation) 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 (*TenantMutation) AddedFields

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

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

func (*TenantMutation) AddedIDs

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

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

func (*TenantMutation) AddedSort

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

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

func (*TenantMutation) AddedState

func (m *TenantMutation) AddedState() (r int32, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*TenantMutation) ClearCreatedAt

func (m *TenantMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*TenantMutation) ClearDeletedAt

func (m *TenantMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TenantMutation) ClearEdge

func (m *TenantMutation) 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 (*TenantMutation) ClearField

func (m *TenantMutation) 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 (*TenantMutation) ClearRemark

func (m *TenantMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*TenantMutation) ClearUpdatedAt

func (m *TenantMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*TenantMutation) ClearedEdges

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

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

func (*TenantMutation) ClearedFields

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

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

func (TenantMutation) Client

func (m TenantMutation) 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 (*TenantMutation) CreatedAt

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

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

func (*TenantMutation) CreatedAtCleared

func (m *TenantMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*TenantMutation) DeletedAt

func (m *TenantMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*TenantMutation) DeletedAtCleared

func (m *TenantMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*TenantMutation) EdgeCleared

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

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

func (*TenantMutation) Field

func (m *TenantMutation) 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 (*TenantMutation) FieldCleared

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

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

func (*TenantMutation) Fields

func (m *TenantMutation) 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 (*TenantMutation) Filter

func (m *TenantMutation) Filter() *TenantFilter

Filter returns an entql.Where implementation to apply filters on the TenantMutation builder.

func (*TenantMutation) ID

func (m *TenantMutation) ID() (id uint32, 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 (*TenantMutation) IDs

func (m *TenantMutation) IDs(ctx context.Context) ([]uint32, 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 (*TenantMutation) Name

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

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

func (*TenantMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) OldDeletedAt

func (m *TenantMutation) OldDeletedAt(ctx context.Context) (v *time.Time, err error)

OldDeletedAt returns the old "deleted_at" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) OldField

func (m *TenantMutation) 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 (*TenantMutation) OldName

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

OldName returns the old "name" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) OldRemark

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

OldRemark returns the old "remark" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) OldSort

func (m *TenantMutation) OldSort(ctx context.Context) (v *int32, err error)

OldSort returns the old "sort" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) OldState

func (m *TenantMutation) OldState(ctx context.Context) (v *int32, err error)

OldState returns the old "state" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Tenant entity. If the Tenant 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 (*TenantMutation) Op

func (m *TenantMutation) Op() Op

Op returns the operation name.

func (*TenantMutation) Remark

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

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

func (*TenantMutation) RemarkCleared

func (m *TenantMutation) RemarkCleared() bool

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

func (*TenantMutation) RemovedEdges

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

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

func (*TenantMutation) RemovedIDs

func (m *TenantMutation) 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 (*TenantMutation) ResetCreatedAt

func (m *TenantMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TenantMutation) ResetDeletedAt

func (m *TenantMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*TenantMutation) ResetEdge

func (m *TenantMutation) 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 (*TenantMutation) ResetField

func (m *TenantMutation) 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 (*TenantMutation) ResetName

func (m *TenantMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*TenantMutation) ResetRemark

func (m *TenantMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*TenantMutation) ResetSort

func (m *TenantMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*TenantMutation) ResetState

func (m *TenantMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*TenantMutation) ResetUpdatedAt

func (m *TenantMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TenantMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*TenantMutation) SetDeletedAt

func (m *TenantMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

func (*TenantMutation) SetField

func (m *TenantMutation) 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 (*TenantMutation) SetID

func (m *TenantMutation) SetID(id uint32)

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

func (*TenantMutation) SetName

func (m *TenantMutation) SetName(s string)

SetName sets the "name" field.

func (*TenantMutation) SetOp

func (m *TenantMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TenantMutation) SetRemark

func (m *TenantMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*TenantMutation) SetSort

func (m *TenantMutation) SetSort(i int32)

SetSort sets the "sort" field.

func (*TenantMutation) SetState

func (m *TenantMutation) SetState(i int32)

SetState sets the "state" field.

func (*TenantMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*TenantMutation) Sort

func (m *TenantMutation) Sort() (r int32, exists bool)

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

func (*TenantMutation) State

func (m *TenantMutation) State() (r int32, exists bool)

State returns the value of the "state" field in the mutation.

func (TenantMutation) Tx

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

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

func (*TenantMutation) Type

func (m *TenantMutation) Type() string

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

func (*TenantMutation) UpdatedAt

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

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

func (*TenantMutation) UpdatedAtCleared

func (m *TenantMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*TenantMutation) Where

func (m *TenantMutation) Where(ps ...predicate.Tenant)

Where appends a list predicates to the TenantMutation builder.

func (*TenantMutation) WhereP

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

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

type TenantQuery

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

TenantQuery is the builder for querying Tenant entities.

func (*TenantQuery) Aggregate

func (tq *TenantQuery) Aggregate(fns ...AggregateFunc) *TenantSelect

Aggregate returns a TenantSelect configured with the given aggregations.

func (*TenantQuery) All

func (tq *TenantQuery) All(ctx context.Context) ([]*Tenant, error)

All executes the query and returns a list of Tenants.

func (*TenantQuery) AllX

func (tq *TenantQuery) AllX(ctx context.Context) []*Tenant

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

func (*TenantQuery) Clone

func (tq *TenantQuery) Clone() *TenantQuery

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

func (*TenantQuery) Count

func (tq *TenantQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TenantQuery) CountX

func (tq *TenantQuery) CountX(ctx context.Context) int

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

func (*TenantQuery) Exist

func (tq *TenantQuery) Exist(ctx context.Context) (bool, error)

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

func (*TenantQuery) ExistX

func (tq *TenantQuery) ExistX(ctx context.Context) bool

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

func (*TenantQuery) Filter

func (tq *TenantQuery) Filter() *TenantFilter

Filter returns a Filter implementation to apply filters on the TenantQuery builder.

func (*TenantQuery) First

func (tq *TenantQuery) First(ctx context.Context) (*Tenant, error)

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

func (*TenantQuery) FirstID

func (tq *TenantQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*TenantQuery) FirstIDX

func (tq *TenantQuery) FirstIDX(ctx context.Context) uint32

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

func (*TenantQuery) FirstX

func (tq *TenantQuery) FirstX(ctx context.Context) *Tenant

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

func (*TenantQuery) GroupBy

func (tq *TenantQuery) GroupBy(field string, fields ...string) *TenantGroupBy

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.Tenant.Query().
	GroupBy(tenant.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TenantQuery) IDs

func (tq *TenantQuery) IDs(ctx context.Context) (ids []uint32, err error)

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

func (*TenantQuery) IDsX

func (tq *TenantQuery) IDsX(ctx context.Context) []uint32

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

func (*TenantQuery) Limit

func (tq *TenantQuery) Limit(limit int) *TenantQuery

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

func (*TenantQuery) Modify

func (tq *TenantQuery) Modify(modifiers ...func(s *sql.Selector)) *TenantSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*TenantQuery) Offset

func (tq *TenantQuery) Offset(offset int) *TenantQuery

Offset to start from.

func (*TenantQuery) Only

func (tq *TenantQuery) Only(ctx context.Context) (*Tenant, error)

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

func (*TenantQuery) OnlyID

func (tq *TenantQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*TenantQuery) OnlyIDX

func (tq *TenantQuery) OnlyIDX(ctx context.Context) uint32

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

func (*TenantQuery) OnlyX

func (tq *TenantQuery) OnlyX(ctx context.Context) *Tenant

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

func (*TenantQuery) Order

func (tq *TenantQuery) Order(o ...tenant.OrderOption) *TenantQuery

Order specifies how the records should be ordered.

func (*TenantQuery) Select

func (tq *TenantQuery) Select(fields ...string) *TenantSelect

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.Tenant.Query().
	Select(tenant.FieldCreatedAt).
	Scan(ctx, &v)

func (*TenantQuery) Unique

func (tq *TenantQuery) Unique(unique bool) *TenantQuery

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 (*TenantQuery) Where

func (tq *TenantQuery) Where(ps ...predicate.Tenant) *TenantQuery

Where adds a new predicate for the TenantQuery builder.

type TenantSelect

type TenantSelect struct {
	*TenantQuery
	// contains filtered or unexported fields
}

TenantSelect is the builder for selecting fields of Tenant entities.

func (*TenantSelect) Aggregate

func (ts *TenantSelect) Aggregate(fns ...AggregateFunc) *TenantSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TenantSelect) Bool

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

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

func (*TenantSelect) BoolX

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

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

func (*TenantSelect) Bools

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

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

func (*TenantSelect) BoolsX

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

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

func (*TenantSelect) Float64

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

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

func (*TenantSelect) Float64X

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

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

func (*TenantSelect) Float64s

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

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

func (*TenantSelect) Float64sX

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

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

func (*TenantSelect) Int

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

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

func (*TenantSelect) IntX

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

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

func (*TenantSelect) Ints

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

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

func (*TenantSelect) IntsX

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

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

func (*TenantSelect) Modify

func (ts *TenantSelect) Modify(modifiers ...func(s *sql.Selector)) *TenantSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*TenantSelect) Scan

func (ts *TenantSelect) Scan(ctx context.Context, v any) error

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

func (*TenantSelect) ScanX

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

ScanX is like Scan, but panics if an error occurs.

func (*TenantSelect) String

func (s *TenantSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TenantSelect) StringX

func (s *TenantSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TenantSelect) Strings

func (s *TenantSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TenantSelect) StringsX

func (s *TenantSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TenantUpdate

type TenantUpdate struct {
	// contains filtered or unexported fields
}

TenantUpdate is the builder for updating Tenant entities.

func (*TenantUpdate) AddSort

func (tu *TenantUpdate) AddSort(i int32) *TenantUpdate

AddSort adds i to the "sort" field.

func (*TenantUpdate) AddState

func (tu *TenantUpdate) AddState(i int32) *TenantUpdate

AddState adds i to the "state" field.

func (*TenantUpdate) ClearDeletedAt

func (tu *TenantUpdate) ClearDeletedAt() *TenantUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TenantUpdate) ClearRemark

func (tu *TenantUpdate) ClearRemark() *TenantUpdate

ClearRemark clears the value of the "remark" field.

func (*TenantUpdate) ClearUpdatedAt

func (tu *TenantUpdate) ClearUpdatedAt() *TenantUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*TenantUpdate) Exec

func (tu *TenantUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TenantUpdate) ExecX

func (tu *TenantUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TenantUpdate) Modify

func (tu *TenantUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TenantUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*TenantUpdate) Mutation

func (tu *TenantUpdate) Mutation() *TenantMutation

Mutation returns the TenantMutation object of the builder.

func (*TenantUpdate) Save

func (tu *TenantUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TenantUpdate) SaveX

func (tu *TenantUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TenantUpdate) SetDeletedAt

func (tu *TenantUpdate) SetDeletedAt(t time.Time) *TenantUpdate

SetDeletedAt sets the "deleted_at" field.

func (*TenantUpdate) SetName

func (tu *TenantUpdate) SetName(s string) *TenantUpdate

SetName sets the "name" field.

func (*TenantUpdate) SetNillableDeletedAt

func (tu *TenantUpdate) SetNillableDeletedAt(t *time.Time) *TenantUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*TenantUpdate) SetNillableName

func (tu *TenantUpdate) SetNillableName(s *string) *TenantUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*TenantUpdate) SetNillableRemark

func (tu *TenantUpdate) SetNillableRemark(s *string) *TenantUpdate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*TenantUpdate) SetNillableSort

func (tu *TenantUpdate) SetNillableSort(i *int32) *TenantUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*TenantUpdate) SetNillableState

func (tu *TenantUpdate) SetNillableState(i *int32) *TenantUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*TenantUpdate) SetNillableUpdatedAt

func (tu *TenantUpdate) SetNillableUpdatedAt(t *time.Time) *TenantUpdate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*TenantUpdate) SetRemark

func (tu *TenantUpdate) SetRemark(s string) *TenantUpdate

SetRemark sets the "remark" field.

func (*TenantUpdate) SetSort

func (tu *TenantUpdate) SetSort(i int32) *TenantUpdate

SetSort sets the "sort" field.

func (*TenantUpdate) SetState

func (tu *TenantUpdate) SetState(i int32) *TenantUpdate

SetState sets the "state" field.

func (*TenantUpdate) SetUpdatedAt

func (tu *TenantUpdate) SetUpdatedAt(t time.Time) *TenantUpdate

SetUpdatedAt sets the "updated_at" field.

func (*TenantUpdate) Where

func (tu *TenantUpdate) Where(ps ...predicate.Tenant) *TenantUpdate

Where appends a list predicates to the TenantUpdate builder.

type TenantUpdateOne

type TenantUpdateOne struct {
	// contains filtered or unexported fields
}

TenantUpdateOne is the builder for updating a single Tenant entity.

func (*TenantUpdateOne) AddSort

func (tuo *TenantUpdateOne) AddSort(i int32) *TenantUpdateOne

AddSort adds i to the "sort" field.

func (*TenantUpdateOne) AddState

func (tuo *TenantUpdateOne) AddState(i int32) *TenantUpdateOne

AddState adds i to the "state" field.

func (*TenantUpdateOne) ClearDeletedAt

func (tuo *TenantUpdateOne) ClearDeletedAt() *TenantUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TenantUpdateOne) ClearRemark

func (tuo *TenantUpdateOne) ClearRemark() *TenantUpdateOne

ClearRemark clears the value of the "remark" field.

func (*TenantUpdateOne) ClearUpdatedAt

func (tuo *TenantUpdateOne) ClearUpdatedAt() *TenantUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*TenantUpdateOne) Exec

func (tuo *TenantUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TenantUpdateOne) ExecX

func (tuo *TenantUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TenantUpdateOne) Modify

func (tuo *TenantUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *TenantUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*TenantUpdateOne) Mutation

func (tuo *TenantUpdateOne) Mutation() *TenantMutation

Mutation returns the TenantMutation object of the builder.

func (*TenantUpdateOne) Save

func (tuo *TenantUpdateOne) Save(ctx context.Context) (*Tenant, error)

Save executes the query and returns the updated Tenant entity.

func (*TenantUpdateOne) SaveX

func (tuo *TenantUpdateOne) SaveX(ctx context.Context) *Tenant

SaveX is like Save, but panics if an error occurs.

func (*TenantUpdateOne) Select

func (tuo *TenantUpdateOne) Select(field string, fields ...string) *TenantUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TenantUpdateOne) SetDeletedAt

func (tuo *TenantUpdateOne) SetDeletedAt(t time.Time) *TenantUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*TenantUpdateOne) SetName

func (tuo *TenantUpdateOne) SetName(s string) *TenantUpdateOne

SetName sets the "name" field.

func (*TenantUpdateOne) SetNillableDeletedAt

func (tuo *TenantUpdateOne) SetNillableDeletedAt(t *time.Time) *TenantUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*TenantUpdateOne) SetNillableName

func (tuo *TenantUpdateOne) SetNillableName(s *string) *TenantUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*TenantUpdateOne) SetNillableRemark

func (tuo *TenantUpdateOne) SetNillableRemark(s *string) *TenantUpdateOne

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*TenantUpdateOne) SetNillableSort

func (tuo *TenantUpdateOne) SetNillableSort(i *int32) *TenantUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (*TenantUpdateOne) SetNillableState

func (tuo *TenantUpdateOne) SetNillableState(i *int32) *TenantUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*TenantUpdateOne) SetNillableUpdatedAt

func (tuo *TenantUpdateOne) SetNillableUpdatedAt(t *time.Time) *TenantUpdateOne

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*TenantUpdateOne) SetRemark

func (tuo *TenantUpdateOne) SetRemark(s string) *TenantUpdateOne

SetRemark sets the "remark" field.

func (*TenantUpdateOne) SetSort

func (tuo *TenantUpdateOne) SetSort(i int32) *TenantUpdateOne

SetSort sets the "sort" field.

func (*TenantUpdateOne) SetState

func (tuo *TenantUpdateOne) SetState(i int32) *TenantUpdateOne

SetState sets the "state" field.

func (*TenantUpdateOne) SetUpdatedAt

func (tuo *TenantUpdateOne) SetUpdatedAt(t time.Time) *TenantUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*TenantUpdateOne) Where

func (tuo *TenantUpdateOne) Where(ps ...predicate.Tenant) *TenantUpdateOne

Where appends a list predicates to the TenantUpdate builder.

type TenantUpsert

type TenantUpsert struct {
	*sql.UpdateSet
}

TenantUpsert is the "OnConflict" setter.

func (*TenantUpsert) AddSort

func (u *TenantUpsert) AddSort(v int32) *TenantUpsert

AddSort adds v to the "sort" field.

func (*TenantUpsert) AddState

func (u *TenantUpsert) AddState(v int32) *TenantUpsert

AddState adds v to the "state" field.

func (*TenantUpsert) ClearDeletedAt

func (u *TenantUpsert) ClearDeletedAt() *TenantUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TenantUpsert) ClearRemark

func (u *TenantUpsert) ClearRemark() *TenantUpsert

ClearRemark clears the value of the "remark" field.

func (*TenantUpsert) ClearUpdatedAt

func (u *TenantUpsert) ClearUpdatedAt() *TenantUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (*TenantUpsert) SetDeletedAt

func (u *TenantUpsert) SetDeletedAt(v time.Time) *TenantUpsert

SetDeletedAt sets the "deleted_at" field.

func (*TenantUpsert) SetName

func (u *TenantUpsert) SetName(v string) *TenantUpsert

SetName sets the "name" field.

func (*TenantUpsert) SetRemark

func (u *TenantUpsert) SetRemark(v string) *TenantUpsert

SetRemark sets the "remark" field.

func (*TenantUpsert) SetSort

func (u *TenantUpsert) SetSort(v int32) *TenantUpsert

SetSort sets the "sort" field.

func (*TenantUpsert) SetState

func (u *TenantUpsert) SetState(v int32) *TenantUpsert

SetState sets the "state" field.

func (*TenantUpsert) SetUpdatedAt

func (u *TenantUpsert) SetUpdatedAt(v time.Time) *TenantUpsert

SetUpdatedAt sets the "updated_at" field.

func (*TenantUpsert) UpdateDeletedAt

func (u *TenantUpsert) UpdateDeletedAt() *TenantUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*TenantUpsert) UpdateName

func (u *TenantUpsert) UpdateName() *TenantUpsert

UpdateName sets the "name" field to the value that was provided on create.

func (*TenantUpsert) UpdateRemark

func (u *TenantUpsert) UpdateRemark() *TenantUpsert

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*TenantUpsert) UpdateSort

func (u *TenantUpsert) UpdateSort() *TenantUpsert

UpdateSort sets the "sort" field to the value that was provided on create.

func (*TenantUpsert) UpdateState

func (u *TenantUpsert) UpdateState() *TenantUpsert

UpdateState sets the "state" field to the value that was provided on create.

func (*TenantUpsert) UpdateUpdatedAt

func (u *TenantUpsert) UpdateUpdatedAt() *TenantUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type TenantUpsertBulk

type TenantUpsertBulk struct {
	// contains filtered or unexported fields
}

TenantUpsertBulk is the builder for "upsert"-ing a bulk of Tenant nodes.

func (*TenantUpsertBulk) AddSort

func (u *TenantUpsertBulk) AddSort(v int32) *TenantUpsertBulk

AddSort adds v to the "sort" field.

func (*TenantUpsertBulk) AddState

func (u *TenantUpsertBulk) AddState(v int32) *TenantUpsertBulk

AddState adds v to the "state" field.

func (*TenantUpsertBulk) ClearDeletedAt

func (u *TenantUpsertBulk) ClearDeletedAt() *TenantUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TenantUpsertBulk) ClearRemark

func (u *TenantUpsertBulk) ClearRemark() *TenantUpsertBulk

ClearRemark clears the value of the "remark" field.

func (*TenantUpsertBulk) ClearUpdatedAt

func (u *TenantUpsertBulk) ClearUpdatedAt() *TenantUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (*TenantUpsertBulk) DoNothing

func (u *TenantUpsertBulk) DoNothing() *TenantUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TenantUpsertBulk) Exec

func (u *TenantUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TenantUpsertBulk) ExecX

func (u *TenantUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TenantUpsertBulk) Ignore

func (u *TenantUpsertBulk) Ignore() *TenantUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tenant.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TenantUpsertBulk) SetDeletedAt

func (u *TenantUpsertBulk) SetDeletedAt(v time.Time) *TenantUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*TenantUpsertBulk) SetName

func (u *TenantUpsertBulk) SetName(v string) *TenantUpsertBulk

SetName sets the "name" field.

func (*TenantUpsertBulk) SetRemark

func (u *TenantUpsertBulk) SetRemark(v string) *TenantUpsertBulk

SetRemark sets the "remark" field.

func (*TenantUpsertBulk) SetSort

func (u *TenantUpsertBulk) SetSort(v int32) *TenantUpsertBulk

SetSort sets the "sort" field.

func (*TenantUpsertBulk) SetState

func (u *TenantUpsertBulk) SetState(v int32) *TenantUpsertBulk

SetState sets the "state" field.

func (*TenantUpsertBulk) SetUpdatedAt

func (u *TenantUpsertBulk) SetUpdatedAt(v time.Time) *TenantUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*TenantUpsertBulk) Update

func (u *TenantUpsertBulk) Update(set func(*TenantUpsert)) *TenantUpsertBulk

Update allows overriding fields `UPDATE` values. See the TenantCreateBulk.OnConflict documentation for more info.

func (*TenantUpsertBulk) UpdateDeletedAt

func (u *TenantUpsertBulk) UpdateDeletedAt() *TenantUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*TenantUpsertBulk) UpdateName

func (u *TenantUpsertBulk) UpdateName() *TenantUpsertBulk

UpdateName sets the "name" field to the value that was provided on create.

func (*TenantUpsertBulk) UpdateNewValues

func (u *TenantUpsertBulk) UpdateNewValues() *TenantUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Tenant.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(tenant.FieldID)
		}),
	).
	Exec(ctx)

func (*TenantUpsertBulk) UpdateRemark

func (u *TenantUpsertBulk) UpdateRemark() *TenantUpsertBulk

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*TenantUpsertBulk) UpdateSort

func (u *TenantUpsertBulk) UpdateSort() *TenantUpsertBulk

UpdateSort sets the "sort" field to the value that was provided on create.

func (*TenantUpsertBulk) UpdateState

func (u *TenantUpsertBulk) UpdateState() *TenantUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

func (*TenantUpsertBulk) UpdateUpdatedAt

func (u *TenantUpsertBulk) UpdateUpdatedAt() *TenantUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type TenantUpsertOne

type TenantUpsertOne struct {
	// contains filtered or unexported fields
}

TenantUpsertOne is the builder for "upsert"-ing

one Tenant node.

func (*TenantUpsertOne) AddSort

func (u *TenantUpsertOne) AddSort(v int32) *TenantUpsertOne

AddSort adds v to the "sort" field.

func (*TenantUpsertOne) AddState

func (u *TenantUpsertOne) AddState(v int32) *TenantUpsertOne

AddState adds v to the "state" field.

func (*TenantUpsertOne) ClearDeletedAt

func (u *TenantUpsertOne) ClearDeletedAt() *TenantUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*TenantUpsertOne) ClearRemark

func (u *TenantUpsertOne) ClearRemark() *TenantUpsertOne

ClearRemark clears the value of the "remark" field.

func (*TenantUpsertOne) ClearUpdatedAt

func (u *TenantUpsertOne) ClearUpdatedAt() *TenantUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*TenantUpsertOne) DoNothing

func (u *TenantUpsertOne) DoNothing() *TenantUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TenantUpsertOne) Exec

func (u *TenantUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*TenantUpsertOne) ExecX

func (u *TenantUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TenantUpsertOne) ID

func (u *TenantUpsertOne) ID(ctx context.Context) (id uint32, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*TenantUpsertOne) IDX

func (u *TenantUpsertOne) IDX(ctx context.Context) uint32

IDX is like ID, but panics if an error occurs.

func (*TenantUpsertOne) Ignore

func (u *TenantUpsertOne) Ignore() *TenantUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Tenant.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TenantUpsertOne) SetDeletedAt

func (u *TenantUpsertOne) SetDeletedAt(v time.Time) *TenantUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*TenantUpsertOne) SetName

func (u *TenantUpsertOne) SetName(v string) *TenantUpsertOne

SetName sets the "name" field.

func (*TenantUpsertOne) SetRemark

func (u *TenantUpsertOne) SetRemark(v string) *TenantUpsertOne

SetRemark sets the "remark" field.

func (*TenantUpsertOne) SetSort

func (u *TenantUpsertOne) SetSort(v int32) *TenantUpsertOne

SetSort sets the "sort" field.

func (*TenantUpsertOne) SetState

func (u *TenantUpsertOne) SetState(v int32) *TenantUpsertOne

SetState sets the "state" field.

func (*TenantUpsertOne) SetUpdatedAt

func (u *TenantUpsertOne) SetUpdatedAt(v time.Time) *TenantUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*TenantUpsertOne) Update

func (u *TenantUpsertOne) Update(set func(*TenantUpsert)) *TenantUpsertOne

Update allows overriding fields `UPDATE` values. See the TenantCreate.OnConflict documentation for more info.

func (*TenantUpsertOne) UpdateDeletedAt

func (u *TenantUpsertOne) UpdateDeletedAt() *TenantUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*TenantUpsertOne) UpdateName

func (u *TenantUpsertOne) UpdateName() *TenantUpsertOne

UpdateName sets the "name" field to the value that was provided on create.

func (*TenantUpsertOne) UpdateNewValues

func (u *TenantUpsertOne) UpdateNewValues() *TenantUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Tenant.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(tenant.FieldID)
		}),
	).
	Exec(ctx)

func (*TenantUpsertOne) UpdateRemark

func (u *TenantUpsertOne) UpdateRemark() *TenantUpsertOne

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*TenantUpsertOne) UpdateSort

func (u *TenantUpsertOne) UpdateSort() *TenantUpsertOne

UpdateSort sets the "sort" field to the value that was provided on create.

func (*TenantUpsertOne) UpdateState

func (u *TenantUpsertOne) UpdateState() *TenantUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

func (*TenantUpsertOne) UpdateUpdatedAt

func (u *TenantUpsertOne) UpdateUpdatedAt() *TenantUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type Tenants

type Tenants []*Tenant

Tenants is a parsable slice of Tenant.

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 {

	// Dept is the client for interacting with the Dept builders.
	Dept *DeptClient
	// Member is the client for interacting with the Member builders.
	Member *MemberClient
	// Menu is the client for interacting with the Menu builders.
	Menu *MenuClient
	// Post is the client for interacting with the Post builders.
	Post *PostClient
	// Role is the client for interacting with the Role builders.
	Role *RoleClient
	// Tenant is the client for interacting with the Tenant builders.
	Tenant *TenantClient
	// 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) 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) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	// id
	ID uint32 `json:"id,omitempty"`
	// 创建时间
	CreatedAt *time.Time `json:"created_at,omitempty"`
	// 更新时间
	UpdatedAt *time.Time `json:"updated_at,omitempty"`
	// 删除时间
	DeletedAt *time.Time `json:"deleted_at,omitempty"`
	// 备注
	Remark *string `json:"remark,omitempty"`
	// 排序
	Sort *int32 `json:"sort,omitempty"`
	// 状态 0 UNSPECIFIED 开启 1 -> ACTIVE 关闭 2 -> INACTIVE, 禁用 3 -> BANNED
	State *int32 `json:"state,omitempty"`
	// 用户名
	Name *string `json:"name,omitempty"`
	// 密码
	Password *string `json:"password,omitempty"`
	// 昵称
	NickName *string `json:"nick_name,omitempty"`
	// 昵称
	RealName *string `json:"real_name,omitempty"`
	// 手机号
	Phone *string `json:"phone,omitempty"`
	// 电子邮箱
	Email *string `json:"email,omitempty"`
	// 生日
	Birthday *time.Time `json:"birthday,omitempty"`
	// 性别 0 UNSPECIFIED, 1 -> MAN, 2 -> WOMAN
	Gender *int32 `json:"gender,omitempty"`
	// 头像
	Avatar *string `json:"avatar,omitempty"`
	// 个人说明
	Description *string `json:"description,omitempty"`
	// 授权 0 UNSPECIFIED, 1 -> SYS_ADMIN, 2 -> CUSTOMER_USER, 3 -> GUEST_USER, 4 -> REFRESH_TOKEN
	Authority *int32 `json:"authority,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
}

用户表

func (*User) QueryPosts

func (u *User) QueryPosts() *PostQuery

QueryPosts queries the "posts" 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

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 uint32) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uint32) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uint32) *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

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) QueryPosts

func (c *UserClient) QueryPosts(u *User) *PostQuery

QueryPosts queries the posts 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 uint32) *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) AddPostIDs

func (uc *UserCreate) AddPostIDs(ids ...uint32) *UserCreate

AddPostIDs adds the "posts" edge to the Post entity by IDs.

func (*UserCreate) AddPosts

func (uc *UserCreate) AddPosts(p ...*Post) *UserCreate

AddPosts adds the "posts" edges to the Post entity.

func (*UserCreate) AddRoleIDs

func (uc *UserCreate) AddRoleIDs(ids ...uint32) *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) 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) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetCreatedAt(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

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) SetAuthority

func (uc *UserCreate) SetAuthority(i int32) *UserCreate

SetAuthority sets the "authority" field.

func (*UserCreate) SetAvatar

func (uc *UserCreate) SetAvatar(s string) *UserCreate

SetAvatar sets the "avatar" field.

func (*UserCreate) SetBirthday

func (uc *UserCreate) SetBirthday(t time.Time) *UserCreate

SetBirthday sets the "birthday" field.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetDeletedAt

func (uc *UserCreate) SetDeletedAt(t time.Time) *UserCreate

SetDeletedAt sets the "deleted_at" field.

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) SetGender

func (uc *UserCreate) SetGender(i int32) *UserCreate

SetGender sets the "gender" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uint32) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNickName

func (uc *UserCreate) SetNickName(s string) *UserCreate

SetNickName sets the "nick_name" field.

func (*UserCreate) SetNillableAuthority

func (uc *UserCreate) SetNillableAuthority(i *int32) *UserCreate

SetNillableAuthority sets the "authority" field if the given value is not nil.

func (*UserCreate) SetNillableAvatar

func (uc *UserCreate) SetNillableAvatar(s *string) *UserCreate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserCreate) SetNillableBirthday

func (uc *UserCreate) SetNillableBirthday(t *time.Time) *UserCreate

SetNillableBirthday sets the "birthday" 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

func (uc *UserCreate) SetNillableDeletedAt(t *time.Time) *UserCreate

SetNillableDeletedAt sets the "deleted_at" field 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) SetNillableGender

func (uc *UserCreate) SetNillableGender(i *int32) *UserCreate

SetNillableGender sets the "gender" field if the given value is not nil.

func (*UserCreate) SetNillableNickName

func (uc *UserCreate) SetNillableNickName(s *string) *UserCreate

SetNillableNickName sets the "nick_name" field if the given value is not nil.

func (*UserCreate) SetNillablePassword

func (uc *UserCreate) SetNillablePassword(s *string) *UserCreate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserCreate) SetNillableRealName

func (uc *UserCreate) SetNillableRealName(s *string) *UserCreate

SetNillableRealName sets the "real_name" field if the given value is not nil.

func (*UserCreate) SetNillableRemark

func (uc *UserCreate) SetNillableRemark(s *string) *UserCreate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*UserCreate) SetNillableSort

func (uc *UserCreate) SetNillableSort(i *int32) *UserCreate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*UserCreate) SetNillableState

func (uc *UserCreate) SetNillableState(i *int32) *UserCreate

SetNillableState sets the "state" 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) SetPassword

func (uc *UserCreate) SetPassword(s string) *UserCreate

SetPassword sets the "password" field.

func (*UserCreate) SetPhone

func (uc *UserCreate) SetPhone(s string) *UserCreate

SetPhone sets the "phone" field.

func (*UserCreate) SetRealName

func (uc *UserCreate) SetRealName(s string) *UserCreate

SetRealName sets the "real_name" field.

func (*UserCreate) SetRemark

func (uc *UserCreate) SetRemark(s string) *UserCreate

SetRemark sets the "remark" field.

func (*UserCreate) SetSort

func (uc *UserCreate) SetSort(i int32) *UserCreate

SetSort sets the "sort" field.

func (*UserCreate) SetState

func (uc *UserCreate) SetState(i int32) *UserCreate

SetState sets the "state" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" 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) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetCreatedAt(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

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) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

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 {
	// Roles holds the value of the roles edge.
	Roles []*Role `json:"roles,omitempty"`
	// Posts holds the value of the posts edge.
	Posts []*Post `json:"posts,omitempty"`
	// contains filtered or unexported fields
}

UserEdges holds the relations/edges for other nodes in the graph.

func (UserEdges) PostsOrErr

func (e UserEdges) PostsOrErr() ([]*Post, error)

PostsOrErr returns the Posts 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 UserFilter

type UserFilter struct {
	// contains filtered or unexported fields
}

UserFilter provides a generic filtering capability at runtime for UserQuery.

func (*UserFilter) Where

func (f *UserFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*UserFilter) WhereAuthority

func (f *UserFilter) WhereAuthority(p entql.Int32P)

WhereAuthority applies the entql int32 predicate on the authority field.

func (*UserFilter) WhereAvatar

func (f *UserFilter) WhereAvatar(p entql.StringP)

WhereAvatar applies the entql string predicate on the avatar field.

func (*UserFilter) WhereBirthday

func (f *UserFilter) WhereBirthday(p entql.TimeP)

WhereBirthday applies the entql time.Time predicate on the birthday field.

func (*UserFilter) WhereCreatedAt

func (f *UserFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*UserFilter) WhereDeletedAt

func (f *UserFilter) WhereDeletedAt(p entql.TimeP)

WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.

func (*UserFilter) WhereDescription

func (f *UserFilter) WhereDescription(p entql.StringP)

WhereDescription applies the entql string predicate on the description field.

func (*UserFilter) WhereEmail

func (f *UserFilter) WhereEmail(p entql.StringP)

WhereEmail applies the entql string predicate on the email field.

func (*UserFilter) WhereGender

func (f *UserFilter) WhereGender(p entql.Int32P)

WhereGender applies the entql int32 predicate on the gender field.

func (*UserFilter) WhereHasPosts

func (f *UserFilter) WhereHasPosts()

WhereHasPosts applies a predicate to check if query has an edge posts.

func (*UserFilter) WhereHasPostsWith

func (f *UserFilter) WhereHasPostsWith(preds ...predicate.Post)

WhereHasPostsWith applies a predicate to check if query has an edge posts with a given conditions (other predicates).

func (*UserFilter) WhereHasRoles

func (f *UserFilter) WhereHasRoles()

WhereHasRoles applies a predicate to check if query has an edge roles.

func (*UserFilter) WhereHasRolesWith

func (f *UserFilter) WhereHasRolesWith(preds ...predicate.Role)

WhereHasRolesWith applies a predicate to check if query has an edge roles with a given conditions (other predicates).

func (*UserFilter) WhereID

func (f *UserFilter) WhereID(p entql.Uint32P)

WhereID applies the entql uint32 predicate on the id field.

func (*UserFilter) WhereName

func (f *UserFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

func (*UserFilter) WhereNickName

func (f *UserFilter) WhereNickName(p entql.StringP)

WhereNickName applies the entql string predicate on the nick_name field.

func (*UserFilter) WherePassword

func (f *UserFilter) WherePassword(p entql.StringP)

WherePassword applies the entql string predicate on the password field.

func (*UserFilter) WherePhone

func (f *UserFilter) WherePhone(p entql.StringP)

WherePhone applies the entql string predicate on the phone field.

func (*UserFilter) WhereRealName

func (f *UserFilter) WhereRealName(p entql.StringP)

WhereRealName applies the entql string predicate on the real_name field.

func (*UserFilter) WhereRemark

func (f *UserFilter) WhereRemark(p entql.StringP)

WhereRemark applies the entql string predicate on the remark field.

func (*UserFilter) WhereSort

func (f *UserFilter) WhereSort(p entql.Int32P)

WhereSort applies the entql int32 predicate on the sort field.

func (*UserFilter) WhereState

func (f *UserFilter) WhereState(p entql.Int32P)

WhereState applies the entql int32 predicate on the state field.

func (*UserFilter) WhereUpdatedAt

func (f *UserFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

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) AddAuthority

func (m *UserMutation) AddAuthority(i int32)

AddAuthority adds i to the "authority" field.

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) AddGender

func (m *UserMutation) AddGender(i int32)

AddGender adds i to the "gender" field.

func (*UserMutation) AddPostIDs

func (m *UserMutation) AddPostIDs(ids ...uint32)

AddPostIDs adds the "posts" edge to the Post entity by ids.

func (*UserMutation) AddRoleIDs

func (m *UserMutation) AddRoleIDs(ids ...uint32)

AddRoleIDs adds the "roles" edge to the Role entity by ids.

func (*UserMutation) AddSort

func (m *UserMutation) AddSort(i int32)

AddSort adds i to the "sort" field.

func (*UserMutation) AddState

func (m *UserMutation) AddState(i int32)

AddState adds i to the "state" field.

func (*UserMutation) AddedAuthority

func (m *UserMutation) AddedAuthority() (r int32, exists bool)

AddedAuthority returns the value that was added to the "authority" field in this mutation.

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) AddedGender

func (m *UserMutation) AddedGender() (r int32, exists bool)

AddedGender returns the value that was added to the "gender" field in 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) AddedSort

func (m *UserMutation) AddedSort() (r int32, exists bool)

AddedSort returns the value that was added to the "sort" field in this mutation.

func (*UserMutation) AddedState

func (m *UserMutation) AddedState() (r int32, exists bool)

AddedState returns the value that was added to the "state" field in this mutation.

func (*UserMutation) Authority

func (m *UserMutation) Authority() (r int32, exists bool)

Authority returns the value of the "authority" field in the 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) Birthday

func (m *UserMutation) Birthday() (r time.Time, exists bool)

Birthday returns the value of the "birthday" field in the mutation.

func (*UserMutation) ClearCreatedAt

func (m *UserMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*UserMutation) ClearDeletedAt

func (m *UserMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" 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) 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) ClearPosts

func (m *UserMutation) ClearPosts()

ClearPosts clears the "posts" edge to the Post entity.

func (*UserMutation) ClearRemark

func (m *UserMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*UserMutation) ClearRoles

func (m *UserMutation) ClearRoles()

ClearRoles clears the "roles" edge to the Role entity.

func (*UserMutation) ClearUpdatedAt

func (m *UserMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" 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) CreatedAtCleared

func (m *UserMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*UserMutation) DeletedAt

func (m *UserMutation) DeletedAt() (r time.Time, exists bool)

DeletedAt returns the value of the "deleted_at" field in the mutation.

func (*UserMutation) DeletedAtCleared

func (m *UserMutation) DeletedAtCleared() bool

DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.

func (*UserMutation) Description

func (m *UserMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the 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) 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) Filter

func (m *UserMutation) Filter() *UserFilter

Filter returns an entql.Where implementation to apply filters on the UserMutation builder.

func (*UserMutation) Gender

func (m *UserMutation) Gender() (r int32, exists bool)

Gender returns the value of the "gender" field in the mutation.

func (*UserMutation) ID

func (m *UserMutation) ID() (id uint32, 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) ([]uint32, 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) Name

func (m *UserMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*UserMutation) NickName

func (m *UserMutation) NickName() (r string, exists bool)

NickName returns the value of the "nick_name" field in the mutation.

func (*UserMutation) OldAuthority

func (m *UserMutation) OldAuthority(ctx context.Context) (v *int32, err error)

OldAuthority returns the old "authority" 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) 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) OldBirthday

func (m *UserMutation) OldBirthday(ctx context.Context) (v *time.Time, err error)

OldBirthday returns the old "birthday" 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

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) 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) OldGender

func (m *UserMutation) OldGender(ctx context.Context) (v *int32, err error)

OldGender returns the old "gender" 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) OldName

func (m *UserMutation) OldName(ctx context.Context) (v *string, err error)

OldName returns the old "name" 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 "nick_name" 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) OldPhone

func (m *UserMutation) OldPhone(ctx context.Context) (v *string, err error)

OldPhone returns the old "phone" 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) OldRealName

func (m *UserMutation) OldRealName(ctx context.Context) (v *string, err error)

OldRealName returns the old "real_name" 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) OldRemark

func (m *UserMutation) OldRemark(ctx context.Context) (v *string, err error)

OldRemark returns the old "remark" 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) OldSort

func (m *UserMutation) OldSort(ctx context.Context) (v *int32, err error)

OldSort returns the old "sort" 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) OldState

func (m *UserMutation) OldState(ctx context.Context) (v *int32, err error)

OldState returns the old "state" 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) 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) Phone

func (m *UserMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*UserMutation) PostsCleared

func (m *UserMutation) PostsCleared() bool

PostsCleared reports if the "posts" edge to the Post entity was cleared.

func (*UserMutation) PostsIDs

func (m *UserMutation) PostsIDs() (ids []uint32)

PostsIDs returns the "posts" edge IDs in the mutation.

func (*UserMutation) RealName

func (m *UserMutation) RealName() (r string, exists bool)

RealName returns the value of the "real_name" field in the mutation.

func (*UserMutation) Remark

func (m *UserMutation) Remark() (r string, exists bool)

Remark returns the value of the "remark" field in the mutation.

func (*UserMutation) RemarkCleared

func (m *UserMutation) RemarkCleared() bool

RemarkCleared returns if the "remark" field was cleared in this mutation.

func (*UserMutation) RemovePostIDs

func (m *UserMutation) RemovePostIDs(ids ...uint32)

RemovePostIDs removes the "posts" edge to the Post entity by IDs.

func (*UserMutation) RemoveRoleIDs

func (m *UserMutation) RemoveRoleIDs(ids ...uint32)

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) RemovedPostsIDs

func (m *UserMutation) RemovedPostsIDs() (ids []uint32)

RemovedPosts returns the removed IDs of the "posts" edge to the Post entity.

func (*UserMutation) RemovedRolesIDs

func (m *UserMutation) RemovedRolesIDs() (ids []uint32)

RemovedRoles returns the removed IDs of the "roles" edge to the Role entity.

func (*UserMutation) ResetAuthority

func (m *UserMutation) ResetAuthority()

ResetAuthority resets all changes to the "authority" field.

func (*UserMutation) ResetAvatar

func (m *UserMutation) ResetAvatar()

ResetAvatar resets all changes to the "avatar" field.

func (*UserMutation) ResetBirthday

func (m *UserMutation) ResetBirthday()

ResetBirthday resets all changes to the "birthday" field.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDeletedAt

func (m *UserMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

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) ResetGender

func (m *UserMutation) ResetGender()

ResetGender resets all changes to the "gender" field.

func (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetNickName

func (m *UserMutation) ResetNickName()

ResetNickName resets all changes to the "nick_name" field.

func (*UserMutation) ResetPassword

func (m *UserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*UserMutation) ResetPhone

func (m *UserMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*UserMutation) ResetPosts

func (m *UserMutation) ResetPosts()

ResetPosts resets all changes to the "posts" edge.

func (*UserMutation) ResetRealName

func (m *UserMutation) ResetRealName()

ResetRealName resets all changes to the "real_name" field.

func (*UserMutation) ResetRemark

func (m *UserMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*UserMutation) ResetRoles

func (m *UserMutation) ResetRoles()

ResetRoles resets all changes to the "roles" edge.

func (*UserMutation) ResetSort

func (m *UserMutation) ResetSort()

ResetSort resets all changes to the "sort" field.

func (*UserMutation) ResetState

func (m *UserMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" 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 []uint32)

RolesIDs returns the "roles" edge IDs in the mutation.

func (*UserMutation) SetAuthority

func (m *UserMutation) SetAuthority(i int32)

SetAuthority sets the "authority" field.

func (*UserMutation) SetAvatar

func (m *UserMutation) SetAvatar(s string)

SetAvatar sets the "avatar" field.

func (*UserMutation) SetBirthday

func (m *UserMutation) SetBirthday(t time.Time)

SetBirthday sets the "birthday" field.

func (*UserMutation) SetCreatedAt

func (m *UserMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetDeletedAt

func (m *UserMutation) SetDeletedAt(t time.Time)

SetDeletedAt sets the "deleted_at" field.

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) SetGender

func (m *UserMutation) SetGender(i int32)

SetGender sets the "gender" field.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id uint32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetNickName

func (m *UserMutation) SetNickName(s string)

SetNickName sets the "nick_name" 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) SetPhone

func (m *UserMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*UserMutation) SetRealName

func (m *UserMutation) SetRealName(s string)

SetRealName sets the "real_name" field.

func (*UserMutation) SetRemark

func (m *UserMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*UserMutation) SetSort

func (m *UserMutation) SetSort(i int32)

SetSort sets the "sort" field.

func (*UserMutation) SetState

func (m *UserMutation) SetState(i int32)

SetState sets the "state" field.

func (*UserMutation) SetUpdatedAt

func (m *UserMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*UserMutation) Sort

func (m *UserMutation) Sort() (r int32, exists bool)

Sort returns the value of the "sort" field in the mutation.

func (*UserMutation) State

func (m *UserMutation) State() (r int32, exists bool)

State returns the value of the "state" field in the 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) UpdatedAtCleared

func (m *UserMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this 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 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) 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) Filter

func (uq *UserQuery) Filter() *UserFilter

Filter returns a Filter implementation to apply filters on the UserQuery builder.

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 uint32, 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) uint32

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 []uint32, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uint32

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) Modify

func (uq *UserQuery) Modify(modifiers ...func(s *sql.Selector)) *UserSelect

Modify adds a query modifier for attaching custom logic to queries.

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 uint32, 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) uint32

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) QueryPosts

func (uq *UserQuery) QueryPosts() *PostQuery

QueryPosts chains the current query on the "posts" 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) WithPosts

func (uq *UserQuery) WithPosts(opts ...func(*PostQuery)) *UserQuery

WithPosts tells the query-builder to eager-load the nodes that are connected to the "posts" 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) 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) Modify

func (us *UserSelect) Modify(modifiers ...func(s *sql.Selector)) *UserSelect

Modify adds a query modifier for attaching custom logic to queries.

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) AddAuthority

func (uu *UserUpdate) AddAuthority(i int32) *UserUpdate

AddAuthority adds i to the "authority" field.

func (*UserUpdate) AddGender

func (uu *UserUpdate) AddGender(i int32) *UserUpdate

AddGender adds i to the "gender" field.

func (*UserUpdate) AddPostIDs

func (uu *UserUpdate) AddPostIDs(ids ...uint32) *UserUpdate

AddPostIDs adds the "posts" edge to the Post entity by IDs.

func (*UserUpdate) AddPosts

func (uu *UserUpdate) AddPosts(p ...*Post) *UserUpdate

AddPosts adds the "posts" edges to the Post entity.

func (*UserUpdate) AddRoleIDs

func (uu *UserUpdate) AddRoleIDs(ids ...uint32) *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) AddSort

func (uu *UserUpdate) AddSort(i int32) *UserUpdate

AddSort adds i to the "sort" field.

func (*UserUpdate) AddState

func (uu *UserUpdate) AddState(i int32) *UserUpdate

AddState adds i to the "state" field.

func (*UserUpdate) ClearDeletedAt

func (uu *UserUpdate) ClearDeletedAt() *UserUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpdate) ClearPosts

func (uu *UserUpdate) ClearPosts() *UserUpdate

ClearPosts clears all "posts" edges to the Post entity.

func (*UserUpdate) ClearRemark

func (uu *UserUpdate) ClearRemark() *UserUpdate

ClearRemark clears the value of the "remark" field.

func (*UserUpdate) ClearRoles

func (uu *UserUpdate) ClearRoles() *UserUpdate

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdate) ClearUpdatedAt

func (uu *UserUpdate) ClearUpdatedAt() *UserUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Modify

func (uu *UserUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) RemovePostIDs

func (uu *UserUpdate) RemovePostIDs(ids ...uint32) *UserUpdate

RemovePostIDs removes the "posts" edge to Post entities by IDs.

func (*UserUpdate) RemovePosts

func (uu *UserUpdate) RemovePosts(p ...*Post) *UserUpdate

RemovePosts removes "posts" edges to Post entities.

func (*UserUpdate) RemoveRoleIDs

func (uu *UserUpdate) RemoveRoleIDs(ids ...uint32) *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) SetAuthority

func (uu *UserUpdate) SetAuthority(i int32) *UserUpdate

SetAuthority sets the "authority" field.

func (*UserUpdate) SetAvatar

func (uu *UserUpdate) SetAvatar(s string) *UserUpdate

SetAvatar sets the "avatar" field.

func (*UserUpdate) SetBirthday

func (uu *UserUpdate) SetBirthday(t time.Time) *UserUpdate

SetBirthday sets the "birthday" field.

func (*UserUpdate) SetDeletedAt

func (uu *UserUpdate) SetDeletedAt(t time.Time) *UserUpdate

SetDeletedAt sets the "deleted_at" field.

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) SetGender

func (uu *UserUpdate) SetGender(i int32) *UserUpdate

SetGender sets the "gender" field.

func (*UserUpdate) SetNickName

func (uu *UserUpdate) SetNickName(s string) *UserUpdate

SetNickName sets the "nick_name" field.

func (*UserUpdate) SetNillableAuthority

func (uu *UserUpdate) SetNillableAuthority(i *int32) *UserUpdate

SetNillableAuthority sets the "authority" field if the given value is not nil.

func (*UserUpdate) SetNillableAvatar

func (uu *UserUpdate) SetNillableAvatar(s *string) *UserUpdate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserUpdate) SetNillableBirthday

func (uu *UserUpdate) SetNillableBirthday(t *time.Time) *UserUpdate

SetNillableBirthday sets the "birthday" field if the given value is not nil.

func (*UserUpdate) SetNillableDeletedAt

func (uu *UserUpdate) SetNillableDeletedAt(t *time.Time) *UserUpdate

SetNillableDeletedAt sets the "deleted_at" field 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) SetNillableGender

func (uu *UserUpdate) SetNillableGender(i *int32) *UserUpdate

SetNillableGender sets the "gender" field if the given value is not nil.

func (*UserUpdate) SetNillableNickName

func (uu *UserUpdate) SetNillableNickName(s *string) *UserUpdate

SetNillableNickName sets the "nick_name" field if the given value is not nil.

func (*UserUpdate) SetNillablePassword

func (uu *UserUpdate) SetNillablePassword(s *string) *UserUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdate) SetNillablePhone

func (uu *UserUpdate) SetNillablePhone(s *string) *UserUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*UserUpdate) SetNillableRealName

func (uu *UserUpdate) SetNillableRealName(s *string) *UserUpdate

SetNillableRealName sets the "real_name" field if the given value is not nil.

func (*UserUpdate) SetNillableRemark

func (uu *UserUpdate) SetNillableRemark(s *string) *UserUpdate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*UserUpdate) SetNillableSort

func (uu *UserUpdate) SetNillableSort(i *int32) *UserUpdate

SetNillableSort sets the "sort" field if the given value is not nil.

func (*UserUpdate) SetNillableState

func (uu *UserUpdate) SetNillableState(i *int32) *UserUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*UserUpdate) SetNillableUpdatedAt

func (uu *UserUpdate) SetNillableUpdatedAt(t *time.Time) *UserUpdate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserUpdate) SetPassword

func (uu *UserUpdate) SetPassword(s string) *UserUpdate

SetPassword sets the "password" field.

func (*UserUpdate) SetPhone

func (uu *UserUpdate) SetPhone(s string) *UserUpdate

SetPhone sets the "phone" field.

func (*UserUpdate) SetRealName

func (uu *UserUpdate) SetRealName(s string) *UserUpdate

SetRealName sets the "real_name" field.

func (*UserUpdate) SetRemark

func (uu *UserUpdate) SetRemark(s string) *UserUpdate

SetRemark sets the "remark" field.

func (*UserUpdate) SetSort

func (uu *UserUpdate) SetSort(i int32) *UserUpdate

SetSort sets the "sort" field.

func (*UserUpdate) SetState

func (uu *UserUpdate) SetState(i int32) *UserUpdate

SetState sets the "state" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" 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) AddAuthority

func (uuo *UserUpdateOne) AddAuthority(i int32) *UserUpdateOne

AddAuthority adds i to the "authority" field.

func (*UserUpdateOne) AddGender

func (uuo *UserUpdateOne) AddGender(i int32) *UserUpdateOne

AddGender adds i to the "gender" field.

func (*UserUpdateOne) AddPostIDs

func (uuo *UserUpdateOne) AddPostIDs(ids ...uint32) *UserUpdateOne

AddPostIDs adds the "posts" edge to the Post entity by IDs.

func (*UserUpdateOne) AddPosts

func (uuo *UserUpdateOne) AddPosts(p ...*Post) *UserUpdateOne

AddPosts adds the "posts" edges to the Post entity.

func (*UserUpdateOne) AddRoleIDs

func (uuo *UserUpdateOne) AddRoleIDs(ids ...uint32) *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) AddSort

func (uuo *UserUpdateOne) AddSort(i int32) *UserUpdateOne

AddSort adds i to the "sort" field.

func (*UserUpdateOne) AddState

func (uuo *UserUpdateOne) AddState(i int32) *UserUpdateOne

AddState adds i to the "state" field.

func (*UserUpdateOne) ClearDeletedAt

func (uuo *UserUpdateOne) ClearDeletedAt() *UserUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpdateOne) ClearPosts

func (uuo *UserUpdateOne) ClearPosts() *UserUpdateOne

ClearPosts clears all "posts" edges to the Post entity.

func (*UserUpdateOne) ClearRemark

func (uuo *UserUpdateOne) ClearRemark() *UserUpdateOne

ClearRemark clears the value of the "remark" field.

func (*UserUpdateOne) ClearRoles

func (uuo *UserUpdateOne) ClearRoles() *UserUpdateOne

ClearRoles clears all "roles" edges to the Role entity.

func (*UserUpdateOne) ClearUpdatedAt

func (uuo *UserUpdateOne) ClearUpdatedAt() *UserUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Modify

func (uuo *UserUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) RemovePostIDs

func (uuo *UserUpdateOne) RemovePostIDs(ids ...uint32) *UserUpdateOne

RemovePostIDs removes the "posts" edge to Post entities by IDs.

func (*UserUpdateOne) RemovePosts

func (uuo *UserUpdateOne) RemovePosts(p ...*Post) *UserUpdateOne

RemovePosts removes "posts" edges to Post entities.

func (*UserUpdateOne) RemoveRoleIDs

func (uuo *UserUpdateOne) RemoveRoleIDs(ids ...uint32) *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) SetAuthority

func (uuo *UserUpdateOne) SetAuthority(i int32) *UserUpdateOne

SetAuthority sets the "authority" field.

func (*UserUpdateOne) SetAvatar

func (uuo *UserUpdateOne) SetAvatar(s string) *UserUpdateOne

SetAvatar sets the "avatar" field.

func (*UserUpdateOne) SetBirthday

func (uuo *UserUpdateOne) SetBirthday(t time.Time) *UserUpdateOne

SetBirthday sets the "birthday" field.

func (*UserUpdateOne) SetDeletedAt

func (uuo *UserUpdateOne) SetDeletedAt(t time.Time) *UserUpdateOne

SetDeletedAt sets the "deleted_at" field.

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) SetGender

func (uuo *UserUpdateOne) SetGender(i int32) *UserUpdateOne

SetGender sets the "gender" field.

func (*UserUpdateOne) SetNickName

func (uuo *UserUpdateOne) SetNickName(s string) *UserUpdateOne

SetNickName sets the "nick_name" field.

func (*UserUpdateOne) SetNillableAuthority

func (uuo *UserUpdateOne) SetNillableAuthority(i *int32) *UserUpdateOne

SetNillableAuthority sets the "authority" field if the given value is not nil.

func (*UserUpdateOne) SetNillableAvatar

func (uuo *UserUpdateOne) SetNillableAvatar(s *string) *UserUpdateOne

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*UserUpdateOne) SetNillableBirthday

func (uuo *UserUpdateOne) SetNillableBirthday(t *time.Time) *UserUpdateOne

SetNillableBirthday sets the "birthday" field if the given value is not nil.

func (*UserUpdateOne) SetNillableDeletedAt

func (uuo *UserUpdateOne) SetNillableDeletedAt(t *time.Time) *UserUpdateOne

SetNillableDeletedAt sets the "deleted_at" field 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) SetNillableGender

func (uuo *UserUpdateOne) SetNillableGender(i *int32) *UserUpdateOne

SetNillableGender sets the "gender" field if the given value is not nil.

func (*UserUpdateOne) SetNillableNickName

func (uuo *UserUpdateOne) SetNillableNickName(s *string) *UserUpdateOne

SetNillableNickName sets the "nick_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePassword

func (uuo *UserUpdateOne) SetNillablePassword(s *string) *UserUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePhone

func (uuo *UserUpdateOne) SetNillablePhone(s *string) *UserUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*UserUpdateOne) SetNillableRealName

func (uuo *UserUpdateOne) SetNillableRealName(s *string) *UserUpdateOne

SetNillableRealName sets the "real_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableRemark

func (uuo *UserUpdateOne) SetNillableRemark(s *string) *UserUpdateOne

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*UserUpdateOne) SetNillableSort

func (uuo *UserUpdateOne) SetNillableSort(i *int32) *UserUpdateOne

SetNillableSort sets the "sort" field if the given value is not nil.

func (*UserUpdateOne) SetNillableState

func (uuo *UserUpdateOne) SetNillableState(i *int32) *UserUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUpdatedAt

func (uuo *UserUpdateOne) SetNillableUpdatedAt(t *time.Time) *UserUpdateOne

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*UserUpdateOne) SetPassword

func (uuo *UserUpdateOne) SetPassword(s string) *UserUpdateOne

SetPassword sets the "password" field.

func (*UserUpdateOne) SetPhone

func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne

SetPhone sets the "phone" field.

func (*UserUpdateOne) SetRealName

func (uuo *UserUpdateOne) SetRealName(s string) *UserUpdateOne

SetRealName sets the "real_name" field.

func (*UserUpdateOne) SetRemark

func (uuo *UserUpdateOne) SetRemark(s string) *UserUpdateOne

SetRemark sets the "remark" field.

func (*UserUpdateOne) SetSort

func (uuo *UserUpdateOne) SetSort(i int32) *UserUpdateOne

SetSort sets the "sort" field.

func (*UserUpdateOne) SetState

func (uuo *UserUpdateOne) SetState(i int32) *UserUpdateOne

SetState sets the "state" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) AddAuthority

func (u *UserUpsert) AddAuthority(v int32) *UserUpsert

AddAuthority adds v to the "authority" field.

func (*UserUpsert) AddGender

func (u *UserUpsert) AddGender(v int32) *UserUpsert

AddGender adds v to the "gender" field.

func (*UserUpsert) AddSort

func (u *UserUpsert) AddSort(v int32) *UserUpsert

AddSort adds v to the "sort" field.

func (*UserUpsert) AddState

func (u *UserUpsert) AddState(v int32) *UserUpsert

AddState adds v to the "state" field.

func (*UserUpsert) ClearDeletedAt

func (u *UserUpsert) ClearDeletedAt() *UserUpsert

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpsert) ClearRemark

func (u *UserUpsert) ClearRemark() *UserUpsert

ClearRemark clears the value of the "remark" field.

func (*UserUpsert) ClearUpdatedAt

func (u *UserUpsert) ClearUpdatedAt() *UserUpsert

ClearUpdatedAt clears the value of the "updated_at" field.

func (*UserUpsert) SetAuthority

func (u *UserUpsert) SetAuthority(v int32) *UserUpsert

SetAuthority sets the "authority" field.

func (*UserUpsert) SetAvatar

func (u *UserUpsert) SetAvatar(v string) *UserUpsert

SetAvatar sets the "avatar" field.

func (*UserUpsert) SetBirthday

func (u *UserUpsert) SetBirthday(v time.Time) *UserUpsert

SetBirthday sets the "birthday" field.

func (*UserUpsert) SetDeletedAt

func (u *UserUpsert) SetDeletedAt(v time.Time) *UserUpsert

SetDeletedAt sets the "deleted_at" field.

func (*UserUpsert) SetDescription

func (u *UserUpsert) SetDescription(v string) *UserUpsert

SetDescription sets the "description" field.

func (*UserUpsert) SetEmail

func (u *UserUpsert) SetEmail(v string) *UserUpsert

SetEmail sets the "email" field.

func (*UserUpsert) SetGender

func (u *UserUpsert) SetGender(v int32) *UserUpsert

SetGender sets the "gender" field.

func (*UserUpsert) SetNickName

func (u *UserUpsert) SetNickName(v string) *UserUpsert

SetNickName sets the "nick_name" field.

func (*UserUpsert) SetPassword

func (u *UserUpsert) SetPassword(v string) *UserUpsert

SetPassword sets the "password" field.

func (*UserUpsert) SetPhone

func (u *UserUpsert) SetPhone(v string) *UserUpsert

SetPhone sets the "phone" field.

func (*UserUpsert) SetRealName

func (u *UserUpsert) SetRealName(v string) *UserUpsert

SetRealName sets the "real_name" field.

func (*UserUpsert) SetRemark

func (u *UserUpsert) SetRemark(v string) *UserUpsert

SetRemark sets the "remark" field.

func (*UserUpsert) SetSort

func (u *UserUpsert) SetSort(v int32) *UserUpsert

SetSort sets the "sort" field.

func (*UserUpsert) SetState

func (u *UserUpsert) SetState(v int32) *UserUpsert

SetState sets the "state" field.

func (*UserUpsert) SetUpdatedAt

func (u *UserUpsert) SetUpdatedAt(v time.Time) *UserUpsert

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsert) UpdateAuthority

func (u *UserUpsert) UpdateAuthority() *UserUpsert

UpdateAuthority sets the "authority" field to the value that was provided on create.

func (*UserUpsert) UpdateAvatar

func (u *UserUpsert) UpdateAvatar() *UserUpsert

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*UserUpsert) UpdateBirthday

func (u *UserUpsert) UpdateBirthday() *UserUpsert

UpdateBirthday sets the "birthday" field to the value that was provided on create.

func (*UserUpsert) UpdateDeletedAt

func (u *UserUpsert) UpdateDeletedAt() *UserUpsert

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*UserUpsert) UpdateDescription

func (u *UserUpsert) UpdateDescription() *UserUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*UserUpsert) UpdateEmail

func (u *UserUpsert) UpdateEmail() *UserUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsert) UpdateGender

func (u *UserUpsert) UpdateGender() *UserUpsert

UpdateGender sets the "gender" field to the value that was provided on create.

func (*UserUpsert) UpdateNickName

func (u *UserUpsert) UpdateNickName() *UserUpsert

UpdateNickName sets the "nick_name" field to the value that was provided on create.

func (*UserUpsert) UpdatePassword

func (u *UserUpsert) UpdatePassword() *UserUpsert

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsert) UpdatePhone

func (u *UserUpsert) UpdatePhone() *UserUpsert

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*UserUpsert) UpdateRealName

func (u *UserUpsert) UpdateRealName() *UserUpsert

UpdateRealName sets the "real_name" field to the value that was provided on create.

func (*UserUpsert) UpdateRemark

func (u *UserUpsert) UpdateRemark() *UserUpsert

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*UserUpsert) UpdateSort

func (u *UserUpsert) UpdateSort() *UserUpsert

UpdateSort sets the "sort" field to the value that was provided on create.

func (*UserUpsert) UpdateState

func (u *UserUpsert) UpdateState() *UserUpsert

UpdateState sets the "state" field to the value that was provided on create.

func (*UserUpsert) UpdateUpdatedAt

func (u *UserUpsert) UpdateUpdatedAt() *UserUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type UserUpsertBulk

type UserUpsertBulk struct {
	// contains filtered or unexported fields
}

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) AddAuthority

func (u *UserUpsertBulk) AddAuthority(v int32) *UserUpsertBulk

AddAuthority adds v to the "authority" field.

func (*UserUpsertBulk) AddGender

func (u *UserUpsertBulk) AddGender(v int32) *UserUpsertBulk

AddGender adds v to the "gender" field.

func (*UserUpsertBulk) AddSort

func (u *UserUpsertBulk) AddSort(v int32) *UserUpsertBulk

AddSort adds v to the "sort" field.

func (*UserUpsertBulk) AddState

func (u *UserUpsertBulk) AddState(v int32) *UserUpsertBulk

AddState adds v to the "state" field.

func (*UserUpsertBulk) ClearDeletedAt

func (u *UserUpsertBulk) ClearDeletedAt() *UserUpsertBulk

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpsertBulk) ClearRemark

func (u *UserUpsertBulk) ClearRemark() *UserUpsertBulk

ClearRemark clears the value of the "remark" field.

func (*UserUpsertBulk) ClearUpdatedAt

func (u *UserUpsertBulk) ClearUpdatedAt() *UserUpsertBulk

ClearUpdatedAt clears the value of the "updated_at" field.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetAuthority

func (u *UserUpsertBulk) SetAuthority(v int32) *UserUpsertBulk

SetAuthority sets the "authority" field.

func (*UserUpsertBulk) SetAvatar

func (u *UserUpsertBulk) SetAvatar(v string) *UserUpsertBulk

SetAvatar sets the "avatar" field.

func (*UserUpsertBulk) SetBirthday

func (u *UserUpsertBulk) SetBirthday(v time.Time) *UserUpsertBulk

SetBirthday sets the "birthday" field.

func (*UserUpsertBulk) SetDeletedAt

func (u *UserUpsertBulk) SetDeletedAt(v time.Time) *UserUpsertBulk

SetDeletedAt sets the "deleted_at" field.

func (*UserUpsertBulk) SetDescription

func (u *UserUpsertBulk) SetDescription(v string) *UserUpsertBulk

SetDescription sets the "description" field.

func (*UserUpsertBulk) SetEmail

func (u *UserUpsertBulk) SetEmail(v string) *UserUpsertBulk

SetEmail sets the "email" field.

func (*UserUpsertBulk) SetGender

func (u *UserUpsertBulk) SetGender(v int32) *UserUpsertBulk

SetGender sets the "gender" field.

func (*UserUpsertBulk) SetNickName

func (u *UserUpsertBulk) SetNickName(v string) *UserUpsertBulk

SetNickName sets the "nick_name" field.

func (*UserUpsertBulk) SetPassword

func (u *UserUpsertBulk) SetPassword(v string) *UserUpsertBulk

SetPassword sets the "password" field.

func (*UserUpsertBulk) SetPhone

func (u *UserUpsertBulk) SetPhone(v string) *UserUpsertBulk

SetPhone sets the "phone" field.

func (*UserUpsertBulk) SetRealName

func (u *UserUpsertBulk) SetRealName(v string) *UserUpsertBulk

SetRealName sets the "real_name" field.

func (*UserUpsertBulk) SetRemark

func (u *UserUpsertBulk) SetRemark(v string) *UserUpsertBulk

SetRemark sets the "remark" field.

func (*UserUpsertBulk) SetSort

func (u *UserUpsertBulk) SetSort(v int32) *UserUpsertBulk

SetSort sets the "sort" field.

func (*UserUpsertBulk) SetState

func (u *UserUpsertBulk) SetState(v int32) *UserUpsertBulk

SetState sets the "state" field.

func (*UserUpsertBulk) SetUpdatedAt

func (u *UserUpsertBulk) SetUpdatedAt(v time.Time) *UserUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateAuthority

func (u *UserUpsertBulk) UpdateAuthority() *UserUpsertBulk

UpdateAuthority sets the "authority" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateAvatar

func (u *UserUpsertBulk) UpdateAvatar() *UserUpsertBulk

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateBirthday

func (u *UserUpsertBulk) UpdateBirthday() *UserUpsertBulk

UpdateBirthday sets the "birthday" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateDeletedAt

func (u *UserUpsertBulk) UpdateDeletedAt() *UserUpsertBulk

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateDescription

func (u *UserUpsertBulk) UpdateDescription() *UserUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateEmail

func (u *UserUpsertBulk) UpdateEmail() *UserUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateGender

func (u *UserUpsertBulk) UpdateGender() *UserUpsertBulk

UpdateGender sets the "gender" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdateNickName

func (u *UserUpsertBulk) UpdateNickName() *UserUpsertBulk

UpdateNickName sets the "nick_name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePassword

func (u *UserUpsertBulk) UpdatePassword() *UserUpsertBulk

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsertBulk) UpdatePhone

func (u *UserUpsertBulk) UpdatePhone() *UserUpsertBulk

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateRealName

func (u *UserUpsertBulk) UpdateRealName() *UserUpsertBulk

UpdateRealName sets the "real_name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateRemark

func (u *UserUpsertBulk) UpdateRemark() *UserUpsertBulk

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateSort

func (u *UserUpsertBulk) UpdateSort() *UserUpsertBulk

UpdateSort sets the "sort" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateState

func (u *UserUpsertBulk) UpdateState() *UserUpsertBulk

UpdateState sets the "state" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUpdatedAt

func (u *UserUpsertBulk) UpdateUpdatedAt() *UserUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type UserUpsertOne

type UserUpsertOne struct {
	// contains filtered or unexported fields
}

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) AddAuthority

func (u *UserUpsertOne) AddAuthority(v int32) *UserUpsertOne

AddAuthority adds v to the "authority" field.

func (*UserUpsertOne) AddGender

func (u *UserUpsertOne) AddGender(v int32) *UserUpsertOne

AddGender adds v to the "gender" field.

func (*UserUpsertOne) AddSort

func (u *UserUpsertOne) AddSort(v int32) *UserUpsertOne

AddSort adds v to the "sort" field.

func (*UserUpsertOne) AddState

func (u *UserUpsertOne) AddState(v int32) *UserUpsertOne

AddState adds v to the "state" field.

func (*UserUpsertOne) ClearDeletedAt

func (u *UserUpsertOne) ClearDeletedAt() *UserUpsertOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*UserUpsertOne) ClearRemark

func (u *UserUpsertOne) ClearRemark() *UserUpsertOne

ClearRemark clears the value of the "remark" field.

func (*UserUpsertOne) ClearUpdatedAt

func (u *UserUpsertOne) ClearUpdatedAt() *UserUpsertOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id uint32, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) uint32

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetAuthority

func (u *UserUpsertOne) SetAuthority(v int32) *UserUpsertOne

SetAuthority sets the "authority" field.

func (*UserUpsertOne) SetAvatar

func (u *UserUpsertOne) SetAvatar(v string) *UserUpsertOne

SetAvatar sets the "avatar" field.

func (*UserUpsertOne) SetBirthday

func (u *UserUpsertOne) SetBirthday(v time.Time) *UserUpsertOne

SetBirthday sets the "birthday" field.

func (*UserUpsertOne) SetDeletedAt

func (u *UserUpsertOne) SetDeletedAt(v time.Time) *UserUpsertOne

SetDeletedAt sets the "deleted_at" field.

func (*UserUpsertOne) SetDescription

func (u *UserUpsertOne) SetDescription(v string) *UserUpsertOne

SetDescription sets the "description" field.

func (*UserUpsertOne) SetEmail

func (u *UserUpsertOne) SetEmail(v string) *UserUpsertOne

SetEmail sets the "email" field.

func (*UserUpsertOne) SetGender

func (u *UserUpsertOne) SetGender(v int32) *UserUpsertOne

SetGender sets the "gender" field.

func (*UserUpsertOne) SetNickName

func (u *UserUpsertOne) SetNickName(v string) *UserUpsertOne

SetNickName sets the "nick_name" field.

func (*UserUpsertOne) SetPassword

func (u *UserUpsertOne) SetPassword(v string) *UserUpsertOne

SetPassword sets the "password" field.

func (*UserUpsertOne) SetPhone

func (u *UserUpsertOne) SetPhone(v string) *UserUpsertOne

SetPhone sets the "phone" field.

func (*UserUpsertOne) SetRealName

func (u *UserUpsertOne) SetRealName(v string) *UserUpsertOne

SetRealName sets the "real_name" field.

func (*UserUpsertOne) SetRemark

func (u *UserUpsertOne) SetRemark(v string) *UserUpsertOne

SetRemark sets the "remark" field.

func (*UserUpsertOne) SetSort

func (u *UserUpsertOne) SetSort(v int32) *UserUpsertOne

SetSort sets the "sort" field.

func (*UserUpsertOne) SetState

func (u *UserUpsertOne) SetState(v int32) *UserUpsertOne

SetState sets the "state" field.

func (*UserUpsertOne) SetUpdatedAt

func (u *UserUpsertOne) SetUpdatedAt(v time.Time) *UserUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateAuthority

func (u *UserUpsertOne) UpdateAuthority() *UserUpsertOne

UpdateAuthority sets the "authority" field to the value that was provided on create.

func (*UserUpsertOne) UpdateAvatar

func (u *UserUpsertOne) UpdateAvatar() *UserUpsertOne

UpdateAvatar sets the "avatar" field to the value that was provided on create.

func (*UserUpsertOne) UpdateBirthday

func (u *UserUpsertOne) UpdateBirthday() *UserUpsertOne

UpdateBirthday sets the "birthday" field to the value that was provided on create.

func (*UserUpsertOne) UpdateDeletedAt

func (u *UserUpsertOne) UpdateDeletedAt() *UserUpsertOne

UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateDescription

func (u *UserUpsertOne) UpdateDescription() *UserUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*UserUpsertOne) UpdateEmail

func (u *UserUpsertOne) UpdateEmail() *UserUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*UserUpsertOne) UpdateGender

func (u *UserUpsertOne) UpdateGender() *UserUpsertOne

UpdateGender sets the "gender" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdateNickName

func (u *UserUpsertOne) UpdateNickName() *UserUpsertOne

UpdateNickName sets the "nick_name" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePassword

func (u *UserUpsertOne) UpdatePassword() *UserUpsertOne

UpdatePassword sets the "password" field to the value that was provided on create.

func (*UserUpsertOne) UpdatePhone

func (u *UserUpsertOne) UpdatePhone() *UserUpsertOne

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*UserUpsertOne) UpdateRealName

func (u *UserUpsertOne) UpdateRealName() *UserUpsertOne

UpdateRealName sets the "real_name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateRemark

func (u *UserUpsertOne) UpdateRemark() *UserUpsertOne

UpdateRemark sets the "remark" field to the value that was provided on create.

func (*UserUpsertOne) UpdateSort

func (u *UserUpsertOne) UpdateSort() *UserUpsertOne

UpdateSort sets the "sort" field to the value that was provided on create.

func (*UserUpsertOne) UpdateState

func (u *UserUpsertOne) UpdateState() *UserUpsertOne

UpdateState sets the "state" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUpdatedAt

func (u *UserUpsertOne) UpdateUpdatedAt() *UserUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL