ent

package
v0.0.0-...-9bd63dd Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 18 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.
	TypeAccountUser = "AccountUser"
)

Variables

This section is empty.

Functions

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 AccountUser

type AccountUser struct {

	// ID of the ent.
	// 自增id
	ID uint32 `json:"id,omitempty"`
	// 用户名
	Username *string `json:"username,omitempty"`
	// 手机号
	Phone *string `json:"phone,omitempty"`
	// 邮箱
	Email *string `json:"email,omitempty"`
	// 密码
	Password *string `json:"password,omitempty"`
	// 创建时间
	CreateAt int64 `json:"create_at,omitempty"`
	// 创建ip
	CreateIPAt string `json:"create_ip_at,omitempty"`
	// 最后一次登录时间
	LastLoginAt int64 `json:"last_login_at,omitempty"`
	// 最后一次登录ip
	LastLoginIPAt string `json:"last_login_ip_at,omitempty"`
	// 登录次数
	LoginTimes int64 `json:"login_times,omitempty"`
	// 状态 0:禁用 1:启用 -1:删除
	Status int8 `json:"status,omitempty"`
	// contains filtered or unexported fields
}

AccountUser is the model entity for the AccountUser schema.

func (*AccountUser) String

func (au *AccountUser) String() string

String implements the fmt.Stringer.

func (*AccountUser) Unwrap

func (au *AccountUser) Unwrap() *AccountUser

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

func (au *AccountUser) Update() *AccountUserUpdateOne

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

type AccountUserClient

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

AccountUserClient is a client for the AccountUser schema.

func NewAccountUserClient

func NewAccountUserClient(c config) *AccountUserClient

NewAccountUserClient returns a client for the AccountUser from the given config.

func (*AccountUserClient) Create

func (c *AccountUserClient) Create() *AccountUserCreate

Create returns a builder for creating a AccountUser entity.

func (*AccountUserClient) CreateBulk

func (c *AccountUserClient) CreateBulk(builders ...*AccountUserCreate) *AccountUserCreateBulk

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

func (*AccountUserClient) Delete

func (c *AccountUserClient) Delete() *AccountUserDelete

Delete returns a delete builder for AccountUser.

func (*AccountUserClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AccountUserClient) DeleteOneID

func (c *AccountUserClient) DeleteOneID(id uint32) *AccountUserDeleteOne

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

func (*AccountUserClient) Get

Get returns a AccountUser entity by its id.

func (*AccountUserClient) GetX

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

func (*AccountUserClient) Hooks

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

Hooks returns the client hooks.

func (*AccountUserClient) Intercept

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

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

func (*AccountUserClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AccountUserClient) Query

func (c *AccountUserClient) Query() *AccountUserQuery

Query returns a query builder for AccountUser.

func (*AccountUserClient) Update

func (c *AccountUserClient) Update() *AccountUserUpdate

Update returns an update builder for AccountUser.

func (*AccountUserClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AccountUserClient) UpdateOneID

func (c *AccountUserClient) UpdateOneID(id uint32) *AccountUserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AccountUserClient) Use

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

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

type AccountUserCreate

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

AccountUserCreate is the builder for creating a AccountUser entity.

func (*AccountUserCreate) Exec

func (auc *AccountUserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AccountUserCreate) ExecX

func (auc *AccountUserCreate) ExecX(ctx context.Context)

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

func (*AccountUserCreate) Mutation

func (auc *AccountUserCreate) Mutation() *AccountUserMutation

Mutation returns the AccountUserMutation object of the builder.

func (*AccountUserCreate) OnConflict

func (auc *AccountUserCreate) OnConflict(opts ...sql.ConflictOption) *AccountUserUpsertOne

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

client.AccountUser.Create().
	SetUsername(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.AccountUserUpsert) {
		SetUsername(v+v).
	}).
	Exec(ctx)

func (*AccountUserCreate) OnConflictColumns

func (auc *AccountUserCreate) OnConflictColumns(columns ...string) *AccountUserUpsertOne

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

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

func (*AccountUserCreate) Save

func (auc *AccountUserCreate) Save(ctx context.Context) (*AccountUser, error)

Save creates the AccountUser in the database.

func (*AccountUserCreate) SaveX

func (auc *AccountUserCreate) SaveX(ctx context.Context) *AccountUser

SaveX calls Save and panics if Save returns an error.

func (*AccountUserCreate) SetCreateAt

func (auc *AccountUserCreate) SetCreateAt(i int64) *AccountUserCreate

SetCreateAt sets the "create_at" field.

func (*AccountUserCreate) SetCreateIPAt

func (auc *AccountUserCreate) SetCreateIPAt(s string) *AccountUserCreate

SetCreateIPAt sets the "create_ip_at" field.

func (*AccountUserCreate) SetEmail

func (auc *AccountUserCreate) SetEmail(s string) *AccountUserCreate

SetEmail sets the "email" field.

func (*AccountUserCreate) SetID

SetID sets the "id" field.

func (*AccountUserCreate) SetLastLoginAt

func (auc *AccountUserCreate) SetLastLoginAt(i int64) *AccountUserCreate

SetLastLoginAt sets the "last_login_at" field.

func (*AccountUserCreate) SetLastLoginIPAt

func (auc *AccountUserCreate) SetLastLoginIPAt(s string) *AccountUserCreate

SetLastLoginIPAt sets the "last_login_ip_at" field.

func (*AccountUserCreate) SetLoginTimes

func (auc *AccountUserCreate) SetLoginTimes(i int64) *AccountUserCreate

SetLoginTimes sets the "login_times" field.

func (*AccountUserCreate) SetNillableCreateAt

func (auc *AccountUserCreate) SetNillableCreateAt(i *int64) *AccountUserCreate

SetNillableCreateAt sets the "create_at" field if the given value is not nil.

func (*AccountUserCreate) SetNillableCreateIPAt

func (auc *AccountUserCreate) SetNillableCreateIPAt(s *string) *AccountUserCreate

SetNillableCreateIPAt sets the "create_ip_at" field if the given value is not nil.

func (*AccountUserCreate) SetNillableEmail

func (auc *AccountUserCreate) SetNillableEmail(s *string) *AccountUserCreate

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

func (*AccountUserCreate) SetNillableLastLoginAt

func (auc *AccountUserCreate) SetNillableLastLoginAt(i *int64) *AccountUserCreate

SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.

func (*AccountUserCreate) SetNillableLastLoginIPAt

func (auc *AccountUserCreate) SetNillableLastLoginIPAt(s *string) *AccountUserCreate

SetNillableLastLoginIPAt sets the "last_login_ip_at" field if the given value is not nil.

func (*AccountUserCreate) SetNillableLoginTimes

func (auc *AccountUserCreate) SetNillableLoginTimes(i *int64) *AccountUserCreate

SetNillableLoginTimes sets the "login_times" field if the given value is not nil.

func (*AccountUserCreate) SetNillablePassword

func (auc *AccountUserCreate) SetNillablePassword(s *string) *AccountUserCreate

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

func (*AccountUserCreate) SetNillablePhone

func (auc *AccountUserCreate) SetNillablePhone(s *string) *AccountUserCreate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*AccountUserCreate) SetNillableStatus

func (auc *AccountUserCreate) SetNillableStatus(i *int8) *AccountUserCreate

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

func (*AccountUserCreate) SetNillableUsername

