ent

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 21 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.
	TypeMember     = "Member"
	TypeMemberRank = "MemberRank"
)

Variables

View Source
var DefaultMemberOrder = Desc(member.FieldID)

DefaultMemberOrder is the default ordering of Member.

View Source
var DefaultMemberRankOrder = Desc(memberrank.FieldID)

DefaultMemberRankOrder is the default ordering of MemberRank.

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
	// Member is the client for interacting with the Member builders.
	Member *MemberClient
	// MemberRank is the client for interacting with the MemberRank builders.
	MemberRank *MemberRankClient
	// 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().
	Member.
	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 Member

type Member struct {

	// ID of the ent.
	// UUID
	ID uuid.UUID `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// status 1 normal 2 ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// Member's login name | 登录名
	Username string `json:"username,omitempty"`
	// Password | 密码
	Password string `json:"password,omitempty"`
	// Nickname | 昵称
	Nickname string `json:"nickname,omitempty"`
	// Member Rank ID | 会员等级ID
	RankID uint64 `json:"rank_id,omitempty"`
	// Mobile number | 手机号
	Mobile string `json:"mobile,omitempty"`
	// Email | 邮箱号
	Email string `json:"email,omitempty"`
	// Avatar | 头像路径
	Avatar string `json:"avatar,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MemberQuery when eager-loading is set.
	Edges MemberEdges `json:"edges"`
	// contains filtered or unexported fields
}

Member is the model entity for the Member schema.

func (*Member) QueryRanks

func (m *Member) QueryRanks() *MemberRankQuery

QueryRanks queries the "ranks" edge of the Member entity.

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 uuid.UUID) *MemberDeleteOne

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

func (*MemberClient) Get

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

Get returns a Member entity by its id.

func (*MemberClient) GetX

func (c *MemberClient) GetX(ctx context.Context, id uuid.UUID) *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) Query

func (c *MemberClient) Query() *MemberQuery

Query returns a query builder for Member.

func (*MemberClient) QueryRanks

func (c *MemberClient) QueryRanks(m *Member) *MemberRankQuery

QueryRanks queries the ranks edge of a 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 uuid.UUID) *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) 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) SetEmail

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

SetEmail sets the "email" field.

func (*MemberCreate) SetID

func (mc *MemberCreate) SetID(u uuid.UUID) *MemberCreate

SetID sets the "id" field.

func (*MemberCreate) SetMobile

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

SetMobile sets the "mobile" 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) SetNillableEmail

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

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

func (*MemberCreate) SetNillableID

func (mc *MemberCreate) SetNillableID(u *uuid.UUID) *MemberCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*MemberCreate) SetNillableMobile

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

SetNillableMobile sets the "mobile" field if the given value is not nil.

func (*MemberCreate) SetNillableRankID

func (mc *MemberCreate) SetNillableRankID(u *uint64) *MemberCreate

SetNillableRankID sets the "rank_id" field if the given value is not nil.

func (*MemberCreate) SetNillableRanksID

func (mc *MemberCreate) SetNillableRanksID(id *uint64) *MemberCreate

SetNillableRanksID sets the "ranks" edge to the MemberRank entity by ID if the given value is not nil.

func (*MemberCreate) SetNillableStatus

func (mc *MemberCreate) SetNillableStatus(u *uint8) *MemberCreate

SetNillableStatus sets the "status" 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) SetRankID

func (mc *MemberCreate) SetRankID(u uint64) *MemberCreate

SetRankID sets the "rank_id" field.

func (*MemberCreate) SetRanks

func (mc *MemberCreate) SetRanks(m *MemberRank) *MemberCreate

SetRanks sets the "ranks" edge to the MemberRank entity.

func (*MemberCreate) SetRanksID

func (mc *MemberCreate) SetRanksID(id uint64) *MemberCreate

SetRanksID sets the "ranks" edge to the MemberRank entity by ID.

func (*MemberCreate) SetStatus

func (mc *MemberCreate) SetStatus(u uint8) *MemberCreate

SetStatus sets the "status" 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) 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 MemberEdges

type MemberEdges struct {
	// Ranks holds the value of the ranks edge.
	Ranks *MemberRank `json:"ranks,omitempty"`
	// contains filtered or unexported fields
}

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

func (MemberEdges) RanksOrErr

func (e MemberEdges) RanksOrErr() (*MemberRank, error)

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

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

func (m *MemberMutation) AddStatus(u int8)

AddStatus adds u to the "status" 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) AddedStatus

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

AddedStatus returns the value that was added to the "status" 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) AvatarCleared

func (m *MemberMutation) AvatarCleared() bool

AvatarCleared returns if the "avatar" field was cleared in this mutation.

func (*MemberMutation) ClearAvatar

func (m *MemberMutation) ClearAvatar()

ClearAvatar clears the value of the "avatar" 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) ClearEmail

func (m *MemberMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

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

func (m *MemberMutation) ClearMobile()

ClearMobile clears the value of the "mobile" field.

func (*MemberMutation) ClearRankID

func (m *MemberMutation) ClearRankID()

ClearRankID clears the value of the "rank_id" field.

func (*MemberMutation) ClearRanks

func (m *MemberMutation) ClearRanks()

ClearRanks clears the "ranks" edge to the MemberRank entity.

func (*MemberMutation) ClearStatus

func (m *MemberMutation) ClearStatus()

ClearStatus clears the value of the "status" 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) 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) EmailCleared

func (m *MemberMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this 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) ID

func (m *MemberMutation) ID() (id uuid.UUID, exists bool)

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

func (*MemberMutation) IDs

func (m *MemberMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*MemberMutation) Mobile

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

Mobile returns the value of the "mobile" field in the mutation.

func (*MemberMutation) MobileCleared

func (m *MemberMutation) MobileCleared() bool