func (auc *AccountUserCreate) SetNillableUsername(s *string) *AccountUserCreate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*AccountUserCreate) SetPassword

func (auc *AccountUserCreate) SetPassword(s string) *AccountUserCreate

SetPassword sets the "password" field.

func (*AccountUserCreate) SetPhone

func (auc *AccountUserCreate) SetPhone(s string) *AccountUserCreate

SetPhone sets the "phone" field.

func (*AccountUserCreate) SetStatus

func (auc *AccountUserCreate) SetStatus(i int8) *AccountUserCreate

SetStatus sets the "status" field.

func (*AccountUserCreate) SetUsername

func (auc *AccountUserCreate) SetUsername(s string) *AccountUserCreate

SetUsername sets the "username" field.

type AccountUserCreateBulk

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

AccountUserCreateBulk is the builder for creating many AccountUser entities in bulk.

func (*AccountUserCreateBulk) Exec

func (aucb *AccountUserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AccountUserCreateBulk) ExecX

func (aucb *AccountUserCreateBulk) ExecX(ctx context.Context)

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

func (*AccountUserCreateBulk) OnConflict

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

client.AccountUser.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.AccountUserUpsert) {
		SetUsername(v+v).
	}).
	Exec(ctx)

func (*AccountUserCreateBulk) OnConflictColumns

func (aucb *AccountUserCreateBulk) OnConflictColumns(columns ...string) *AccountUserUpsertBulk

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

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

func (*AccountUserCreateBulk) Save

func (aucb *AccountUserCreateBulk) Save(ctx context.Context) ([]*AccountUser, error)

Save creates the AccountUser entities in the database.

func (*AccountUserCreateBulk) SaveX

func (aucb *AccountUserCreateBulk) SaveX(ctx context.Context) []*AccountUser

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

type AccountUserDelete

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

AccountUserDelete is the builder for deleting a AccountUser entity.

func (*AccountUserDelete) Exec

func (aud *AccountUserDelete) Exec(ctx context.Context) (int, error)

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

func (*AccountUserDelete) ExecX

func (aud *AccountUserDelete) ExecX(ctx context.Context) int

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

func (*AccountUserDelete) Where

Where appends a list predicates to the AccountUserDelete builder.

type AccountUserDeleteOne

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

AccountUserDeleteOne is the builder for deleting a single AccountUser entity.

func (*AccountUserDeleteOne) Exec

func (audo *AccountUserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AccountUserDeleteOne) ExecX

func (audo *AccountUserDeleteOne) ExecX(ctx context.Context)

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

func (*AccountUserDeleteOne) Where

Where appends a list predicates to the AccountUserDelete builder.

type AccountUserFilter

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

AccountUserFilter provides a generic filtering capability at runtime for AccountUserQuery.

func (*AccountUserFilter) Where

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

Where applies the entql predicate on the query filter.

func (*AccountUserFilter) WhereCreateAt

func (f *AccountUserFilter) WhereCreateAt(p entql.Int64P)

WhereCreateAt applies the entql int64 predicate on the create_at field.

func (*AccountUserFilter) WhereCreateIPAt

func (f *AccountUserFilter) WhereCreateIPAt(p entql.StringP)

WhereCreateIPAt applies the entql string predicate on the create_ip_at field.

func (*AccountUserFilter) WhereEmail

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

WhereEmail applies the entql string predicate on the email field.

func (*AccountUserFilter) WhereID

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

WhereID applies the entql uint32 predicate on the id field.

func (*AccountUserFilter) WhereLastLoginAt

func (f *AccountUserFilter) WhereLastLoginAt(p entql.Int64P)

WhereLastLoginAt applies the entql int64 predicate on the last_login_at field.

func (*AccountUserFilter) WhereLastLoginIPAt

func (f *AccountUserFilter) WhereLastLoginIPAt(p entql.StringP)

WhereLastLoginIPAt applies the entql string predicate on the last_login_ip_at field.

func (*AccountUserFilter) WhereLoginTimes

func (f *AccountUserFilter) WhereLoginTimes(p entql.Int64P)

WhereLoginTimes applies the entql int64 predicate on the login_times field.

func (*AccountUserFilter) WherePassword

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

WherePassword applies the entql string predicate on the password field.

func (*AccountUserFilter) WherePhone

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

WherePhone applies the entql string predicate on the phone field.

func (*AccountUserFilter) WhereStatus

func (f *AccountUserFilter) WhereStatus(p entql.Int8P)

WhereStatus applies the entql int8 predicate on the status field.

func (*AccountUserFilter) WhereUsername

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

WhereUsername applies the entql string predicate on the username field.

type AccountUserGroupBy

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

AccountUserGroupBy is the group-by builder for AccountUser entities.

func (*AccountUserGroupBy) Aggregate

func (augb *AccountUserGroupBy) Aggregate(fns ...AggregateFunc) *AccountUserGroupBy

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

func (*AccountUserGroupBy) Bool

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

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

func (*AccountUserGroupBy) BoolX

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

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

func (*AccountUserGroupBy) Bools

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

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

func (*AccountUserGroupBy) BoolsX

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

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

func (*AccountUserGroupBy) Float64

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

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

func (*AccountUserGroupBy) Float64X

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

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

func (*AccountUserGroupBy) Float64s

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

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

func (*AccountUserGroupBy) Float64sX

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

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

func (*AccountUserGroupBy) Int

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

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

func (*AccountUserGroupBy) IntX

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

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

func (*AccountUserGroupBy) Ints

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

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

func (*AccountUserGroupBy) IntsX

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

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

func (*AccountUserGroupBy) Scan

func (augb *AccountUserGroupBy) Scan(ctx context.Context, v any) error

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

func (*AccountUserGroupBy) ScanX

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

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

func (*AccountUserGroupBy) String

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

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

func (*AccountUserGroupBy) StringX

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

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

func (*AccountUserGroupBy) Strings

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

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

func (*AccountUserGroupBy) StringsX

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

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

type AccountUserMutation

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

AccountUserMutation represents an operation that mutates the AccountUser nodes in the graph.

func (*AccountUserMutation) AddCreateAt

func (m *AccountUserMutation) AddCreateAt(i int64)

AddCreateAt adds i to the "create_at" field.

func (*AccountUserMutation) AddField

func (m *AccountUserMutation) 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 (*AccountUserMutation) AddLastLoginAt

func (m *AccountUserMutation) AddLastLoginAt(i int64)

AddLastLoginAt adds i to the "last_login_at" field.

func (*AccountUserMutation) AddLoginTimes

func (m *AccountUserMutation) AddLoginTimes(i int64)

AddLoginTimes adds i to the "login_times" field.

func (*AccountUserMutation) AddStatus

func (m *AccountUserMutation) AddStatus(i int8)

AddStatus adds i to the "status" field.

func (*AccountUserMutation) AddedCreateAt

func (m *AccountUserMutation) AddedCreateAt() (r int64, exists bool)

AddedCreateAt returns the value that was added to the "create_at" field in this mutation.

func (*AccountUserMutation) AddedEdges

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

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

func (*AccountUserMutation) AddedField

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

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

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

func (*AccountUserMutation) AddedIDs

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

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

func (*AccountUserMutation) AddedLastLoginAt

func (m *AccountUserMutation) AddedLastLoginAt() (r int64, exists bool)

AddedLastLoginAt returns the value that was added to the "last_login_at" field in this mutation.

func (*AccountUserMutation) AddedLoginTimes

func (m *AccountUserMutation) AddedLoginTimes() (r int64, exists bool)

AddedLoginTimes returns the value that was added to the "login_times" field in this mutation.

func (*AccountUserMutation) AddedStatus

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

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

func (*AccountUserMutation) ClearEdge

func (m *AccountUserMutation) 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 (*AccountUserMutation) ClearEmail

func (m *AccountUserMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*AccountUserMutation) ClearField

func (m *AccountUserMutation) 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 (*AccountUserMutation) ClearPassword

func (m *AccountUserMutation) ClearPassword()

ClearPassword clears the value of the "password" field.

func (*AccountUserMutation) ClearPhone

func (m *AccountUserMutation) ClearPhone()

ClearPhone clears the value of the "phone" field.

func (*AccountUserMutation) ClearUsername

func (m *AccountUserMutation) ClearUsername()

ClearUsername clears the value of the "username" field.

func (*AccountUserMutation) ClearedEdges

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

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

func (*AccountUserMutation) ClearedFields

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

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

func (AccountUserMutation) Client

func (m AccountUserMutation) 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 (*AccountUserMutation) CreateAt

func (m *AccountUserMutation) CreateAt() (r int64, exists bool)

CreateAt returns the value of the "create_at" field in the mutation.

func (*AccountUserMutation) CreateIPAt

func (m *AccountUserMutation) CreateIPAt() (r string, exists bool)

CreateIPAt returns the value of the "create_ip_at" field in the mutation.

func (*AccountUserMutation) EdgeCleared

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

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

func (*AccountUserMutation) Email

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

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

func (*AccountUserMutation) EmailCleared

func (m *AccountUserMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*AccountUserMutation) Field

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

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

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

func (*AccountUserMutation) Fields

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

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

func (*AccountUserMutation) ID

func (m *AccountUserMutation) 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 (*AccountUserMutation) IDs

func (m *AccountUserMutation) 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 (*AccountUserMutation) LastLoginAt

func (m *AccountUserMutation) LastLoginAt() (r int64, exists bool)

LastLoginAt returns the value of the "last_login_at" field in the mutation.

func (*AccountUserMutation) LastLoginIPAt

func (m *AccountUserMutation) LastLoginIPAt() (r string, exists bool)

LastLoginIPAt returns the value of the "last_login_ip_at" field in the mutation.

func (*AccountUserMutation) LoginTimes

func (m *AccountUserMutation) LoginTimes() (r int64, exists bool)

LoginTimes returns the value of the "login_times" field in the mutation.

func (*AccountUserMutation) OldCreateAt

func (m *AccountUserMutation) OldCreateAt(ctx context.Context) (v int64, err error)

OldCreateAt returns the old "create_at" field's value of the AccountUser entity. If the AccountUser 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 (*AccountUserMutation) OldCreateIPAt

func (m *AccountUserMutation) OldCreateIPAt(ctx context.Context) (v string, err error)

OldCreateIPAt returns the old "create_ip_at" field's value of the AccountUser entity. If the AccountUser 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 (*AccountUserMutation) OldEmail

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

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

func (m *AccountUserMutation) 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 (*AccountUserMutation) OldLastLoginAt

func (m *AccountUserMutation) OldLastLoginAt(ctx context.Context) (v int64, err error)

OldLastLoginAt returns the old "last_login_at" field's value of the AccountUser entity. If the AccountUser 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 (*AccountUserMutation) OldLastLoginIPAt

func (m *AccountUserMutation) OldLastLoginIPAt(ctx context.Context) (v string, err error)

OldLastLoginIPAt returns the old "last_login_ip_at" field's value of the AccountUser entity. If the AccountUser 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 (*AccountUserMutation) OldLoginTimes

func (m *AccountUserMutation) OldLoginTimes(ctx context.Context) (v int64, err error)

OldLoginTimes returns the old "login_times" field's value of the AccountUser entity. If the AccountUser 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 (*AccountUserMutation) OldPassword

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

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

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

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

func (m *AccountUserMutation) OldStatus(ctx context.Context) (v int8, err error)

OldStatus returns the old "status" field's value of the AccountUser entity. If the AccountUser 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 (*AccountUserMutation) OldUsername

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

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

func (m *AccountUserMutation) Op() Op

Op returns the operation name.

func (*AccountUserMutation) Password

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

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

func (*AccountUserMutation) PasswordCleared

func (m *AccountUserMutation) PasswordCleared() bool

PasswordCleared returns if the "password" field was cleared in this mutation.

func (*AccountUserMutation) Phone

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

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

func (*AccountUserMutation) PhoneCleared

func (m *AccountUserMutation) PhoneCleared() bool

PhoneCleared returns if the "phone" field was cleared in this mutation.

func (*AccountUserMutation) RemovedEdges

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

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

func (*AccountUserMutation) RemovedIDs

func (m *AccountUserMutation) 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 (*AccountUserMutation) ResetCreateAt

func (m *AccountUserMutation) ResetCreateAt()

ResetCreateAt resets all changes to the "create_at" field.

func (*AccountUserMutation) ResetCreateIPAt

func (m *AccountUserMutation) ResetCreateIPAt()

ResetCreateIPAt resets all changes to the "create_ip_at" field.

func (*AccountUserMutation) ResetEdge

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

func (m *AccountUserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*AccountUserMutation) ResetField

func (m *AccountUserMutation) 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 (*AccountUserMutation) ResetLastLoginAt

func (m *AccountUserMutation) ResetLastLoginAt()

ResetLastLoginAt resets all changes to the "last_login_at" field.

func (*AccountUserMutation) ResetLastLoginIPAt

func (m *AccountUserMutation) ResetLastLoginIPAt()

ResetLastLoginIPAt resets all changes to the "last_login_ip_at" field.

func (*AccountUserMutation) ResetLoginTimes

func (m *AccountUserMutation) ResetLoginTimes()

ResetLoginTimes resets all changes to the "login_times" field.

func (*AccountUserMutation) ResetPassword

func (m *AccountUserMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*AccountUserMutation) ResetPhone

func (m *AccountUserMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*AccountUserMutation) ResetStatus

func (m *AccountUserMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*AccountUserMutation) ResetUsername

func (m *AccountUserMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*AccountUserMutation) SetCreateAt

func (m *AccountUserMutation) SetCreateAt(i int64)

SetCreateAt sets the "create_at" field.

func (*AccountUserMutation) SetCreateIPAt

func (m *AccountUserMutation) SetCreateIPAt(s string)

SetCreateIPAt sets the "create_ip_at" field.

func (*AccountUserMutation) SetEmail

func (m *AccountUserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*AccountUserMutation) SetField

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

func (m *AccountUserMutation) SetID(id uint32)

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

func (*AccountUserMutation) SetLastLoginAt

func (m *AccountUserMutation) SetLastLoginAt(i int64)

SetLastLoginAt sets the "last_login_at" field.

func (*AccountUserMutation) SetLastLoginIPAt

func (m *AccountUserMutation) SetLastLoginIPAt(s string)

SetLastLoginIPAt sets the "last_login_ip_at" field.

func (*AccountUserMutation) SetLoginTimes

func (m *AccountUserMutation) SetLoginTimes(i int64)

SetLoginTimes sets the "login_times" field.

func (*AccountUserMutation) SetOp

func (m *AccountUserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AccountUserMutation) SetPassword

func (m *AccountUserMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*AccountUserMutation) SetPhone