MobileCleared returns if the "mobile" field was cleared in this 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) 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) OldMobile

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

OldMobile returns the old "mobile" 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) 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) OldRankID

func (m *MemberMutation) OldRankID(ctx context.Context) (v uint64, err error)

OldRankID returns the old "rank_id" 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) OldStatus

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

OldStatus returns the old "status" 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) RankID

func (m *MemberMutation) RankID() (r uint64, exists bool)

RankID returns the value of the "rank_id" field in the mutation.

func (*MemberMutation) RankIDCleared

func (m *MemberMutation) RankIDCleared() bool

RankIDCleared returns if the "rank_id" field was cleared in this mutation.

func (*MemberMutation) RanksCleared

func (m *MemberMutation) RanksCleared() bool

RanksCleared reports if the "ranks" edge to the MemberRank entity was cleared.

func (*MemberMutation) RanksID

func (m *MemberMutation) RanksID() (id uint64, exists bool)

RanksID returns the "ranks" edge ID in the mutation.

func (*MemberMutation) RanksIDs

func (m *MemberMutation) RanksIDs() (ids []uint64)

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

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

func (m *MemberMutation) ResetMobile()

ResetMobile resets all changes to the "mobile" field.

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

func (m *MemberMutation) ResetRankID()

ResetRankID resets all changes to the "rank_id" field.

func (*MemberMutation) ResetRanks

func (m *MemberMutation) ResetRanks()

ResetRanks resets all changes to the "ranks" edge.

func (*MemberMutation) ResetStatus

func (m *MemberMutation) ResetStatus()

ResetStatus resets all changes to the "status" 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) 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 uuid.UUID)

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

func (*MemberMutation) SetMobile

func (m *MemberMutation) SetMobile(s string)

SetMobile sets the "mobile" field.

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

func (m *MemberMutation) SetRankID(u uint64)

SetRankID sets the "rank_id" field.

func (*MemberMutation) SetRanksID

func (m *MemberMutation) SetRanksID(id uint64)

SetRanksID sets the "ranks" edge to the MemberRank entity by id.

func (*MemberMutation) SetStatus

func (m *MemberMutation) SetStatus(u uint8)

SetStatus sets the "status" 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) Status

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

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

func (*MemberMutation) StatusCleared

func (m *MemberMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this 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) 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 MemberPageList

type MemberPageList struct {
	List        []*Member    `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

MemberPageList is Member PageList result.

type MemberPager

type MemberPager struct {
	Order  member.OrderOption
	Filter func(*MemberQuery) (*MemberQuery, error)
}

func (*MemberPager) ApplyFilter

func (p *MemberPager) ApplyFilter(query *MemberQuery) (*MemberQuery, error)

type MemberPaginateOption

type MemberPaginateOption func(*MemberPager)

MemberPaginateOption enables pagination customization.

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) 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 uuid.UUID, 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) uuid.UUID

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 []uuid.UUID, err error)

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

func (*MemberQuery) IDsX

func (mq *MemberQuery) IDsX(ctx context.Context) []uuid.UUID

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) 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 uuid.UUID, 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) uuid.UUID

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

func (m *MemberQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...MemberPaginateOption,
) (*MemberPageList, error)

func (*MemberQuery) QueryRanks

func (mq *MemberQuery) QueryRanks() *MemberRankQuery

QueryRanks chains the current query on the "ranks" edge.

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.

func (*MemberQuery) WithRanks

func (mq *MemberQuery) WithRanks(opts ...func(*MemberRankQuery)) *MemberQuery

WithRanks tells the query-builder to eager-load the nodes that are connected to the "ranks" edge. The optional arguments are used to configure the query builder of the edge.

type MemberRank

type MemberRank struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Rank name | 等级名称
	Name string `json:"name,omitempty"`
	// Rank code | 等级码
	Code string `json:"code,omitempty"`
	// Rank description | 等级描述
	Description string `json:"description,omitempty"`
	// Remark | 备注
	Remark string `json:"remark,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MemberRankQuery when eager-loading is set.
	Edges MemberRankEdges `json:"edges"`
	// contains filtered or unexported fields
}

MemberRank is the model entity for the MemberRank schema.

func (*MemberRank) QueryMembers

func (mr *MemberRank) QueryMembers() *MemberQuery

QueryMembers queries the "members" edge of the MemberRank entity.

func (*MemberRank) String

func (mr *MemberRank) String() string

String implements the fmt.Stringer.

func (*MemberRank) Unwrap

func (mr *MemberRank) Unwrap() *MemberRank

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

func (mr *MemberRank) Update() *MemberRankUpdateOne

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

func (*MemberRank) Value

func (mr *MemberRank) Value(name string) (ent.Value, error)

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

type MemberRankClient

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

MemberRankClient is a client for the MemberRank schema.

func NewMemberRankClient

func NewMemberRankClient(c config) *MemberRankClient

NewMemberRankClient returns a client for the MemberRank from the given config.

func (*MemberRankClient) Create

func (c *MemberRankClient) Create() *MemberRankCreate

Create returns a builder for creating a MemberRank entity.

func (*MemberRankClient) CreateBulk

func (c *MemberRankClient) CreateBulk(builders ...*MemberRankCreate) *MemberRankCreateBulk

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

func (*MemberRankClient) Delete

func (c *MemberRankClient) Delete() *MemberRankDelete

Delete returns a delete builder for MemberRank.

func (*MemberRankClient) DeleteOne

func (c *MemberRankClient) DeleteOne(mr *MemberRank) *MemberRankDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MemberRankClient) DeleteOneID

func (c *MemberRankClient) DeleteOneID(id uint64) *MemberRankDeleteOne

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

func (*MemberRankClient) Get

func (c *MemberRankClient) Get(ctx context.Context, id uint64) (*MemberRank, error)