func (m *AccountUserMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*AccountUserMutation) SetStatus

func (m *AccountUserMutation) SetStatus(i int8)

SetStatus sets the "status" field.

func (*AccountUserMutation) SetUsername

func (m *AccountUserMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*AccountUserMutation) Status

func (m *AccountUserMutation) Status() (r int8, exists bool)

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

func (AccountUserMutation) Tx

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

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

func (*AccountUserMutation) Type

func (m *AccountUserMutation) Type() string

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

func (*AccountUserMutation) Username

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

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

func (*AccountUserMutation) UsernameCleared

func (m *AccountUserMutation) UsernameCleared() bool

UsernameCleared returns if the "username" field was cleared in this mutation.

func (*AccountUserMutation) Where

func (m *AccountUserMutation) Where(ps ...predicate.AccountUser)

Where appends a list predicates to the AccountUserMutation builder.

func (*AccountUserMutation) WhereP

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

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

type AccountUserQuery

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

AccountUserQuery is the builder for querying AccountUser entities.

func (*AccountUserQuery) Aggregate

func (auq *AccountUserQuery) Aggregate(fns ...AggregateFunc) *AccountUserSelect

Aggregate returns a AccountUserSelect configured with the given aggregations.

func (*AccountUserQuery) All

func (auq *AccountUserQuery) All(ctx context.Context) ([]*AccountUser, error)

All executes the query and returns a list of AccountUsers.

func (*AccountUserQuery) AllX

func (auq *AccountUserQuery) AllX(ctx context.Context) []*AccountUser

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

func (*AccountUserQuery) Clone

func (auq *AccountUserQuery) Clone() *AccountUserQuery

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

func (*AccountUserQuery) Count

func (auq *AccountUserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AccountUserQuery) CountX

func (auq *AccountUserQuery) CountX(ctx context.Context) int

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

func (*AccountUserQuery) Exist

func (auq *AccountUserQuery) Exist(ctx context.Context) (bool, error)

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

func (*AccountUserQuery) ExistX

func (auq *AccountUserQuery) ExistX(ctx context.Context) bool

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

func (*AccountUserQuery) Filter

func (auq *AccountUserQuery) Filter() *AccountUserFilter

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

func (*AccountUserQuery) First

func (auq *AccountUserQuery) First(ctx context.Context) (*AccountUser, error)

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

func (*AccountUserQuery) FirstID

func (auq *AccountUserQuery) FirstID(ctx context.Context) (id uint32, err error)

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

func (*AccountUserQuery) FirstIDX

func (auq *AccountUserQuery) FirstIDX(ctx context.Context) uint32

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

func (*AccountUserQuery) FirstX

func (auq *AccountUserQuery) FirstX(ctx context.Context) *AccountUser

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

func (*AccountUserQuery) GroupBy

func (auq *AccountUserQuery) GroupBy(field string, fields ...string) *AccountUserGroupBy

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 {
	Username string `json:"username,omitempty"`
	Count int `json:"count,omitempty"`
}

client.AccountUser.Query().
	GroupBy(accountuser.FieldUsername).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AccountUserQuery) IDs

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

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

func (*AccountUserQuery) IDsX

func (auq *AccountUserQuery) IDsX(ctx context.Context) []uint32

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

func (*AccountUserQuery) Limit

func (auq *AccountUserQuery) Limit(limit int) *AccountUserQuery

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

func (*AccountUserQuery) Modify

func (auq *AccountUserQuery) Modify(modifiers ...func(s *sql.Selector)) *AccountUserSelect

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

func (*AccountUserQuery) Offset

func (auq *AccountUserQuery) Offset(offset int) *AccountUserQuery

Offset to start from.

func (*AccountUserQuery) Only

func (auq *AccountUserQuery) Only(ctx context.Context) (*AccountUser, error)

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

func (*AccountUserQuery) OnlyID

func (auq *AccountUserQuery) OnlyID(ctx context.Context) (id uint32, err error)

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

func (*AccountUserQuery) OnlyIDX

func (auq *AccountUserQuery) OnlyIDX(ctx context.Context) uint32

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

func (*AccountUserQuery) OnlyX

func (auq *AccountUserQuery) OnlyX(ctx context.Context) *AccountUser

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

func (*AccountUserQuery) Order

func (auq *AccountUserQuery) Order(o ...OrderFunc) *AccountUserQuery

Order specifies how the records should be ordered.

func (*AccountUserQuery) Select

func (auq *AccountUserQuery) Select(fields ...string) *AccountUserSelect

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 {
	Username string `json:"username,omitempty"`
}

client.AccountUser.Query().
	Select(accountuser.FieldUsername).
	Scan(ctx, &v)

func (*AccountUserQuery) Unique

func (auq *AccountUserQuery) Unique(unique bool) *AccountUserQuery

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

Where adds a new predicate for the AccountUserQuery builder.

type AccountUserSelect

type AccountUserSelect struct {
	*AccountUserQuery
	// contains filtered or unexported fields
}

AccountUserSelect is the builder for selecting fields of AccountUser entities.

func (*AccountUserSelect) Aggregate

func (aus *AccountUserSelect) Aggregate(fns ...AggregateFunc) *AccountUserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AccountUserSelect) Bool

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

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

func (*AccountUserSelect) BoolX

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

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

func (*AccountUserSelect) Bools

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

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

func (*AccountUserSelect) BoolsX

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

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

func (*AccountUserSelect) Float64

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

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

func (*AccountUserSelect) Float64X

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

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

func (*AccountUserSelect) Float64s

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

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

func (*AccountUserSelect) Float64sX

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

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

func (*AccountUserSelect) Int

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

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

func (*AccountUserSelect) IntX

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

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

func (*AccountUserSelect) Ints

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

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

func (*AccountUserSelect) IntsX

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

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

func (*AccountUserSelect) Modify

func (aus *AccountUserSelect) Modify(modifiers ...func(s *sql.Selector)) *AccountUserSelect

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

func (*AccountUserSelect) Scan

func (aus *AccountUserSelect) Scan(ctx context.Context, v any) error

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

func (*AccountUserSelect) ScanX

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

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

func (*AccountUserSelect) String

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

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

func (*AccountUserSelect) StringX

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

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

func (*AccountUserSelect) Strings

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

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

func (*AccountUserSelect) StringsX

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

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

type AccountUserUpdate

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

AccountUserUpdate is the builder for updating AccountUser entities.

func (*AccountUserUpdate) AddCreateAt

func (auu *AccountUserUpdate) AddCreateAt(i int64) *AccountUserUpdate

AddCreateAt adds i to the "create_at" field.

func (*AccountUserUpdate) AddLastLoginAt

func (auu *AccountUserUpdate) AddLastLoginAt(i int64) *AccountUserUpdate

AddLastLoginAt adds i to the "last_login_at" field.

func (*AccountUserUpdate) AddLoginTimes

func (auu *AccountUserUpdate) AddLoginTimes(i int64) *AccountUserUpdate

AddLoginTimes adds i to the "login_times" field.

func (*AccountUserUpdate) AddStatus

func (auu *AccountUserUpdate) AddStatus(i int8) *AccountUserUpdate

AddStatus adds i to the "status" field.

func (*AccountUserUpdate) ClearEmail

func (auu *AccountUserUpdate) ClearEmail() *AccountUserUpdate

ClearEmail clears the value of the "email" field.

func (*AccountUserUpdate) ClearPassword

func (auu *AccountUserUpdate) ClearPassword() *AccountUserUpdate

ClearPassword clears the value of the "password" field.

func (*AccountUserUpdate) ClearPhone

func (auu *AccountUserUpdate) ClearPhone() *AccountUserUpdate

ClearPhone clears the value of the "phone" field.

func (*AccountUserUpdate) ClearUsername

func (auu *AccountUserUpdate) ClearUsername() *AccountUserUpdate

ClearUsername clears the value of the "username" field.

func (*AccountUserUpdate) Exec

func (auu *AccountUserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AccountUserUpdate) ExecX

func (auu *AccountUserUpdate) ExecX(ctx context.Context)

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

func (*AccountUserUpdate) Modify

func (auu *AccountUserUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *AccountUserUpdate

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

func (*AccountUserUpdate) Mutation

func (auu *AccountUserUpdate) Mutation() *AccountUserMutation

Mutation returns the AccountUserMutation object of the builder.

func (*AccountUserUpdate) Save

func (auu *AccountUserUpdate) Save(ctx context.Context) (int, error)

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

func (*AccountUserUpdate) SaveX

func (auu *AccountUserUpdate) SaveX(ctx context.Context) int

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

func (*AccountUserUpdate) SetCreateAt

func (auu *AccountUserUpdate) SetCreateAt(i int64) *AccountUserUpdate

SetCreateAt sets the "create_at" field.

func (*AccountUserUpdate) SetCreateIPAt

func (auu *AccountUserUpdate) SetCreateIPAt(s string) *AccountUserUpdate

SetCreateIPAt sets the "create_ip_at" field.

func (*AccountUserUpdate) SetEmail

func (auu *AccountUserUpdate) SetEmail(s string) *AccountUserUpdate

SetEmail sets the "email" field.

func (*AccountUserUpdate) SetLastLoginAt

func (auu *AccountUserUpdate) SetLastLoginAt(i int64) *AccountUserUpdate

SetLastLoginAt sets the "last_login_at" field.

func (*AccountUserUpdate) SetLastLoginIPAt

func (auu *AccountUserUpdate) SetLastLoginIPAt(s string) *AccountUserUpdate

SetLastLoginIPAt sets the "last_login_ip_at" field.

func (*AccountUserUpdate) SetLoginTimes

func (auu *AccountUserUpdate) SetLoginTimes(i int64) *AccountUserUpdate

SetLoginTimes sets the "login_times" field.

func (*AccountUserUpdate) SetNillableCreateAt

func (auu *AccountUserUpdate) SetNillableCreateAt(i *int64) *AccountUserUpdate

SetNillableCreateAt sets the "create_at" field if the given value is not nil.

func (*AccountUserUpdate) SetNillableCreateIPAt

func (auu *AccountUserUpdate) SetNillableCreateIPAt(s *string) *AccountUserUpdate

SetNillableCreateIPAt sets the "create_ip_at" field if the given value is not nil.

func (*AccountUserUpdate) SetNillableEmail

func (auu *AccountUserUpdate) SetNillableEmail(s *string) *AccountUserUpdate

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

func (*AccountUserUpdate) SetNillableLastLoginAt

func (auu *AccountUserUpdate) SetNillableLastLoginAt(i *int64) *AccountUserUpdate

SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.

func (*AccountUserUpdate) SetNillableLastLoginIPAt

func (auu *AccountUserUpdate) SetNillableLastLoginIPAt(s *string) *AccountUserUpdate

SetNillableLastLoginIPAt sets the "last_login_ip_at" field if the given value is not nil.

func (*AccountUserUpdate) SetNillableLoginTimes

func (auu *AccountUserUpdate) SetNillableLoginTimes(i *int64) *AccountUserUpdate

SetNillableLoginTimes sets the "login_times" field if the given value is not nil.

func (*AccountUserUpdate) SetNillablePassword

func (auu *AccountUserUpdate) SetNillablePassword(s *string) *AccountUserUpdate

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

func (*AccountUserUpdate) SetNillablePhone

func (auu *AccountUserUpdate) SetNillablePhone(s *string) *AccountUserUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*AccountUserUpdate) SetNillableStatus

func (auu *AccountUserUpdate) SetNillableStatus(i *int8) *AccountUserUpdate

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

func (*AccountUserUpdate) SetNillableUsername

func (auu *AccountUserUpdate) SetNillableUsername(s *string) *AccountUserUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*AccountUserUpdate) SetPassword

func (auu *AccountUserUpdate) SetPassword(s string) *AccountUserUpdate

SetPassword sets the "password" field.

func (*AccountUserUpdate) SetPhone

func (auu *AccountUserUpdate) SetPhone(s string) *AccountUserUpdate

SetPhone sets the "phone" field.

func (*AccountUserUpdate) SetStatus

func (auu *AccountUserUpdate) SetStatus(i int8) *AccountUserUpdate

SetStatus sets the "status" field.

func (*AccountUserUpdate) SetUsername

func (auu *AccountUserUpdate) SetUsername(s string) *AccountUserUpdate

SetUsername sets the "username" field.

func (*AccountUserUpdate) Where

Where appends a list predicates to the AccountUserUpdate builder.

type AccountUserUpdateOne

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

AccountUserUpdateOne is the builder for updating a single AccountUser entity.

func (*AccountUserUpdateOne) AddCreateAt

func (auuo *AccountUserUpdateOne) AddCreateAt(i int64) *AccountUserUpdateOne

AddCreateAt adds i to the "create_at" field.

func (*AccountUserUpdateOne) AddLastLoginAt

func (auuo *AccountUserUpdateOne) AddLastLoginAt(i int64) *AccountUserUpdateOne

AddLastLoginAt adds i to the "last_login_at" field.

func (*AccountUserUpdateOne) AddLoginTimes

func (auuo *AccountUserUpdateOne) AddLoginTimes(i int64) *AccountUserUpdateOne

AddLoginTimes adds i to the "login_times" field.

func (*AccountUserUpdateOne) AddStatus

func (auuo *AccountUserUpdateOne) AddStatus(i int8) *AccountUserUpdateOne

AddStatus adds i to the "status" field.

func (*AccountUserUpdateOne) ClearEmail

func (auuo *AccountUserUpdateOne) ClearEmail() *AccountUserUpdateOne

ClearEmail clears the value of the "email" field.

func (*AccountUserUpdateOne) ClearPassword

func (auuo *AccountUserUpdateOne) ClearPassword() *AccountUserUpdateOne

ClearPassword clears the value of the "password" field.

func (*AccountUserUpdateOne) ClearPhone

func (auuo *AccountUserUpdateOne) ClearPhone() *AccountUserUpdateOne

ClearPhone clears the value of the "phone" field.

func (*AccountUserUpdateOne) ClearUsername

func (auuo *AccountUserUpdateOne) ClearUsername() *AccountUserUpdateOne

ClearUsername clears the value of the "username" field.

func (*AccountUserUpdateOne) Exec

func (auuo *AccountUserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AccountUserUpdateOne) ExecX

func (auuo *AccountUserUpdateOne) ExecX(ctx context.Context)

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

func (*AccountUserUpdateOne) Modify