Get returns a MemberRank entity by its id.

func (*MemberRankClient) GetX

func (c *MemberRankClient) GetX(ctx context.Context, id uint64) *MemberRank

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

func (*MemberRankClient) Hooks

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

Hooks returns the client hooks.

func (*MemberRankClient) Intercept

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

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

func (*MemberRankClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MemberRankClient) Query

func (c *MemberRankClient) Query() *MemberRankQuery

Query returns a query builder for MemberRank.

func (*MemberRankClient) QueryMembers

func (c *MemberRankClient) QueryMembers(mr *MemberRank) *MemberQuery

QueryMembers queries the members edge of a MemberRank.

func (*MemberRankClient) Update

func (c *MemberRankClient) Update() *MemberRankUpdate

Update returns an update builder for MemberRank.

func (*MemberRankClient) UpdateOne

func (c *MemberRankClient) UpdateOne(mr *MemberRank) *MemberRankUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MemberRankClient) UpdateOneID

func (c *MemberRankClient) UpdateOneID(id uint64) *MemberRankUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MemberRankClient) Use

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

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

type MemberRankCreate

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

MemberRankCreate is the builder for creating a MemberRank entity.

func (*MemberRankCreate) AddMemberIDs

func (mrc *MemberRankCreate) AddMemberIDs(ids ...uuid.UUID) *MemberRankCreate

AddMemberIDs adds the "members" edge to the Member entity by IDs.

func (*MemberRankCreate) AddMembers

func (mrc *MemberRankCreate) AddMembers(m ...*Member) *MemberRankCreate

AddMembers adds the "members" edges to the Member entity.

func (*MemberRankCreate) Exec

func (mrc *MemberRankCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberRankCreate) ExecX

func (mrc *MemberRankCreate) ExecX(ctx context.Context)

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

func (*MemberRankCreate) Mutation

func (mrc *MemberRankCreate) Mutation() *MemberRankMutation

Mutation returns the MemberRankMutation object of the builder.

func (*MemberRankCreate) Save

func (mrc *MemberRankCreate) Save(ctx context.Context) (*MemberRank, error)

Save creates the MemberRank in the database.

func (*MemberRankCreate) SaveX

func (mrc *MemberRankCreate) SaveX(ctx context.Context) *MemberRank

SaveX calls Save and panics if Save returns an error.

func (*MemberRankCreate) SetCode

func (mrc *MemberRankCreate) SetCode(s string) *MemberRankCreate

SetCode sets the "code" field.

func (*MemberRankCreate) SetCreatedAt

func (mrc *MemberRankCreate) SetCreatedAt(t time.Time) *MemberRankCreate

SetCreatedAt sets the "created_at" field.

func (*MemberRankCreate) SetDescription

func (mrc *MemberRankCreate) SetDescription(s string) *MemberRankCreate

SetDescription sets the "description" field.

func (*MemberRankCreate) SetID

func (mrc *MemberRankCreate) SetID(u uint64) *MemberRankCreate

SetID sets the "id" field.

func (*MemberRankCreate) SetName

func (mrc *MemberRankCreate) SetName(s string) *MemberRankCreate

SetName sets the "name" field.

func (*MemberRankCreate) SetNillableCreatedAt

func (mrc *MemberRankCreate) SetNillableCreatedAt(t *time.Time) *MemberRankCreate

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

func (*MemberRankCreate) SetNillableUpdatedAt

func (mrc *MemberRankCreate) SetNillableUpdatedAt(t *time.Time) *MemberRankCreate

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

func (*MemberRankCreate) SetRemark

func (mrc *MemberRankCreate) SetRemark(s string) *MemberRankCreate

SetRemark sets the "remark" field.

func (*MemberRankCreate) SetUpdatedAt

func (mrc *MemberRankCreate) SetUpdatedAt(t time.Time) *MemberRankCreate

SetUpdatedAt sets the "updated_at" field.

type MemberRankCreateBulk

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

MemberRankCreateBulk is the builder for creating many MemberRank entities in bulk.

func (*MemberRankCreateBulk) Exec

func (mrcb *MemberRankCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberRankCreateBulk) ExecX

func (mrcb *MemberRankCreateBulk) ExecX(ctx context.Context)

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

func (*MemberRankCreateBulk) Save

func (mrcb *MemberRankCreateBulk) Save(ctx context.Context) ([]*MemberRank, error)

Save creates the MemberRank entities in the database.

func (*MemberRankCreateBulk) SaveX

func (mrcb *MemberRankCreateBulk) SaveX(ctx context.Context) []*MemberRank

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

type MemberRankDelete

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

MemberRankDelete is the builder for deleting a MemberRank entity.

func (*MemberRankDelete) Exec

func (mrd *MemberRankDelete) Exec(ctx context.Context) (int, error)

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

func (*MemberRankDelete) ExecX

func (mrd *MemberRankDelete) ExecX(ctx context.Context) int

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

func (*MemberRankDelete) Where

Where appends a list predicates to the MemberRankDelete builder.

type MemberRankDeleteOne

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

MemberRankDeleteOne is the builder for deleting a single MemberRank entity.

func (*MemberRankDeleteOne) Exec

func (mrdo *MemberRankDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MemberRankDeleteOne) ExecX

func (mrdo *MemberRankDeleteOne) ExecX(ctx context.Context)

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

func (*MemberRankDeleteOne) Where

Where appends a list predicates to the MemberRankDelete builder.

type MemberRankEdges

type MemberRankEdges struct {
	// Members holds the value of the members edge.
	Members []*Member `json:"members,omitempty"`
	// contains filtered or unexported fields
}

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

func (MemberRankEdges) MembersOrErr

func (e MemberRankEdges) MembersOrErr() ([]*Member, error)

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

type MemberRankGroupBy

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

MemberRankGroupBy is the group-by builder for MemberRank entities.

func (*MemberRankGroupBy) Aggregate

func (mrgb *MemberRankGroupBy) Aggregate(fns ...AggregateFunc) *MemberRankGroupBy

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

func (*MemberRankGroupBy) Bool

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

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

func (*MemberRankGroupBy) BoolX

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

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

func (*MemberRankGroupBy) Bools

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

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

func (*MemberRankGroupBy) BoolsX

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

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

func (*MemberRankGroupBy) Float64

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

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

func (*MemberRankGroupBy) Float64X

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

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

func (*MemberRankGroupBy) Float64s

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

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

func (*MemberRankGroupBy) Float64sX

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

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

func (*MemberRankGroupBy) Int

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

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

func (*MemberRankGroupBy) IntX

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

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

func (*MemberRankGroupBy) Ints

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

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

func (*MemberRankGroupBy) IntsX

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

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

func (*MemberRankGroupBy) Scan

func (mrgb *MemberRankGroupBy) Scan(ctx context.Context, v any) error

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

func (*MemberRankGroupBy) ScanX

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

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

func (*MemberRankGroupBy) String

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

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

func (*MemberRankGroupBy) StringX

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

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

func (*MemberRankGroupBy) Strings

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

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

func (*MemberRankGroupBy) StringsX

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

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

type MemberRankMutation

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

MemberRankMutation represents an operation that mutates the MemberRank nodes in the graph.

func (*MemberRankMutation) AddField

func (m *MemberRankMutation) 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 (*MemberRankMutation) AddMemberIDs

func (m *MemberRankMutation) AddMemberIDs(ids ...uuid.UUID)

AddMemberIDs adds the "members" edge to the Member entity by ids.

func (*MemberRankMutation) AddedEdges

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

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

func (*MemberRankMutation) AddedField

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

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

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

func (*MemberRankMutation) AddedIDs

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

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

func (*MemberRankMutation) ClearEdge

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

func (m *MemberRankMutation) 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 (*MemberRankMutation) ClearMembers

func (m *MemberRankMutation) ClearMembers()

ClearMembers clears the "members" edge to the Member entity.

func (*MemberRankMutation) ClearedEdges

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

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

func (*MemberRankMutation) ClearedFields

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

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

func (MemberRankMutation) Client

func (m MemberRankMutation) 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 (*MemberRankMutation) Code

func (m *MemberRankMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*MemberRankMutation) CreatedAt

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

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

func (*MemberRankMutation) Description

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

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

func (*MemberRankMutation) EdgeCleared

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

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

func (*MemberRankMutation) Field

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

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

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

func (*MemberRankMutation) Fields

func (m *MemberRankMutation) 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 (*MemberRankMutation) ID

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

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

func (*MemberRankMutation) IDs

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

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

func (*MemberRankMutation) MembersCleared

func (m *MemberRankMutation) MembersCleared() bool

MembersCleared reports if the "members" edge to the Member entity was cleared.

func (*MemberRankMutation) MembersIDs

func (m *MemberRankMutation) MembersIDs() (ids []uuid.UUID)

MembersIDs returns the "members" edge IDs in the mutation.

func (*MemberRankMutation) Name

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

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

func (*MemberRankMutation) OldCode