func (auuo *AccountUserUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *AccountUserUpdateOne

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

func (*AccountUserUpdateOne) Mutation

func (auuo *AccountUserUpdateOne) Mutation() *AccountUserMutation

Mutation returns the AccountUserMutation object of the builder.

func (*AccountUserUpdateOne) Save

Save executes the query and returns the updated AccountUser entity.

func (*AccountUserUpdateOne) SaveX

func (auuo *AccountUserUpdateOne) SaveX(ctx context.Context) *AccountUser

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

func (*AccountUserUpdateOne) Select

func (auuo *AccountUserUpdateOne) Select(field string, fields ...string) *AccountUserUpdateOne

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

func (*AccountUserUpdateOne) SetCreateAt

func (auuo *AccountUserUpdateOne) SetCreateAt(i int64) *AccountUserUpdateOne

SetCreateAt sets the "create_at" field.

func (*AccountUserUpdateOne) SetCreateIPAt

func (auuo *AccountUserUpdateOne) SetCreateIPAt(s string) *AccountUserUpdateOne

SetCreateIPAt sets the "create_ip_at" field.

func (*AccountUserUpdateOne) SetEmail

SetEmail sets the "email" field.

func (*AccountUserUpdateOne) SetLastLoginAt

func (auuo *AccountUserUpdateOne) SetLastLoginAt(i int64) *AccountUserUpdateOne

SetLastLoginAt sets the "last_login_at" field.

func (*AccountUserUpdateOne) SetLastLoginIPAt

func (auuo *AccountUserUpdateOne) SetLastLoginIPAt(s string) *AccountUserUpdateOne

SetLastLoginIPAt sets the "last_login_ip_at" field.

func (*AccountUserUpdateOne) SetLoginTimes

func (auuo *AccountUserUpdateOne) SetLoginTimes(i int64) *AccountUserUpdateOne

SetLoginTimes sets the "login_times" field.

func (*AccountUserUpdateOne) SetNillableCreateAt

func (auuo *AccountUserUpdateOne) SetNillableCreateAt(i *int64) *AccountUserUpdateOne

SetNillableCreateAt sets the "create_at" field if the given value is not nil.

func (*AccountUserUpdateOne) SetNillableCreateIPAt

func (auuo *AccountUserUpdateOne) SetNillableCreateIPAt(s *string) *AccountUserUpdateOne

SetNillableCreateIPAt sets the "create_ip_at" field if the given value is not nil.

func (*AccountUserUpdateOne) SetNillableEmail

func (auuo *AccountUserUpdateOne) SetNillableEmail(s *string) *AccountUserUpdateOne

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

func (*AccountUserUpdateOne) SetNillableLastLoginAt

func (auuo *AccountUserUpdateOne) SetNillableLastLoginAt(i *int64) *AccountUserUpdateOne

SetNillableLastLoginAt sets the "last_login_at" field if the given value is not nil.

func (*AccountUserUpdateOne) SetNillableLastLoginIPAt

func (auuo *AccountUserUpdateOne) SetNillableLastLoginIPAt(s *string) *AccountUserUpdateOne

SetNillableLastLoginIPAt sets the "last_login_ip_at" field if the given value is not nil.

func (*AccountUserUpdateOne) SetNillableLoginTimes

func (auuo *AccountUserUpdateOne) SetNillableLoginTimes(i *int64) *AccountUserUpdateOne

SetNillableLoginTimes sets the "login_times" field if the given value is not nil.

func (*AccountUserUpdateOne) SetNillablePassword

func (auuo *AccountUserUpdateOne) SetNillablePassword(s *string) *AccountUserUpdateOne

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

func (*AccountUserUpdateOne) SetNillablePhone

func (auuo *AccountUserUpdateOne) SetNillablePhone(s *string) *AccountUserUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*AccountUserUpdateOne) SetNillableStatus

func (auuo *AccountUserUpdateOne) SetNillableStatus(i *int8) *AccountUserUpdateOne

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

func (*AccountUserUpdateOne) SetNillableUsername

func (auuo *AccountUserUpdateOne) SetNillableUsername(s *string) *AccountUserUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*AccountUserUpdateOne) SetPassword

func (auuo *AccountUserUpdateOne) SetPassword(s string) *AccountUserUpdateOne

SetPassword sets the "password" field.

func (*AccountUserUpdateOne) SetPhone

SetPhone sets the "phone" field.

func (*AccountUserUpdateOne) SetStatus

func (auuo *AccountUserUpdateOne) SetStatus(i int8) *AccountUserUpdateOne

SetStatus sets the "status" field.

func (*AccountUserUpdateOne) SetUsername

func (auuo *AccountUserUpdateOne) SetUsername(s string) *AccountUserUpdateOne

SetUsername sets the "username" field.

func (*AccountUserUpdateOne) Where

Where appends a list predicates to the AccountUserUpdate builder.

type AccountUserUpsert

type AccountUserUpsert struct {
	*sql.UpdateSet
}

AccountUserUpsert is the "OnConflict" setter.

func (*AccountUserUpsert) AddCreateAt

func (u *AccountUserUpsert) AddCreateAt(v int64) *AccountUserUpsert

AddCreateAt adds v to the "create_at" field.

func (*AccountUserUpsert) AddLastLoginAt

func (u *AccountUserUpsert) AddLastLoginAt(v int64) *AccountUserUpsert

AddLastLoginAt adds v to the "last_login_at" field.

func (*AccountUserUpsert) AddLoginTimes

func (u *AccountUserUpsert) AddLoginTimes(v int64) *AccountUserUpsert

AddLoginTimes adds v to the "login_times" field.

func (*AccountUserUpsert) AddStatus

func (u *AccountUserUpsert) AddStatus(v int8) *AccountUserUpsert

AddStatus adds v to the "status" field.

func (*AccountUserUpsert) ClearEmail

func (u *AccountUserUpsert) ClearEmail() *AccountUserUpsert

ClearEmail clears the value of the "email" field.

func (*AccountUserUpsert) ClearPassword

func (u *AccountUserUpsert) ClearPassword() *AccountUserUpsert

ClearPassword clears the value of the "password" field.

func (*AccountUserUpsert) ClearPhone

func (u *AccountUserUpsert) ClearPhone() *AccountUserUpsert

ClearPhone clears the value of the "phone" field.

func (*AccountUserUpsert) ClearUsername

func (u *AccountUserUpsert) ClearUsername() *AccountUserUpsert

ClearUsername clears the value of the "username" field.

func (*AccountUserUpsert) SetCreateAt

func (u *AccountUserUpsert) SetCreateAt(v int64) *AccountUserUpsert

SetCreateAt sets the "create_at" field.

func (*AccountUserUpsert) SetCreateIPAt

func (u *AccountUserUpsert) SetCreateIPAt(v string) *AccountUserUpsert

SetCreateIPAt sets the "create_ip_at" field.

func (*AccountUserUpsert) SetEmail

func (u *AccountUserUpsert) SetEmail(v string) *AccountUserUpsert

SetEmail sets the "email" field.

func (*AccountUserUpsert) SetLastLoginAt

func (u *AccountUserUpsert) SetLastLoginAt(v int64) *AccountUserUpsert

SetLastLoginAt sets the "last_login_at" field.

func (*AccountUserUpsert) SetLastLoginIPAt

func (u *AccountUserUpsert) SetLastLoginIPAt(v string) *AccountUserUpsert

SetLastLoginIPAt sets the "last_login_ip_at" field.

func (*AccountUserUpsert) SetLoginTimes

func (u *AccountUserUpsert) SetLoginTimes(v int64) *AccountUserUpsert

SetLoginTimes sets the "login_times" field.

func (*AccountUserUpsert) SetPassword