func (m *MemberRankMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the MemberRank entity. If the MemberRank 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 (*MemberRankMutation) OldCreatedAt

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

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

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

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

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

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

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

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

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

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

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

func (m *MemberRankMutation) Op() Op

Op returns the operation name.

func (*MemberRankMutation) Remark

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

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

func (*MemberRankMutation) RemoveMemberIDs

func (m *MemberRankMutation) RemoveMemberIDs(ids ...uuid.UUID)

RemoveMemberIDs removes the "members" edge to the Member entity by IDs.

func (*MemberRankMutation) RemovedEdges

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

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

func (*MemberRankMutation) RemovedIDs

func (m *MemberRankMutation) 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 (*MemberRankMutation) RemovedMembersIDs

func (m *MemberRankMutation) RemovedMembersIDs() (ids []uuid.UUID)

RemovedMembers returns the removed IDs of the "members" edge to the Member entity.

func (*MemberRankMutation) ResetCode

func (m *MemberRankMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*MemberRankMutation) ResetCreatedAt

func (m *MemberRankMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MemberRankMutation) ResetDescription

func (m *MemberRankMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*MemberRankMutation) ResetEdge

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

func (m *MemberRankMutation) 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 (*MemberRankMutation) ResetMembers

func (m *MemberRankMutation) ResetMembers()

ResetMembers resets all changes to the "members" edge.

func (*MemberRankMutation) ResetName

func (m *MemberRankMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*MemberRankMutation) ResetRemark

func (m *MemberRankMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*MemberRankMutation) ResetUpdatedAt

func (m *MemberRankMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MemberRankMutation) SetCode

func (m *MemberRankMutation) SetCode(s string)

SetCode sets the "code" field.

func (*MemberRankMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*MemberRankMutation) SetDescription

func (m *MemberRankMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*MemberRankMutation) SetField

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

func (m *MemberRankMutation) SetID(id uint64)

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

func (*MemberRankMutation) SetName

func (m *MemberRankMutation) SetName(s string)

SetName sets the "name" field.

func (*MemberRankMutation) SetOp

func (m *MemberRankMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MemberRankMutation) SetRemark

func (m *MemberRankMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*MemberRankMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (MemberRankMutation) Tx

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

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

func (*MemberRankMutation) Type

func (m *MemberRankMutation) Type() string

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

func (*MemberRankMutation) UpdatedAt

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

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

func (*MemberRankMutation) Where

func (m *MemberRankMutation) Where(ps ...predicate.MemberRank)

Where appends a list predicates to the MemberRankMutation builder.

func (*MemberRankMutation) WhereP

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

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

type MemberRankPageList

type MemberRankPageList struct {
	List        []*MemberRank `json:"list"`
	PageDetails *PageDetails  `json:"pageDetails"`
}

MemberRankPageList is MemberRank PageList result.

type MemberRankPager

type MemberRankPager struct {
	Order  memberrank.OrderOption
	Filter func(*MemberRankQuery) (*MemberRankQuery, error)
}

func (*MemberRankPager) ApplyFilter

func (p *MemberRankPager) ApplyFilter(query *MemberRankQuery) (*MemberRankQuery, error)

type MemberRankPaginateOption

type MemberRankPaginateOption func(*MemberRankPager)

MemberRankPaginateOption enables pagination customization.

type MemberRankQuery

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

MemberRankQuery is the builder for querying MemberRank entities.

func (*MemberRankQuery) Aggregate

func (mrq *MemberRankQuery) Aggregate(fns ...AggregateFunc) *MemberRankSelect

Aggregate returns a MemberRankSelect configured with the given aggregations.

func (*MemberRankQuery) All

func (mrq *MemberRankQuery) All(ctx context.Context) ([]*MemberRank, error)

All executes the query and returns a list of MemberRanks.

func (*MemberRankQuery) AllX

func (mrq *MemberRankQuery) AllX(ctx context.Context) []*MemberRank

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

func (*MemberRankQuery) Clone

func (mrq *MemberRankQuery) Clone() *MemberRankQuery

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

func (*MemberRankQuery) Count

func (mrq *MemberRankQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MemberRankQuery) CountX

func (mrq *MemberRankQuery) CountX(ctx context.Context) int

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

func (*MemberRankQuery) Exist

func (mrq *MemberRankQuery) Exist(ctx context.Context) (bool, error)

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

func (*MemberRankQuery) ExistX

func (mrq *MemberRankQuery) ExistX(ctx context.Context) bool

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

func (*MemberRankQuery) First

func (mrq *MemberRankQuery) First(ctx context.Context) (*MemberRank, error)

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

func (*MemberRankQuery) FirstID

func (mrq *MemberRankQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*MemberRankQuery) FirstIDX

func (mrq *MemberRankQuery) FirstIDX(ctx context.Context) uint64

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

func (*MemberRankQuery) FirstX

func (mrq *MemberRankQuery) FirstX(ctx context.Context) *MemberRank

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

func (*MemberRankQuery) GroupBy

func (mrq *MemberRankQuery) GroupBy(field string, fields ...string) *MemberRankGroupBy

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

func (*MemberRankQuery) IDs

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

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

func (*MemberRankQuery) IDsX

func (mrq *MemberRankQuery) IDsX(ctx context.Context) []uint64

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

func (*MemberRankQuery) Limit

func (mrq *MemberRankQuery) Limit(limit int) *MemberRankQuery

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

func (*MemberRankQuery) Offset

func (mrq *MemberRankQuery) Offset(offset int) *MemberRankQuery

Offset to start from.

func (*MemberRankQuery) Only

func (mrq *MemberRankQuery) Only(ctx context.Context) (*MemberRank, error)

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

func (*MemberRankQuery) OnlyID

func (mrq *MemberRankQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*MemberRankQuery) OnlyIDX

func (mrq *MemberRankQuery) OnlyIDX(ctx context.Context) uint64

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

func (*MemberRankQuery) OnlyX

func (mrq *MemberRankQuery) OnlyX(ctx context.Context) *MemberRank

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

func (*MemberRankQuery) Order

Order specifies how the records should be ordered.

func (*MemberRankQuery) Page

func (mr *MemberRankQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...MemberRankPaginateOption,
) (*MemberRankPageList, error)

func (*MemberRankQuery) QueryMembers

func (mrq *MemberRankQuery) QueryMembers() *MemberQuery

QueryMembers chains the current query on the "members" edge.

func (*MemberRankQuery) Select

func (mrq *MemberRankQuery) Select(fields ...string) *MemberRankSelect

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

func (*MemberRankQuery) Unique

func (mrq *MemberRankQuery) Unique(unique bool) *MemberRankQuery

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

Where adds a new predicate for the MemberRankQuery builder.

func (*MemberRankQuery) WithMembers

func (mrq *MemberRankQuery) WithMembers(opts ...func(*MemberQuery)) *MemberRankQuery

WithMembers tells the query-builder to eager-load the nodes that are connected to the "members" edge. The optional arguments are used to configure the query builder of the edge.

type MemberRankSelect

type MemberRankSelect struct {
	*MemberRankQuery
	// contains filtered or unexported fields
}

MemberRankSelect is the builder for selecting fields of MemberRank entities.

func (*MemberRankSelect) Aggregate

func (mrs *MemberRankSelect) Aggregate(fns ...AggregateFunc) *MemberRankSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MemberRankSelect) Bool

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

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

func (*MemberRankSelect) BoolX

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

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

func (*MemberRankSelect) Bools

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

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

func (*MemberRankSelect) BoolsX

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

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

func (*MemberRankSelect) Float64

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

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

func (*MemberRankSelect) Float64X

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

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

func (*MemberRankSelect) Float64s

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

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

func (*MemberRankSelect) Float64sX

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

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

func (*MemberRankSelect) Int

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

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

func (*MemberRankSelect) IntX

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

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

func (*MemberRankSelect) Ints

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

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

func (*MemberRankSelect) IntsX

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

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

func (*MemberRankSelect) Scan

func (mrs *MemberRankSelect) Scan(ctx context.Context, v any) error

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

func (*MemberRankSelect) ScanX

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

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

func (*MemberRankSelect) String

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

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

func (*MemberRankSelect) StringX

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

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

func (*MemberRankSelect) Strings

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

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

func (*MemberRankSelect) StringsX

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

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

type MemberRankUpdate

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

MemberRankUpdate is the builder for updating MemberRank entities.

func (*MemberRankUpdate) AddMemberIDs

func (mru *MemberRankUpdate) AddMemberIDs(ids ...uuid.UUID) *MemberRankUpdate

AddMemberIDs adds the "members" edge to the Member entity by IDs.

func (*MemberRankUpdate) AddMembers

func (mru *MemberRankUpdate) AddMembers(m ...*Member) *MemberRankUpdate

AddMembers adds the "members" edges to the Member entity.

func (*MemberRankUpdate) ClearMembers

func (mru *MemberRankUpdate) ClearMembers() *MemberRankUpdate

ClearMembers clears all "members" edges to the Member entity.

func (*MemberRankUpdate) Exec

func (mru *MemberRankUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberRankUpdate) ExecX

func (mru *MemberRankUpdate) ExecX(ctx context.Context)

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

func (*MemberRankUpdate) Mutation

func (mru *MemberRankUpdate) Mutation() *MemberRankMutation

Mutation returns the MemberRankMutation object of the builder.

func (*MemberRankUpdate) RemoveMemberIDs

func (mru *MemberRankUpdate) RemoveMemberIDs(ids ...uuid.UUID) *MemberRankUpdate

RemoveMemberIDs removes the "members" edge to Member entities by IDs.

func (*MemberRankUpdate) RemoveMembers

func (mru *MemberRankUpdate) RemoveMembers(m ...*Member) *MemberRankUpdate

RemoveMembers removes "members" edges to Member entities.

func (*MemberRankUpdate) Save

func (mru *MemberRankUpdate) Save(ctx context.Context) (int, error)

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

func (*MemberRankUpdate) SaveX

func (mru *MemberRankUpdate) SaveX(ctx context.Context) int

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

func (*MemberRankUpdate) SetCode

func (mru *MemberRankUpdate) SetCode(s string) *MemberRankUpdate

SetCode sets the "code" field.

func (*MemberRankUpdate) SetDescription

func (mru *MemberRankUpdate) SetDescription(s string) *MemberRankUpdate

SetDescription sets the "description" field.

func (*MemberRankUpdate) SetName

func (mru *MemberRankUpdate) SetName(s string) *MemberRankUpdate

SetName sets the "name" field.

func (*MemberRankUpdate) SetNotEmptyCode

func (mr *MemberRankUpdate) SetNotEmptyCode(value string) *MemberRankUpdate

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

func (*MemberRankUpdate) SetNotEmptyDescription

func (mr *MemberRankUpdate) SetNotEmptyDescription(value string) *MemberRankUpdate

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

func (*MemberRankUpdate) SetNotEmptyName

func (mr *MemberRankUpdate) SetNotEmptyName(value string) *MemberRankUpdate

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

func (*MemberRankUpdate) SetNotEmptyRemark

func (mr *MemberRankUpdate) SetNotEmptyRemark(value string) *MemberRankUpdate

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

func (*MemberRankUpdate) SetRemark

func (mru *MemberRankUpdate) SetRemark(s string) *MemberRankUpdate

SetRemark sets the "remark" field.

func (*MemberRankUpdate) SetUpdatedAt

func (mru *MemberRankUpdate) SetUpdatedAt(t time.Time) *MemberRankUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MemberRankUpdate) Where