func (u *AccountUserUpsert) SetPassword(v string) *AccountUserUpsert

SetPassword sets the "password" field.

func (*AccountUserUpsert) SetPhone

func (u *AccountUserUpsert) SetPhone(v string) *AccountUserUpsert

SetPhone sets the "phone" field.

func (*AccountUserUpsert) SetStatus

func (u *AccountUserUpsert) SetStatus(v int8) *AccountUserUpsert

SetStatus sets the "status" field.

func (*AccountUserUpsert) SetUsername

func (u *AccountUserUpsert) SetUsername(v string) *AccountUserUpsert

SetUsername sets the "username" field.

func (*AccountUserUpsert) UpdateCreateAt

func (u *AccountUserUpsert) UpdateCreateAt() *AccountUserUpsert

UpdateCreateAt sets the "create_at" field to the value that was provided on create.

func (*AccountUserUpsert) UpdateCreateIPAt

func (u *AccountUserUpsert) UpdateCreateIPAt() *AccountUserUpsert

UpdateCreateIPAt sets the "create_ip_at" field to the value that was provided on create.

func (*AccountUserUpsert) UpdateEmail

func (u *AccountUserUpsert) UpdateEmail() *AccountUserUpsert

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AccountUserUpsert) UpdateLastLoginAt

func (u *AccountUserUpsert) UpdateLastLoginAt() *AccountUserUpsert

UpdateLastLoginAt sets the "last_login_at" field to the value that was provided on create.

func (*AccountUserUpsert) UpdateLastLoginIPAt

func (u *AccountUserUpsert) UpdateLastLoginIPAt() *AccountUserUpsert

UpdateLastLoginIPAt sets the "last_login_ip_at" field to the value that was provided on create.

func (*AccountUserUpsert) UpdateLoginTimes

func (u *AccountUserUpsert) UpdateLoginTimes() *AccountUserUpsert

UpdateLoginTimes sets the "login_times" field to the value that was provided on create.

func (*AccountUserUpsert) UpdatePassword

func (u *AccountUserUpsert) UpdatePassword() *AccountUserUpsert

UpdatePassword sets the "password" field to the value that was provided on create.

func (*AccountUserUpsert) UpdatePhone

func (u *AccountUserUpsert) UpdatePhone() *AccountUserUpsert

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*AccountUserUpsert) UpdateStatus

func (u *AccountUserUpsert) UpdateStatus() *AccountUserUpsert

UpdateStatus sets the "status" field to the value that was provided on create.

func (*AccountUserUpsert) UpdateUsername

func (u *AccountUserUpsert) UpdateUsername() *AccountUserUpsert

UpdateUsername sets the "username" field to the value that was provided on create.

type AccountUserUpsertBulk

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

AccountUserUpsertBulk is the builder for "upsert"-ing a bulk of AccountUser nodes.

func (*AccountUserUpsertBulk) AddCreateAt

AddCreateAt adds v to the "create_at" field.

func (*AccountUserUpsertBulk) AddLastLoginAt

func (u *AccountUserUpsertBulk) AddLastLoginAt(v int64) *AccountUserUpsertBulk

AddLastLoginAt adds v to the "last_login_at" field.

func (*AccountUserUpsertBulk) AddLoginTimes

func (u *AccountUserUpsertBulk) AddLoginTimes(v int64) *AccountUserUpsertBulk

AddLoginTimes adds v to the "login_times" field.

func (*AccountUserUpsertBulk) AddStatus

AddStatus adds v to the "status" field.

func (*AccountUserUpsertBulk) ClearEmail

ClearEmail clears the value of the "email" field.

func (*AccountUserUpsertBulk) ClearPassword

func (u *AccountUserUpsertBulk) ClearPassword() *AccountUserUpsertBulk

ClearPassword clears the value of the "password" field.

func (*AccountUserUpsertBulk) ClearPhone

ClearPhone clears the value of the "phone" field.

func (*AccountUserUpsertBulk) ClearUsername

func (u *AccountUserUpsertBulk) ClearUsername() *AccountUserUpsertBulk

ClearUsername clears the value of the "username" field.

func (*AccountUserUpsertBulk) DoNothing

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

func (*AccountUserUpsertBulk) Exec

Exec executes the query.

func (*AccountUserUpsertBulk) ExecX

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

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

func (*AccountUserUpsertBulk) Ignore

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

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

func (*AccountUserUpsertBulk) SetCreateAt

SetCreateAt sets the "create_at" field.

func (*AccountUserUpsertBulk) SetCreateIPAt

func (u *AccountUserUpsertBulk) SetCreateIPAt(v string) *AccountUserUpsertBulk

SetCreateIPAt sets the "create_ip_at" field.

func (*AccountUserUpsertBulk) SetEmail

SetEmail sets the "email" field.

func (*AccountUserUpsertBulk) SetLastLoginAt

func (u *AccountUserUpsertBulk) SetLastLoginAt(v int64) *AccountUserUpsertBulk

SetLastLoginAt sets the "last_login_at" field.

func (*AccountUserUpsertBulk) SetLastLoginIPAt

func (u *AccountUserUpsertBulk) SetLastLoginIPAt(v string) *AccountUserUpsertBulk

SetLastLoginIPAt sets the "last_login_ip_at" field.

func (*AccountUserUpsertBulk) SetLoginTimes

func (u *AccountUserUpsertBulk) SetLoginTimes(v int64) *AccountUserUpsertBulk

SetLoginTimes sets the "login_times" field.

func (*AccountUserUpsertBulk) SetPassword

SetPassword sets the "password" field.

func (*AccountUserUpsertBulk) SetPhone

SetPhone sets the "phone" field.

func (*AccountUserUpsertBulk) SetStatus

SetStatus sets the "status" field.

func (*AccountUserUpsertBulk) SetUsername

SetUsername sets the "username" field.

func (*AccountUserUpsertBulk) Update

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

func (*AccountUserUpsertBulk) UpdateCreateAt

func (u *AccountUserUpsertBulk) UpdateCreateAt() *AccountUserUpsertBulk

UpdateCreateAt sets the "create_at" field to the value that was provided on create.

func (*AccountUserUpsertBulk) UpdateCreateIPAt

func (u *AccountUserUpsertBulk) UpdateCreateIPAt() *AccountUserUpsertBulk

UpdateCreateIPAt sets the "create_ip_at" field to the value that was provided on create.

func (*AccountUserUpsertBulk) UpdateEmail

func (u *AccountUserUpsertBulk) UpdateEmail() *AccountUserUpsertBulk

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AccountUserUpsertBulk) UpdateLastLoginAt

func (u *AccountUserUpsertBulk) UpdateLastLoginAt() *AccountUserUpsertBulk

UpdateLastLoginAt sets the "last_login_at" field to the value that was provided on create.

func (*AccountUserUpsertBulk) UpdateLastLoginIPAt

func (u *AccountUserUpsertBulk) UpdateLastLoginIPAt() *AccountUserUpsertBulk

UpdateLastLoginIPAt sets the "last_login_ip_at" field to the value that was provided on create.

func (*AccountUserUpsertBulk) UpdateLoginTimes

func (u *AccountUserUpsertBulk) UpdateLoginTimes() *AccountUserUpsertBulk

UpdateLoginTimes sets the "login_times" field to the value that was provided on create.

func (*AccountUserUpsertBulk) UpdateNewValues