Where appends a list predicates to the MemberRankUpdate builder.

type MemberRankUpdateOne

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

MemberRankUpdateOne is the builder for updating a single MemberRank entity.

func (*MemberRankUpdateOne) AddMemberIDs

func (mruo *MemberRankUpdateOne) AddMemberIDs(ids ...uuid.UUID) *MemberRankUpdateOne

AddMemberIDs adds the "members" edge to the Member entity by IDs.

func (*MemberRankUpdateOne) AddMembers

func (mruo *MemberRankUpdateOne) AddMembers(m ...*Member) *MemberRankUpdateOne

AddMembers adds the "members" edges to the Member entity.

func (*MemberRankUpdateOne) ClearMembers

func (mruo *MemberRankUpdateOne) ClearMembers() *MemberRankUpdateOne

ClearMembers clears all "members" edges to the Member entity.

func (*MemberRankUpdateOne) Exec

func (mruo *MemberRankUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MemberRankUpdateOne) ExecX

func (mruo *MemberRankUpdateOne) ExecX(ctx context.Context)

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

func (*MemberRankUpdateOne) Mutation

func (mruo *MemberRankUpdateOne) Mutation() *MemberRankMutation

Mutation returns the MemberRankMutation object of the builder.

func (*MemberRankUpdateOne) RemoveMemberIDs

func (mruo *MemberRankUpdateOne) RemoveMemberIDs(ids ...uuid.UUID) *MemberRankUpdateOne

RemoveMemberIDs removes the "members" edge to Member entities by IDs.

func (*MemberRankUpdateOne) RemoveMembers

func (mruo *MemberRankUpdateOne) RemoveMembers(m ...*Member) *MemberRankUpdateOne

RemoveMembers removes "members" edges to Member entities.

func (*MemberRankUpdateOne) Save

func (mruo *MemberRankUpdateOne) Save(ctx context.Context) (*MemberRank, error)

Save executes the query and returns the updated MemberRank entity.

func (*MemberRankUpdateOne) SaveX

func (mruo *MemberRankUpdateOne) SaveX(ctx context.Context) *MemberRank

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

func (*MemberRankUpdateOne) Select

func (mruo *MemberRankUpdateOne) Select(field string, fields ...string) *MemberRankUpdateOne

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

func (*MemberRankUpdateOne) SetCode

SetCode sets the "code" field.

func (*MemberRankUpdateOne) SetDescription

func (mruo *MemberRankUpdateOne) SetDescription(s string) *MemberRankUpdateOne

SetDescription sets the "description" field.

func (*MemberRankUpdateOne) SetName

SetName sets the "name" field.

func (*MemberRankUpdateOne) SetNotEmptyCode

func (mr *MemberRankUpdateOne) SetNotEmptyCode(value string) *MemberRankUpdateOne

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

func (*MemberRankUpdateOne) SetNotEmptyDescription

func (mr *MemberRankUpdateOne) SetNotEmptyDescription(value string) *MemberRankUpdateOne

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

func (*MemberRankUpdateOne) SetNotEmptyName

func (mr *MemberRankUpdateOne) SetNotEmptyName(value string) *MemberRankUpdateOne

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

func (*MemberRankUpdateOne) SetNotEmptyRemark

func (mr *MemberRankUpdateOne) SetNotEmptyRemark(value string) *MemberRankUpdateOne

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

func (*MemberRankUpdateOne) SetRemark

func (mruo *MemberRankUpdateOne) SetRemark(s string) *MemberRankUpdateOne

SetRemark sets the "remark" field.

func (*MemberRankUpdateOne) SetUpdatedAt

func (mruo *MemberRankUpdateOne) SetUpdatedAt(t time.Time) *MemberRankUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MemberRankUpdateOne) Where

Where appends a list predicates to the MemberRankUpdate builder.

type MemberRanks

type MemberRanks []*MemberRank

MemberRanks is a parsable slice of MemberRank.

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

func (mu *MemberUpdate) AddStatus(u int8) *MemberUpdate

AddStatus adds u to the "status" field.

func (*MemberUpdate) ClearAvatar

func (mu *MemberUpdate) ClearAvatar() *MemberUpdate

ClearAvatar clears the value of the "avatar" field.

func (*MemberUpdate) ClearEmail

func (mu *MemberUpdate) ClearEmail() *MemberUpdate

ClearEmail clears the value of the "email" field.

func (*MemberUpdate) ClearMobile

func (mu *MemberUpdate) ClearMobile() *MemberUpdate

ClearMobile clears the value of the "mobile" field.

func (*MemberUpdate) ClearRankID

func (mu *MemberUpdate) ClearRankID() *MemberUpdate

ClearRankID clears the value of the "rank_id" field.

func (*MemberUpdate) ClearRanks

func (mu *MemberUpdate) ClearRanks() *MemberUpdate

ClearRanks clears the "ranks" edge to the MemberRank entity.

func (*MemberUpdate) ClearStatus

func (mu *MemberUpdate) ClearStatus() *MemberUpdate

ClearStatus clears the value of the "status" 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) 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) SetEmail

func (mu *MemberUpdate) SetEmail(s string) *MemberUpdate

SetEmail sets the "email" field.

func (*MemberUpdate) SetMobile

func (mu *MemberUpdate) SetMobile(s string) *MemberUpdate

SetMobile sets the "mobile" 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) SetNillableEmail

func (mu *MemberUpdate) SetNillableEmail(s *string) *MemberUpdate

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

func (*MemberUpdate) SetNillableMobile

func (mu *MemberUpdate) SetNillableMobile(s *string) *MemberUpdate

SetNillableMobile sets the "mobile" field if the given value is not nil.

func (*MemberUpdate) SetNillableRankID

func (mu *MemberUpdate) SetNillableRankID(u *uint64) *MemberUpdate

SetNillableRankID sets the "rank_id" field if the given value is not nil.

func (*MemberUpdate) SetNillableRanksID

func (mu *MemberUpdate) SetNillableRanksID(id *uint64) *MemberUpdate

SetNillableRanksID sets the "ranks" edge to the MemberRank entity by ID if the given value is not nil.

func (*MemberUpdate) SetNillableStatus

func (mu *MemberUpdate) SetNillableStatus(u *uint8) *MemberUpdate

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

func (*MemberUpdate) SetNotEmptyAvatar

func (m *MemberUpdate) SetNotEmptyAvatar(value string) *MemberUpdate

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

func (*MemberUpdate) SetNotEmptyEmail

func (m *MemberUpdate) SetNotEmptyEmail(value string) *MemberUpdate

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

func (*MemberUpdate) SetNotEmptyMobile

func (m *MemberUpdate) SetNotEmptyMobile(value string) *MemberUpdate

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

func (*MemberUpdate) SetNotEmptyNickname

func (m *MemberUpdate) SetNotEmptyNickname(value string) *MemberUpdate

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

func (*MemberUpdate) SetNotEmptyPassword

func (m *MemberUpdate) SetNotEmptyPassword(value string) *MemberUpdate

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

func (*MemberUpdate) SetNotEmptyRankID

func (m *MemberUpdate) SetNotEmptyRankID(value uint64) *MemberUpdate

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

func (*MemberUpdate) SetNotEmptyStatus

func (m *MemberUpdate) SetNotEmptyStatus(value uint8) *MemberUpdate

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

func (*MemberUpdate) SetNotEmptyUsername

func (m *MemberUpdate) SetNotEmptyUsername(value string) *MemberUpdate

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

func (*MemberUpdate) SetPassword

func (mu *MemberUpdate) SetPassword(s string) *MemberUpdate

SetPassword sets the "password" field.

func (*MemberUpdate) SetRankID

func (mu *MemberUpdate) SetRankID(u uint64) *MemberUpdate

SetRankID sets the "rank_id" field.

func (*MemberUpdate) SetRanks

func (mu *MemberUpdate) SetRanks(m *MemberRank) *MemberUpdate

SetRanks sets the "ranks" edge to the MemberRank entity.

func (*MemberUpdate) SetRanksID

func (mu *MemberUpdate) SetRanksID(id uint64) *MemberUpdate

SetRanksID sets the "ranks" edge to the MemberRank entity by ID.