func (u *AccountUserUpsertBulk) UpdateNewValues() *AccountUserUpsertBulk

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

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

func (*AccountUserUpsertBulk) UpdatePassword

func (u *AccountUserUpsertBulk) UpdatePassword() *AccountUserUpsertBulk

UpdatePassword sets the "password" field to the value that was provided on create.

func (*AccountUserUpsertBulk) UpdatePhone

func (u *AccountUserUpsertBulk) UpdatePhone() *AccountUserUpsertBulk

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*AccountUserUpsertBulk) UpdateStatus

func (u *AccountUserUpsertBulk) UpdateStatus() *AccountUserUpsertBulk

UpdateStatus sets the "status" field to the value that was provided on create.

func (*AccountUserUpsertBulk) UpdateUsername

func (u *AccountUserUpsertBulk) UpdateUsername() *AccountUserUpsertBulk

UpdateUsername sets the "username" field to the value that was provided on create.

type AccountUserUpsertOne

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

AccountUserUpsertOne is the builder for "upsert"-ing

one AccountUser node.

func (*AccountUserUpsertOne) AddCreateAt

func (u *AccountUserUpsertOne) AddCreateAt(v int64) *AccountUserUpsertOne

AddCreateAt adds v to the "create_at" field.

func (*AccountUserUpsertOne) AddLastLoginAt

func (u *AccountUserUpsertOne) AddLastLoginAt(v int64) *AccountUserUpsertOne

AddLastLoginAt adds v to the "last_login_at" field.

func (*AccountUserUpsertOne) AddLoginTimes

func (u *AccountUserUpsertOne) AddLoginTimes(v int64) *AccountUserUpsertOne

AddLoginTimes adds v to the "login_times" field.

func (*AccountUserUpsertOne) AddStatus

AddStatus adds v to the "status" field.

func (*AccountUserUpsertOne) ClearEmail

func (u *AccountUserUpsertOne) ClearEmail() *AccountUserUpsertOne

ClearEmail clears the value of the "email" field.

func (*AccountUserUpsertOne) ClearPassword

func (u *AccountUserUpsertOne) ClearPassword() *AccountUserUpsertOne

ClearPassword clears the value of the "password" field.

func (*AccountUserUpsertOne) ClearPhone

func (u *AccountUserUpsertOne) ClearPhone() *AccountUserUpsertOne

ClearPhone clears the value of the "phone" field.

func (*AccountUserUpsertOne) ClearUsername

func (u *AccountUserUpsertOne) ClearUsername() *AccountUserUpsertOne

ClearUsername clears the value of the "username" field.

func (*AccountUserUpsertOne) DoNothing

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

func (*AccountUserUpsertOne) Exec

Exec executes the query.

func (*AccountUserUpsertOne) ExecX

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

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

func (*AccountUserUpsertOne) ID

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

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

func (*AccountUserUpsertOne) IDX

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

func (*AccountUserUpsertOne) Ignore

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

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

func (*AccountUserUpsertOne) SetCreateAt

func (u *AccountUserUpsertOne) SetCreateAt(v int64) *AccountUserUpsertOne

SetCreateAt sets the "create_at" field.

func (*AccountUserUpsertOne) SetCreateIPAt

func (u *AccountUserUpsertOne) SetCreateIPAt(v string) *AccountUserUpsertOne

SetCreateIPAt sets the "create_ip_at" field.

func (*AccountUserUpsertOne) SetEmail

SetEmail sets the "email" field.

func (*AccountUserUpsertOne) SetLastLoginAt

func (u *AccountUserUpsertOne) SetLastLoginAt(v int64) *AccountUserUpsertOne

SetLastLoginAt sets the "last_login_at" field.

func (*AccountUserUpsertOne) SetLastLoginIPAt

func (u *AccountUserUpsertOne) SetLastLoginIPAt(v string) *AccountUserUpsertOne

SetLastLoginIPAt sets the "last_login_ip_at" field.

func (*AccountUserUpsertOne) SetLoginTimes

func (u *AccountUserUpsertOne) SetLoginTimes(v int64) *AccountUserUpsertOne

SetLoginTimes sets the "login_times" field.

func (*AccountUserUpsertOne) SetPassword

SetPassword sets the "password" field.

func (*AccountUserUpsertOne) SetPhone

SetPhone sets the "phone" field.

func (*AccountUserUpsertOne) SetStatus

SetStatus sets the "status" field.

func (*AccountUserUpsertOne) SetUsername

SetUsername sets the "username" field.

func (*AccountUserUpsertOne) Update

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

func (*AccountUserUpsertOne) UpdateCreateAt

func (u *AccountUserUpsertOne) UpdateCreateAt() *AccountUserUpsertOne

UpdateCreateAt sets the "create_at" field to the value that was provided on create.

func (*AccountUserUpsertOne) UpdateCreateIPAt

func (u *AccountUserUpsertOne) UpdateCreateIPAt() *AccountUserUpsertOne

UpdateCreateIPAt sets the "create_ip_at" field to the value that was provided on create.

func (*AccountUserUpsertOne) UpdateEmail

func (u *AccountUserUpsertOne) UpdateEmail() *AccountUserUpsertOne

UpdateEmail sets the "email" field to the value that was provided on create.

func (*AccountUserUpsertOne) UpdateLastLoginAt

func (u *AccountUserUpsertOne) UpdateLastLoginAt() *AccountUserUpsertOne

UpdateLastLoginAt sets the "last_login_at" field to the value that was provided on create.

func (*AccountUserUpsertOne) UpdateLastLoginIPAt

func (u *AccountUserUpsertOne) UpdateLastLoginIPAt() *AccountUserUpsertOne

UpdateLastLoginIPAt sets the "last_login_ip_at" field to the value that was provided on create.

func (*AccountUserUpsertOne) UpdateLoginTimes

func (u *AccountUserUpsertOne) UpdateLoginTimes() *AccountUserUpsertOne

UpdateLoginTimes sets the "login_times" field to the value that was provided on create.

func (*AccountUserUpsertOne) UpdateNewValues

func (u *AccountUserUpsertOne) UpdateNewValues() *AccountUserUpsertOne

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.AccountUser.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(accountuser.FieldID)
		}),
	).
	Exec(ctx)

func (*AccountUserUpsertOne) UpdatePassword

func (u *AccountUserUpsertOne) UpdatePassword() *AccountUserUpsertOne

UpdatePassword sets the "password" field to the value that was provided on create.

func (*AccountUserUpsertOne) UpdatePhone

func (u *AccountUserUpsertOne) UpdatePhone() *AccountUserUpsertOne

UpdatePhone sets the "phone" field to the value that was provided on create.

func (*AccountUserUpsertOne) UpdateStatus

func (u *AccountUserUpsertOne) UpdateStatus() *AccountUserUpsertOne

UpdateStatus sets the "status" field to the value that was provided on create.

func (*AccountUserUpsertOne) UpdateUsername

func (u *AccountUserUpsertOne) UpdateUsername() *AccountUserUpsertOne

UpdateUsername sets the "username" field to the value that was provided on create.

type AccountUsers

type AccountUsers []*AccountUser

AccountUsers is a parsable slice of AccountUser.

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
	// AccountUser is the client for interacting with the AccountUser builders.
	AccountUser *AccountUserClient
	// 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().
	AccountUser.
	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 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 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.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

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 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 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 {

	// AccountUser is the client for interacting with the AccountUser builders.
	AccountUser *AccountUserClient
	// 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 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