func (*MemberUpdate) SetStatus

func (mu *MemberUpdate) SetStatus(u uint8) *MemberUpdate

SetStatus sets the "status" field.

func (*MemberUpdate) SetUpdatedAt

func (mu *MemberUpdate) SetUpdatedAt(t time.Time) *MemberUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MemberUpdate) SetUsername

func (mu *MemberUpdate) SetUsername(s string) *MemberUpdate

SetUsername sets the "username" 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) AddStatus

func (muo *MemberUpdateOne) AddStatus(u int8) *MemberUpdateOne

AddStatus adds u to the "status" field.

func (*MemberUpdateOne) ClearAvatar

func (muo *MemberUpdateOne) ClearAvatar() *MemberUpdateOne

ClearAvatar clears the value of the "avatar" field.

func (*MemberUpdateOne) ClearEmail

func (muo *MemberUpdateOne) ClearEmail() *MemberUpdateOne

ClearEmail clears the value of the "email" field.

func (*MemberUpdateOne) ClearMobile

func (muo *MemberUpdateOne) ClearMobile() *MemberUpdateOne

ClearMobile clears the value of the "mobile" field.

func (*MemberUpdateOne) ClearRankID

func (muo *MemberUpdateOne) ClearRankID() *MemberUpdateOne

ClearRankID clears the value of the "rank_id" field.

func (*MemberUpdateOne) ClearRanks

func (muo *MemberUpdateOne) ClearRanks() *MemberUpdateOne

ClearRanks clears the "ranks" edge to the MemberRank entity.

func (*MemberUpdateOne) ClearStatus

func (muo *MemberUpdateOne) ClearStatus() *MemberUpdateOne

ClearStatus clears the value of the "status" 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) 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) SetEmail

func (muo *MemberUpdateOne) SetEmail(s string) *MemberUpdateOne

SetEmail sets the "email" field.

func (*MemberUpdateOne) SetMobile

func (muo *MemberUpdateOne) SetMobile(s string) *MemberUpdateOne

SetMobile sets the "mobile" 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) SetNillableEmail

func (muo *MemberUpdateOne) SetNillableEmail(s *string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNillableMobile

func (muo *MemberUpdateOne) SetNillableMobile(s *string) *MemberUpdateOne

SetNillableMobile sets the "mobile" field if the given value is not nil.

func (*MemberUpdateOne) SetNillableRankID

func (muo *MemberUpdateOne) SetNillableRankID(u *uint64) *MemberUpdateOne

SetNillableRankID sets the "rank_id" field if the given value is not nil.

func (*MemberUpdateOne) SetNillableRanksID

func (muo *MemberUpdateOne) SetNillableRanksID(id *uint64) *MemberUpdateOne

SetNillableRanksID sets the "ranks" edge to the MemberRank entity by ID if the given value is not nil.

func (*MemberUpdateOne) SetNillableStatus

func (muo *MemberUpdateOne) SetNillableStatus(u *uint8) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNotEmptyAvatar

func (m *MemberUpdateOne) SetNotEmptyAvatar(value string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNotEmptyEmail

func (m *MemberUpdateOne) SetNotEmptyEmail(value string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNotEmptyMobile

func (m *MemberUpdateOne) SetNotEmptyMobile(value string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNotEmptyNickname

func (m *MemberUpdateOne) SetNotEmptyNickname(value string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNotEmptyPassword

func (m *MemberUpdateOne) SetNotEmptyPassword(value string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNotEmptyRankID

func (m *MemberUpdateOne) SetNotEmptyRankID(value uint64) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNotEmptyStatus

func (m *MemberUpdateOne) SetNotEmptyStatus(value uint8) *MemberUpdateOne

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

func (*MemberUpdateOne) SetNotEmptyUsername

func (m *MemberUpdateOne) SetNotEmptyUsername(value string) *MemberUpdateOne

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

func (*MemberUpdateOne) SetPassword

func (muo *MemberUpdateOne) SetPassword(s string) *MemberUpdateOne

SetPassword sets the "password" field.

func (*MemberUpdateOne) SetRankID

func (muo *MemberUpdateOne) SetRankID(u uint64) *MemberUpdateOne

SetRankID sets the "rank_id" field.

func (*MemberUpdateOne) SetRanks

func (muo *MemberUpdateOne) SetRanks(m *MemberRank) *MemberUpdateOne

SetRanks sets the "ranks" edge to the MemberRank entity.

func (*MemberUpdateOne) SetRanksID

func (muo *MemberUpdateOne) SetRanksID(id uint64) *MemberUpdateOne

SetRanksID sets the "ranks" edge to the MemberRank entity by ID.

func (*MemberUpdateOne) SetStatus

func (muo *MemberUpdateOne) SetStatus(u uint8) *MemberUpdateOne

SetStatus sets the "status" field.

func (*MemberUpdateOne) SetUpdatedAt

func (muo *MemberUpdateOne) SetUpdatedAt(t time.Time) *MemberUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MemberUpdateOne) SetUsername

func (muo *MemberUpdateOne) SetUsername(s string) *MemberUpdateOne

SetUsername sets the "username" field.

func (*MemberUpdateOne) Where

func (muo *MemberUpdateOne) Where(ps ...predicate.Member) *MemberUpdateOne

Where appends a list predicates to the MemberUpdate builder.

type Members

type Members []*Member

Members is a parsable slice of Member.

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 OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type PageDetails

type PageDetails struct {
	Page  uint64 `json:"page"`
	Size  uint64 `json:"size"`
	Total uint64 `json:"total"`
}

type Policy

type Policy = ent.Policy

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

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

	// Member is the client for interacting with the Member builders.
	Member *MemberClient
	// MemberRank is the client for interacting with the MemberRank builders.
	MemberRank *MemberRankClient
	// 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