ent

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 24 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"
	TypeOauthProvider = "OauthProvider"
	TypeToken         = "Token"
)

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.

View Source
var DefaultOauthProviderOrder = Desc(oauthprovider.FieldID)

DefaultOauthProviderOrder is the default ordering of OauthProvider.

View Source
var DefaultTokenOrder = Desc(token.FieldID)

DefaultTokenOrder is the default ordering of Token.

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Member is the client for interacting with the Member builders.
	Member *MemberClient
	// MemberRank is the client for interacting with the MemberRank builders.
	MemberRank *MemberRankClient
	// OauthProvider is the client for interacting with the OauthProvider builders.
	OauthProvider *OauthProviderClient
	// Token is the client for interacting with the Token builders.
	Token *TokenClient
	// 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) ExecContext added in v1.1.6

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

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

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) QueryContext added in v1.1.6

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

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

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type 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"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// 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"`
	// Wechat Open ID | 微信 Open ID
	WechatOpenID string `json:"wechat_open_id,omitempty"`
	// Member expired time | 会员到期时间
	ExpiredAt time.Time `json:"expired_at,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) ExecContext added in v1.1.6

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

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

func (*Member) QueryContext added in v1.1.6

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

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

func (*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) ExecContext added in v1.1.6

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

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

func (*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) MapCreateBulk added in v1.1.6

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

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

func (*MemberClient) Query

func (c *MemberClient) Query() *MemberQuery

Query returns a query builder for Member.

func (*MemberClient) QueryContext added in v1.1.6

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

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

func (*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) ExecContext added in v1.1.6

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

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

func (*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) QueryContext added in v1.1.6

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

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

func (*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) SetExpiredAt added in v1.2.3

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

SetExpiredAt sets the "expired_at" 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) SetNillableExpiredAt added in v1.2.3

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

SetNillableExpiredAt sets the "expired_at" 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) SetNillableWechatOpenID added in v1.1.5

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

SetNillableWechatOpenID sets the "wechat_open_id" field if the given value is not nil.

func (*MemberCreate) SetNotNilAvatar added in v1.0.11

func (m *MemberCreate) SetNotNilAvatar(value *string) *MemberCreate

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilEmail added in v1.0.11

func (m *MemberCreate) SetNotNilEmail(value *string) *MemberCreate

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilExpiredAt added in v1.2.3

func (m *MemberCreate) SetNotNilExpiredAt(value *time.Time) *MemberCreate

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilMobile added in v1.0.11

func (m *MemberCreate) SetNotNilMobile(value *string) *MemberCreate

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilNickname added in v1.0.11

func (m *MemberCreate) SetNotNilNickname(value *string) *MemberCreate

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilPassword added in v1.0.11

func (m *MemberCreate) SetNotNilPassword(value *string) *MemberCreate

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilRankID added in v1.0.11

func (m *MemberCreate) SetNotNilRankID(value *uint64) *MemberCreate

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilStatus added in v1.0.11

func (m *MemberCreate) SetNotNilStatus(value *uint8) *MemberCreate

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilUpdatedAt added in v1.0.11

func (m *MemberCreate) SetNotNilUpdatedAt(value *time.Time) *MemberCreate

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilUsername added in v1.0.11

func (m *MemberCreate) SetNotNilUsername(value *string) *MemberCreate

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilWechatOpenID added in v1.1.5

func (m *MemberCreate) SetNotNilWechatOpenID(value *string) *MemberCreate

set field if value's pointer 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.

func (*MemberCreate) SetWechatOpenID added in v1.1.5

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

SetWechatOpenID sets the "wechat_open_id" 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) ExecContext added in v1.1.6

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

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

func (*MemberCreateBulk) ExecX

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

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

func (*MemberCreateBulk) QueryContext added in v1.1.6

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

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

func (*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) ExecContext added in v1.1.6

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

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

func (*MemberDelete) ExecX

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

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

func (*MemberDelete) QueryContext added in v1.1.6

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

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

func (*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) ClearExpiredAt added in v1.2.3

func (m *MemberMutation) ClearExpiredAt()

ClearExpiredAt clears the value of the "expired_at" 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) ClearWechatOpenID added in v1.1.5

func (m *MemberMutation) ClearWechatOpenID()

ClearWechatOpenID clears the value of the "wechat_open_id" 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) ExecContext added in v1.1.6

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

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

func (*MemberMutation) ExpiredAt added in v1.2.3

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

ExpiredAt returns the value of the "expired_at" field in the mutation.

func (*MemberMutation) ExpiredAtCleared added in v1.2.3

func (m *MemberMutation) ExpiredAtCleared() bool

ExpiredAtCleared returns if the "expired_at" 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) OldExpiredAt added in v1.2.3

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

OldExpiredAt returns the old "expired_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) 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) OldWechatOpenID added in v1.1.5

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

OldWechatOpenID returns the old "wechat_open_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) 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) QueryContext added in v1.1.6

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

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

func (*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) ResetExpiredAt added in v1.2.3

func (m *MemberMutation) ResetExpiredAt()

ResetExpiredAt resets all changes to the "expired_at" 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) ResetWechatOpenID added in v1.1.5

func (m *MemberMutation) ResetWechatOpenID()

ResetWechatOpenID resets all changes to the "wechat_open_id" 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) SetExpiredAt added in v1.2.3

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

SetExpiredAt sets the "expired_at" 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) SetWechatOpenID added in v1.1.5

func (m *MemberMutation) SetWechatOpenID(s string)

SetWechatOpenID sets the "wechat_open_id" 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) WechatOpenID added in v1.1.5

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

WechatOpenID returns the value of the "wechat_open_id" field in the mutation.

func (*MemberMutation) WechatOpenIDCleared added in v1.1.5

func (m *MemberMutation) WechatOpenIDCleared() bool

WechatOpenIDCleared returns if the "wechat_open_id" field was cleared in this 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) ExecContext added in v1.1.6

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

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

func (*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) QueryContext added in v1.1.6

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

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

func (*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"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	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) ExecContext added in v1.1.6

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

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

func (*MemberRank) QueryContext added in v1.1.6

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

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

func (*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) ExecContext added in v1.1.6

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

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

func (*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) MapCreateBulk added in v1.1.6

func (c *MemberRankClient) MapCreateBulk(slice any, setFunc func(*MemberRankCreate, int)) *MemberRankCreateBulk

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

func (*MemberRankClient) Query

func (c *MemberRankClient) Query() *MemberRankQuery

Query returns a query builder for MemberRank.

func (*MemberRankClient) QueryContext added in v1.1.6

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

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

func (*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) ExecContext added in v1.1.6

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

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

func (*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) QueryContext added in v1.1.6

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

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

func (*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) SetNotNilCode added in v1.0.11

func (mr *MemberRankCreate) SetNotNilCode(value *string) *MemberRankCreate

set field if value's pointer is not nil.

func (*MemberRankCreate) SetNotNilDescription added in v1.0.11

func (mr *MemberRankCreate) SetNotNilDescription(value *string) *MemberRankCreate

set field if value's pointer is not nil.

func (*MemberRankCreate) SetNotNilName added in v1.0.11

func (mr *MemberRankCreate) SetNotNilName(value *string) *MemberRankCreate

set field if value's pointer is not nil.

func (*MemberRankCreate) SetNotNilRemark added in v1.0.11

func (mr *MemberRankCreate) SetNotNilRemark(value *string) *MemberRankCreate

set field if value's pointer is not nil.

func (*MemberRankCreate) SetNotNilUpdatedAt added in v1.0.11

func (mr *MemberRankCreate) SetNotNilUpdatedAt(value *time.Time) *MemberRankCreate

set field if value's pointer 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) ExecContext added in v1.1.6

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

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

func (*MemberRankCreateBulk) ExecX

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

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

func (*MemberRankCreateBulk) QueryContext added in v1.1.6

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

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

func (*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) ExecContext added in v1.1.6

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

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

func (*MemberRankDelete) ExecX

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

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

func (*MemberRankDelete) QueryContext added in v1.1.6

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

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

func (*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) ExecContext added in v1.1.6

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

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

func (*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) QueryContext added in v1.1.6

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

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

func (*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) ExecContext added in v1.1.6

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

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

func (*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) QueryContext added in v1.1.6

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

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

func (*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) ExecContext added in v1.1.6

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

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

func (*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) QueryContext added in v1.1.6

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

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

func (*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) ExecContext added in v1.1.6

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

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

func (*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) QueryContext added in v1.1.6

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

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

func (*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) SetNillableCode added in v1.1.9

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

SetNillableCode sets the "code" field if the given value is not nil.

func (*MemberRankUpdate) SetNillableDescription added in v1.1.9

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

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

func (*MemberRankUpdate) SetNillableName added in v1.1.9

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

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

func (*MemberRankUpdate) SetNillableRemark added in v1.1.9

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

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

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) SetNotNilCode added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberRankUpdate) SetNotNilDescription added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberRankUpdate) SetNotNilName added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberRankUpdate) SetNotNilRemark added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberRankUpdate) SetNotNilUpdatedAt added in v1.0.11

func (mr *MemberRankUpdate) SetNotNilUpdatedAt(value *time.Time) *MemberRankUpdate

set field if value's pointer is not nil.

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) ExecContext added in v1.1.6

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

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

func (*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) QueryContext added in v1.1.6

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

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

func (*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) SetNillableCode added in v1.1.9

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

SetNillableCode sets the "code" field if the given value is not nil.

func (*MemberRankUpdateOne) SetNillableDescription added in v1.1.9

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

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

func (*MemberRankUpdateOne) SetNillableName added in v1.1.9

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

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

func (*MemberRankUpdateOne) SetNillableRemark added in v1.1.9

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

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

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) SetNotNilCode added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberRankUpdateOne) SetNotNilDescription added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberRankUpdateOne) SetNotNilName added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberRankUpdateOne) SetNotNilRemark added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberRankUpdateOne) SetNotNilUpdatedAt added in v1.0.11

func (mr *MemberRankUpdateOne) SetNotNilUpdatedAt(value *time.Time) *MemberRankUpdateOne

set field if value's pointer is not nil.

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) ExecContext added in v1.1.6

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

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

func (*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) QueryContext added in v1.1.6

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

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

func (*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) ClearExpiredAt added in v1.2.3

func (mu *MemberUpdate) ClearExpiredAt() *MemberUpdate

ClearExpiredAt clears the value of the "expired_at" 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) ClearWechatOpenID added in v1.1.5

func (mu *MemberUpdate) ClearWechatOpenID() *MemberUpdate

ClearWechatOpenID clears the value of the "wechat_open_id" field.

func (*MemberUpdate) Exec

func (mu *MemberUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MemberUpdate) ExecContext added in v1.1.6

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

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

func (*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) QueryContext added in v1.1.6

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

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

func (*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) SetExpiredAt added in v1.2.3

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

SetExpiredAt sets the "expired_at" 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) SetNillableExpiredAt added in v1.2.3

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

SetNillableExpiredAt sets the "expired_at" 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) SetNillableNickname added in v1.1.9

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

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

func (*MemberUpdate) SetNillablePassword added in v1.1.9

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

SetNillablePassword sets the "password" 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) SetNillableUsername added in v1.1.9

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

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

func (*MemberUpdate) SetNillableWechatOpenID added in v1.1.5

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

SetNillableWechatOpenID sets the "wechat_open_id" 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) SetNotNilAvatar added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilEmail added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilExpiredAt added in v1.2.3

func (m *MemberUpdate) SetNotNilExpiredAt(value *time.Time) *MemberUpdate

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilMobile added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilNickname added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilPassword added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilRankID added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilStatus added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilUpdatedAt added in v1.0.11

func (m *MemberUpdate) SetNotNilUpdatedAt(value *time.Time) *MemberUpdate

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilUsername added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilWechatOpenID added in v1.1.5

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

set field if value's pointer is not nil.

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) SetWechatOpenID added in v1.1.5

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

SetWechatOpenID sets the "wechat_open_id" 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) ClearExpiredAt added in v1.2.3

func (muo *MemberUpdateOne) ClearExpiredAt() *MemberUpdateOne

ClearExpiredAt clears the value of the "expired_at" 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) ClearWechatOpenID added in v1.1.5

func (muo *MemberUpdateOne) ClearWechatOpenID() *MemberUpdateOne

ClearWechatOpenID clears the value of the "wechat_open_id" field.

func (*MemberUpdateOne) Exec

func (muo *MemberUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MemberUpdateOne) ExecContext added in v1.1.6

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

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

func (*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) QueryContext added in v1.1.6

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

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

func (*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) SetExpiredAt added in v1.2.3

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

SetExpiredAt sets the "expired_at" 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) SetNillableExpiredAt added in v1.2.3

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

SetNillableExpiredAt sets the "expired_at" 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) SetNillableNickname added in v1.1.9

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

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

func (*MemberUpdateOne) SetNillablePassword added in v1.1.9

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

SetNillablePassword sets the "password" 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) SetNillableUsername added in v1.1.9

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

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

func (*MemberUpdateOne) SetNillableWechatOpenID added in v1.1.5

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

SetNillableWechatOpenID sets the "wechat_open_id" 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) SetNotNilAvatar added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilEmail added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilExpiredAt added in v1.2.3

func (m *MemberUpdateOne) SetNotNilExpiredAt(value *time.Time) *MemberUpdateOne

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilMobile added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilNickname added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilPassword added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilRankID added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilStatus added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilUpdatedAt added in v1.0.11

func (m *MemberUpdateOne) SetNotNilUpdatedAt(value *time.Time) *MemberUpdateOne

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilUsername added in v1.0.11

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilWechatOpenID added in v1.1.5

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

set field if value's pointer is not nil.

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) SetWechatOpenID added in v1.1.5

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

SetWechatOpenID sets the "wechat_open_id" 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 OauthProvider added in v1.0.12

type OauthProvider struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// The provider's name | 提供商名称
	Name string `json:"name,omitempty"`
	// The client id | 客户端 id
	ClientID string `json:"client_id,omitempty"`
	// The client secret | 客户端密钥
	ClientSecret string `json:"client_secret,omitempty"`
	// The redirect url | 跳转地址
	RedirectURL string `json:"redirect_url,omitempty"`
	// The scopes | 权限范围
	Scopes string `json:"scopes,omitempty"`
	// The auth url of the provider | 认证地址
	AuthURL string `json:"auth_url,omitempty"`
	// The token url of the provider | 获取 token地址
	TokenURL string `json:"token_url,omitempty"`
	// The auth style, 0: auto detect 1: third party log in 2: log in with username and password
	AuthStyle uint64 `json:"auth_style,omitempty"`
	// The URL to request user information by token | 用户信息请求地址
	InfoURL string `json:"info_url,omitempty"`
	// contains filtered or unexported fields
}

OauthProvider is the model entity for the OauthProvider schema.

func (*OauthProvider) ExecContext added in v1.1.6

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

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

func (*OauthProvider) QueryContext added in v1.1.6

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

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

func (*OauthProvider) String added in v1.0.12

func (op *OauthProvider) String() string

String implements the fmt.Stringer.

func (*OauthProvider) Unwrap added in v1.0.12

func (op *OauthProvider) Unwrap() *OauthProvider

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

func (*OauthProvider) Update added in v1.0.12

func (op *OauthProvider) Update() *OauthProviderUpdateOne

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

func (*OauthProvider) Value added in v1.0.12

func (op *OauthProvider) Value(name string) (ent.Value, error)

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

type OauthProviderClient added in v1.0.12

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

OauthProviderClient is a client for the OauthProvider schema.

func NewOauthProviderClient added in v1.0.12

func NewOauthProviderClient(c config) *OauthProviderClient

NewOauthProviderClient returns a client for the OauthProvider from the given config.

func (*OauthProviderClient) Create added in v1.0.12

Create returns a builder for creating a OauthProvider entity.

func (*OauthProviderClient) CreateBulk added in v1.0.12

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

func (*OauthProviderClient) Delete added in v1.0.12

Delete returns a delete builder for OauthProvider.

func (*OauthProviderClient) DeleteOne added in v1.0.12

DeleteOne returns a builder for deleting the given entity.

func (*OauthProviderClient) DeleteOneID added in v1.0.12

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

func (*OauthProviderClient) ExecContext added in v1.1.6

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

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

func (*OauthProviderClient) Get added in v1.0.12

Get returns a OauthProvider entity by its id.

func (*OauthProviderClient) GetX added in v1.0.12

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

func (*OauthProviderClient) Hooks added in v1.0.12

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

Hooks returns the client hooks.

func (*OauthProviderClient) Intercept added in v1.0.12

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

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

func (*OauthProviderClient) Interceptors added in v1.0.12

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

Interceptors returns the client interceptors.

func (*OauthProviderClient) MapCreateBulk added in v1.1.6

func (c *OauthProviderClient) MapCreateBulk(slice any, setFunc func(*OauthProviderCreate, int)) *OauthProviderCreateBulk

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

func (*OauthProviderClient) Query added in v1.0.12

Query returns a query builder for OauthProvider.

func (*OauthProviderClient) QueryContext added in v1.1.6

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

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

func (*OauthProviderClient) Update added in v1.0.12

Update returns an update builder for OauthProvider.

func (*OauthProviderClient) UpdateOne added in v1.0.12

UpdateOne returns an update builder for the given entity.

func (*OauthProviderClient) UpdateOneID added in v1.0.12

UpdateOneID returns an update builder for the given id.

func (*OauthProviderClient) Use added in v1.0.12

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

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

type OauthProviderCreate added in v1.0.12

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

OauthProviderCreate is the builder for creating a OauthProvider entity.

func (*OauthProviderCreate) Exec added in v1.0.12

func (opc *OauthProviderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OauthProviderCreate) ExecContext added in v1.1.6

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

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

func (*OauthProviderCreate) ExecX added in v1.0.12

func (opc *OauthProviderCreate) ExecX(ctx context.Context)

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

func (*OauthProviderCreate) Mutation added in v1.0.12

func (opc *OauthProviderCreate) Mutation() *OauthProviderMutation

Mutation returns the OauthProviderMutation object of the builder.

func (*OauthProviderCreate) QueryContext added in v1.1.6

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

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

func (*OauthProviderCreate) Save added in v1.0.12

Save creates the OauthProvider in the database.

func (*OauthProviderCreate) SaveX added in v1.0.12

SaveX calls Save and panics if Save returns an error.

func (*OauthProviderCreate) SetAuthStyle added in v1.0.12

func (opc *OauthProviderCreate) SetAuthStyle(u uint64) *OauthProviderCreate

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderCreate) SetAuthURL added in v1.0.12

func (opc *OauthProviderCreate) SetAuthURL(s string) *OauthProviderCreate

SetAuthURL sets the "auth_url" field.

func (*OauthProviderCreate) SetClientID added in v1.0.12

func (opc *OauthProviderCreate) SetClientID(s string) *OauthProviderCreate

SetClientID sets the "client_id" field.

func (*OauthProviderCreate) SetClientSecret added in v1.0.12

func (opc *OauthProviderCreate) SetClientSecret(s string) *OauthProviderCreate

SetClientSecret sets the "client_secret" field.

func (*OauthProviderCreate) SetCreatedAt added in v1.0.12

func (opc *OauthProviderCreate) SetCreatedAt(t time.Time) *OauthProviderCreate

SetCreatedAt sets the "created_at" field.

func (*OauthProviderCreate) SetID added in v1.0.12

SetID sets the "id" field.

func (*OauthProviderCreate) SetInfoURL added in v1.0.12

func (opc *OauthProviderCreate) SetInfoURL(s string) *OauthProviderCreate

SetInfoURL sets the "info_url" field.

func (*OauthProviderCreate) SetName added in v1.0.12

SetName sets the "name" field.

func (*OauthProviderCreate) SetNillableCreatedAt added in v1.0.12

func (opc *OauthProviderCreate) SetNillableCreatedAt(t *time.Time) *OauthProviderCreate

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

func (*OauthProviderCreate) SetNillableUpdatedAt added in v1.0.12

func (opc *OauthProviderCreate) SetNillableUpdatedAt(t *time.Time) *OauthProviderCreate

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

func (*OauthProviderCreate) SetNotNilAuthStyle added in v1.0.12

func (op *OauthProviderCreate) SetNotNilAuthStyle(value *uint64) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilAuthURL added in v1.0.12

func (op *OauthProviderCreate) SetNotNilAuthURL(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilClientID added in v1.0.12

func (op *OauthProviderCreate) SetNotNilClientID(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilClientSecret added in v1.0.12

func (op *OauthProviderCreate) SetNotNilClientSecret(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilInfoURL added in v1.0.12

func (op *OauthProviderCreate) SetNotNilInfoURL(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilName added in v1.0.12

func (op *OauthProviderCreate) SetNotNilName(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilRedirectURL added in v1.0.12

func (op *OauthProviderCreate) SetNotNilRedirectURL(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilScopes added in v1.0.12

func (op *OauthProviderCreate) SetNotNilScopes(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilTokenURL added in v1.0.12

func (op *OauthProviderCreate) SetNotNilTokenURL(value *string) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilUpdatedAt added in v1.0.12

func (op *OauthProviderCreate) SetNotNilUpdatedAt(value *time.Time) *OauthProviderCreate

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetRedirectURL added in v1.0.12

func (opc *OauthProviderCreate) SetRedirectURL(s string) *OauthProviderCreate

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderCreate) SetScopes added in v1.0.12

func (opc *OauthProviderCreate) SetScopes(s string) *OauthProviderCreate

SetScopes sets the "scopes" field.

func (*OauthProviderCreate) SetTokenURL added in v1.0.12

func (opc *OauthProviderCreate) SetTokenURL(s string) *OauthProviderCreate

SetTokenURL sets the "token_url" field.

func (*OauthProviderCreate) SetUpdatedAt added in v1.0.12

func (opc *OauthProviderCreate) SetUpdatedAt(t time.Time) *OauthProviderCreate

SetUpdatedAt sets the "updated_at" field.

type OauthProviderCreateBulk added in v1.0.12

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

OauthProviderCreateBulk is the builder for creating many OauthProvider entities in bulk.

func (*OauthProviderCreateBulk) Exec added in v1.0.12

func (opcb *OauthProviderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OauthProviderCreateBulk) ExecContext added in v1.1.6

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

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

func (*OauthProviderCreateBulk) ExecX added in v1.0.12

func (opcb *OauthProviderCreateBulk) ExecX(ctx context.Context)

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

func (*OauthProviderCreateBulk) QueryContext added in v1.1.6

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

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

func (*OauthProviderCreateBulk) Save added in v1.0.12

Save creates the OauthProvider entities in the database.

func (*OauthProviderCreateBulk) SaveX added in v1.0.12

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

type OauthProviderDelete added in v1.0.12

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

OauthProviderDelete is the builder for deleting a OauthProvider entity.

func (*OauthProviderDelete) Exec added in v1.0.12

func (opd *OauthProviderDelete) Exec(ctx context.Context) (int, error)

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

func (*OauthProviderDelete) ExecContext added in v1.1.6

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

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

func (*OauthProviderDelete) ExecX added in v1.0.12

func (opd *OauthProviderDelete) ExecX(ctx context.Context) int

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

func (*OauthProviderDelete) QueryContext added in v1.1.6

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

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

func (*OauthProviderDelete) Where added in v1.0.12

Where appends a list predicates to the OauthProviderDelete builder.

type OauthProviderDeleteOne added in v1.0.12

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

OauthProviderDeleteOne is the builder for deleting a single OauthProvider entity.

func (*OauthProviderDeleteOne) Exec added in v1.0.12

func (opdo *OauthProviderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OauthProviderDeleteOne) ExecX added in v1.0.12

func (opdo *OauthProviderDeleteOne) ExecX(ctx context.Context)

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

func (*OauthProviderDeleteOne) Where added in v1.0.12

Where appends a list predicates to the OauthProviderDelete builder.

type OauthProviderGroupBy added in v1.0.12

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

OauthProviderGroupBy is the group-by builder for OauthProvider entities.

func (*OauthProviderGroupBy) Aggregate added in v1.0.12

func (opgb *OauthProviderGroupBy) Aggregate(fns ...AggregateFunc) *OauthProviderGroupBy

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

func (*OauthProviderGroupBy) Bool added in v1.0.12

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

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

func (*OauthProviderGroupBy) BoolX added in v1.0.12

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

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

func (*OauthProviderGroupBy) Bools added in v1.0.12

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

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

func (*OauthProviderGroupBy) BoolsX added in v1.0.12

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

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

func (*OauthProviderGroupBy) Float64 added in v1.0.12

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

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

func (*OauthProviderGroupBy) Float64X added in v1.0.12

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

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

func (*OauthProviderGroupBy) Float64s added in v1.0.12

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

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

func (*OauthProviderGroupBy) Float64sX added in v1.0.12

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

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

func (*OauthProviderGroupBy) Int added in v1.0.12

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

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

func (*OauthProviderGroupBy) IntX added in v1.0.12

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

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

func (*OauthProviderGroupBy) Ints added in v1.0.12

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

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

func (*OauthProviderGroupBy) IntsX added in v1.0.12

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

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

func (*OauthProviderGroupBy) Scan added in v1.0.12

func (opgb *OauthProviderGroupBy) Scan(ctx context.Context, v any) error

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

func (*OauthProviderGroupBy) ScanX added in v1.0.12

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

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

func (*OauthProviderGroupBy) String added in v1.0.12

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

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

func (*OauthProviderGroupBy) StringX added in v1.0.12

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

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

func (*OauthProviderGroupBy) Strings added in v1.0.12

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

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

func (*OauthProviderGroupBy) StringsX added in v1.0.12

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

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

type OauthProviderMutation added in v1.0.12

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

OauthProviderMutation represents an operation that mutates the OauthProvider nodes in the graph.

func (*OauthProviderMutation) AddAuthStyle added in v1.0.12

func (m *OauthProviderMutation) AddAuthStyle(u int64)

AddAuthStyle adds u to the "auth_style" field.

func (*OauthProviderMutation) AddField added in v1.0.12

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

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

func (*OauthProviderMutation) AddedAuthStyle added in v1.0.12

func (m *OauthProviderMutation) AddedAuthStyle() (r int64, exists bool)

AddedAuthStyle returns the value that was added to the "auth_style" field in this mutation.

func (*OauthProviderMutation) AddedEdges added in v1.0.12

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

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

func (*OauthProviderMutation) AddedField added in v1.0.12

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

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

func (*OauthProviderMutation) AddedFields added in v1.0.12

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

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

func (*OauthProviderMutation) AddedIDs added in v1.0.12

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

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

func (*OauthProviderMutation) AuthStyle added in v1.0.12

func (m *OauthProviderMutation) AuthStyle() (r uint64, exists bool)

AuthStyle returns the value of the "auth_style" field in the mutation.

func (*OauthProviderMutation) AuthURL added in v1.0.12

func (m *OauthProviderMutation) AuthURL() (r string, exists bool)

AuthURL returns the value of the "auth_url" field in the mutation.

func (*OauthProviderMutation) ClearEdge added in v1.0.12

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

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

func (*OauthProviderMutation) ClearField added in v1.0.12

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

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

func (*OauthProviderMutation) ClearedEdges added in v1.0.12

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

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

func (*OauthProviderMutation) ClearedFields added in v1.0.12

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

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

func (OauthProviderMutation) Client added in v1.0.12

func (m OauthProviderMutation) Client() *Client

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

func (*OauthProviderMutation) ClientID added in v1.0.12

func (m *OauthProviderMutation) ClientID() (r string, exists bool)

ClientID returns the value of the "client_id" field in the mutation.

func (*OauthProviderMutation) ClientSecret added in v1.0.12

func (m *OauthProviderMutation) ClientSecret() (r string, exists bool)

ClientSecret returns the value of the "client_secret" field in the mutation.

func (*OauthProviderMutation) CreatedAt added in v1.0.12

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

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

func (*OauthProviderMutation) EdgeCleared added in v1.0.12

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

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

func (*OauthProviderMutation) ExecContext added in v1.1.6

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

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

func (*OauthProviderMutation) Field added in v1.0.12

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

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

func (*OauthProviderMutation) FieldCleared added in v1.0.12

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

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

func (*OauthProviderMutation) Fields added in v1.0.12

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

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

func (*OauthProviderMutation) ID added in v1.0.12

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

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

func (*OauthProviderMutation) IDs added in v1.0.12

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

func (*OauthProviderMutation) InfoURL added in v1.0.12

func (m *OauthProviderMutation) InfoURL() (r string, exists bool)

InfoURL returns the value of the "info_url" field in the mutation.

func (*OauthProviderMutation) Name added in v1.0.12

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

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

func (*OauthProviderMutation) OldAuthStyle added in v1.0.12

func (m *OauthProviderMutation) OldAuthStyle(ctx context.Context) (v uint64, err error)

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

func (*OauthProviderMutation) OldAuthURL added in v1.0.12

func (m *OauthProviderMutation) OldAuthURL(ctx context.Context) (v string, err error)

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

func (*OauthProviderMutation) OldClientID added in v1.0.12

func (m *OauthProviderMutation) OldClientID(ctx context.Context) (v string, err error)

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

func (*OauthProviderMutation) OldClientSecret added in v1.0.12

func (m *OauthProviderMutation) OldClientSecret(ctx context.Context) (v string, err error)

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

func (*OauthProviderMutation) OldCreatedAt added in v1.0.12

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

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

func (*OauthProviderMutation) OldField added in v1.0.12

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

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

func (*OauthProviderMutation) OldInfoURL added in v1.0.12

func (m *OauthProviderMutation) OldInfoURL(ctx context.Context) (v string, err error)

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

func (*OauthProviderMutation) OldName added in v1.0.12

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

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

func (*OauthProviderMutation) OldRedirectURL added in v1.0.12

func (m *OauthProviderMutation) OldRedirectURL(ctx context.Context) (v string, err error)

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

func (*OauthProviderMutation) OldScopes added in v1.0.12

func (m *OauthProviderMutation) OldScopes(ctx context.Context) (v string, err error)

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

func (*OauthProviderMutation) OldTokenURL added in v1.0.12

func (m *OauthProviderMutation) OldTokenURL(ctx context.Context) (v string, err error)

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

func (*OauthProviderMutation) OldUpdatedAt added in v1.0.12

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

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

func (*OauthProviderMutation) Op added in v1.0.12

func (m *OauthProviderMutation) Op() Op

Op returns the operation name.

func (*OauthProviderMutation) QueryContext added in v1.1.6

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

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

func (*OauthProviderMutation) RedirectURL added in v1.0.12

func (m *OauthProviderMutation) RedirectURL() (r string, exists bool)

RedirectURL returns the value of the "redirect_url" field in the mutation.

func (*OauthProviderMutation) RemovedEdges added in v1.0.12

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

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

func (*OauthProviderMutation) RemovedIDs added in v1.0.12

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

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

func (*OauthProviderMutation) ResetAuthStyle added in v1.0.12

func (m *OauthProviderMutation) ResetAuthStyle()

ResetAuthStyle resets all changes to the "auth_style" field.

func (*OauthProviderMutation) ResetAuthURL added in v1.0.12

func (m *OauthProviderMutation) ResetAuthURL()

ResetAuthURL resets all changes to the "auth_url" field.

func (*OauthProviderMutation) ResetClientID added in v1.0.12

func (m *OauthProviderMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*OauthProviderMutation) ResetClientSecret added in v1.0.12

func (m *OauthProviderMutation) ResetClientSecret()

ResetClientSecret resets all changes to the "client_secret" field.

func (*OauthProviderMutation) ResetCreatedAt added in v1.0.12

func (m *OauthProviderMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OauthProviderMutation) ResetEdge added in v1.0.12

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

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

func (*OauthProviderMutation) ResetField added in v1.0.12

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

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

func (*OauthProviderMutation) ResetInfoURL added in v1.0.12

func (m *OauthProviderMutation) ResetInfoURL()

ResetInfoURL resets all changes to the "info_url" field.

func (*OauthProviderMutation) ResetName added in v1.0.12

func (m *OauthProviderMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*OauthProviderMutation) ResetRedirectURL added in v1.0.12

func (m *OauthProviderMutation) ResetRedirectURL()

ResetRedirectURL resets all changes to the "redirect_url" field.

func (*OauthProviderMutation) ResetScopes added in v1.0.12

func (m *OauthProviderMutation) ResetScopes()

ResetScopes resets all changes to the "scopes" field.

func (*OauthProviderMutation) ResetTokenURL added in v1.0.12

func (m *OauthProviderMutation) ResetTokenURL()

ResetTokenURL resets all changes to the "token_url" field.

func (*OauthProviderMutation) ResetUpdatedAt added in v1.0.12

func (m *OauthProviderMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OauthProviderMutation) Scopes added in v1.0.12

func (m *OauthProviderMutation) Scopes() (r string, exists bool)

Scopes returns the value of the "scopes" field in the mutation.

func (*OauthProviderMutation) SetAuthStyle added in v1.0.12

func (m *OauthProviderMutation) SetAuthStyle(u uint64)

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderMutation) SetAuthURL added in v1.0.12

func (m *OauthProviderMutation) SetAuthURL(s string)

SetAuthURL sets the "auth_url" field.

func (*OauthProviderMutation) SetClientID added in v1.0.12

func (m *OauthProviderMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*OauthProviderMutation) SetClientSecret added in v1.0.12

func (m *OauthProviderMutation) SetClientSecret(s string)

SetClientSecret sets the "client_secret" field.

func (*OauthProviderMutation) SetCreatedAt added in v1.0.12

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

SetCreatedAt sets the "created_at" field.

func (*OauthProviderMutation) SetField added in v1.0.12

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

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

func (*OauthProviderMutation) SetID added in v1.0.12

func (m *OauthProviderMutation) SetID(id uint64)

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

func (*OauthProviderMutation) SetInfoURL added in v1.0.12

func (m *OauthProviderMutation) SetInfoURL(s string)

SetInfoURL sets the "info_url" field.

func (*OauthProviderMutation) SetName added in v1.0.12

func (m *OauthProviderMutation) SetName(s string)

SetName sets the "name" field.

func (*OauthProviderMutation) SetOp added in v1.0.12

func (m *OauthProviderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OauthProviderMutation) SetRedirectURL added in v1.0.12

func (m *OauthProviderMutation) SetRedirectURL(s string)

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderMutation) SetScopes added in v1.0.12

func (m *OauthProviderMutation) SetScopes(s string)

SetScopes sets the "scopes" field.

func (*OauthProviderMutation) SetTokenURL added in v1.0.12

func (m *OauthProviderMutation) SetTokenURL(s string)

SetTokenURL sets the "token_url" field.

func (*OauthProviderMutation) SetUpdatedAt added in v1.0.12

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

SetUpdatedAt sets the "updated_at" field.

func (*OauthProviderMutation) TokenURL added in v1.0.12

func (m *OauthProviderMutation) TokenURL() (r string, exists bool)

TokenURL returns the value of the "token_url" field in the mutation.

func (OauthProviderMutation) Tx added in v1.0.12

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

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

func (*OauthProviderMutation) Type added in v1.0.12

func (m *OauthProviderMutation) Type() string

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

func (*OauthProviderMutation) UpdatedAt added in v1.0.12

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

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

func (*OauthProviderMutation) Where added in v1.0.12

Where appends a list predicates to the OauthProviderMutation builder.

func (*OauthProviderMutation) WhereP added in v1.0.12

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

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

type OauthProviderPageList added in v1.0.12

type OauthProviderPageList struct {
	List        []*OauthProvider `json:"list"`
	PageDetails *PageDetails     `json:"pageDetails"`
}

OauthProviderPageList is OauthProvider PageList result.

type OauthProviderPager added in v1.0.12

type OauthProviderPager struct {
	Order  oauthprovider.OrderOption
	Filter func(*OauthProviderQuery) (*OauthProviderQuery, error)
}

func (*OauthProviderPager) ApplyFilter added in v1.0.12

type OauthProviderPaginateOption added in v1.0.12

type OauthProviderPaginateOption func(*OauthProviderPager)

OauthProviderPaginateOption enables pagination customization.

type OauthProviderQuery added in v1.0.12

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

OauthProviderQuery is the builder for querying OauthProvider entities.

func (*OauthProviderQuery) Aggregate added in v1.0.12

func (opq *OauthProviderQuery) Aggregate(fns ...AggregateFunc) *OauthProviderSelect

Aggregate returns a OauthProviderSelect configured with the given aggregations.

func (*OauthProviderQuery) All added in v1.0.12

All executes the query and returns a list of OauthProviders.

func (*OauthProviderQuery) AllX added in v1.0.12

func (opq *OauthProviderQuery) AllX(ctx context.Context) []*OauthProvider

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

func (*OauthProviderQuery) Clone added in v1.0.12

func (opq *OauthProviderQuery) Clone() *OauthProviderQuery

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

func (*OauthProviderQuery) Count added in v1.0.12

func (opq *OauthProviderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OauthProviderQuery) CountX added in v1.0.12

func (opq *OauthProviderQuery) CountX(ctx context.Context) int

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

func (*OauthProviderQuery) ExecContext added in v1.1.6

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

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

func (*OauthProviderQuery) Exist added in v1.0.12

func (opq *OauthProviderQuery) Exist(ctx context.Context) (bool, error)

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

func (*OauthProviderQuery) ExistX added in v1.0.12

func (opq *OauthProviderQuery) ExistX(ctx context.Context) bool

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

func (*OauthProviderQuery) First added in v1.0.12

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

func (*OauthProviderQuery) FirstID added in v1.0.12

func (opq *OauthProviderQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*OauthProviderQuery) FirstIDX added in v1.0.12

func (opq *OauthProviderQuery) FirstIDX(ctx context.Context) uint64

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

func (*OauthProviderQuery) FirstX added in v1.0.12

func (opq *OauthProviderQuery) FirstX(ctx context.Context) *OauthProvider

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

func (*OauthProviderQuery) GroupBy added in v1.0.12

func (opq *OauthProviderQuery) GroupBy(field string, fields ...string) *OauthProviderGroupBy

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

Example:

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

client.OauthProvider.Query().
	GroupBy(oauthprovider.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OauthProviderQuery) IDs added in v1.0.12

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

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

func (*OauthProviderQuery) IDsX added in v1.0.12

func (opq *OauthProviderQuery) IDsX(ctx context.Context) []uint64

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

func (*OauthProviderQuery) Limit added in v1.0.12

func (opq *OauthProviderQuery) Limit(limit int) *OauthProviderQuery

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

func (*OauthProviderQuery) Offset added in v1.0.12

func (opq *OauthProviderQuery) Offset(offset int) *OauthProviderQuery

Offset to start from.

func (*OauthProviderQuery) Only added in v1.0.12

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

func (*OauthProviderQuery) OnlyID added in v1.0.12

func (opq *OauthProviderQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*OauthProviderQuery) OnlyIDX added in v1.0.12

func (opq *OauthProviderQuery) OnlyIDX(ctx context.Context) uint64

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

func (*OauthProviderQuery) OnlyX added in v1.0.12

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

func (*OauthProviderQuery) Order added in v1.0.12

Order specifies how the records should be ordered.

func (*OauthProviderQuery) Page added in v1.0.12

func (op *OauthProviderQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...OauthProviderPaginateOption,
) (*OauthProviderPageList, error)

func (*OauthProviderQuery) QueryContext added in v1.1.6

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

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

func (*OauthProviderQuery) Select added in v1.0.12

func (opq *OauthProviderQuery) Select(fields ...string) *OauthProviderSelect

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

Example:

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

client.OauthProvider.Query().
	Select(oauthprovider.FieldCreatedAt).
	Scan(ctx, &v)

func (*OauthProviderQuery) Unique added in v1.0.12

func (opq *OauthProviderQuery) Unique(unique bool) *OauthProviderQuery

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

func (*OauthProviderQuery) Where added in v1.0.12

Where adds a new predicate for the OauthProviderQuery builder.

type OauthProviderSelect added in v1.0.12

type OauthProviderSelect struct {
	*OauthProviderQuery
	// contains filtered or unexported fields
}

OauthProviderSelect is the builder for selecting fields of OauthProvider entities.

func (*OauthProviderSelect) Aggregate added in v1.0.12

func (ops *OauthProviderSelect) Aggregate(fns ...AggregateFunc) *OauthProviderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OauthProviderSelect) Bool added in v1.0.12

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

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

func (*OauthProviderSelect) BoolX added in v1.0.12

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

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

func (*OauthProviderSelect) Bools added in v1.0.12

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

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

func (*OauthProviderSelect) BoolsX added in v1.0.12

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

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

func (OauthProviderSelect) ExecContext added in v1.1.6

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

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

func (*OauthProviderSelect) Float64 added in v1.0.12

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

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

func (*OauthProviderSelect) Float64X added in v1.0.12

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

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

func (*OauthProviderSelect) Float64s added in v1.0.12

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

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

func (*OauthProviderSelect) Float64sX added in v1.0.12

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

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

func (*OauthProviderSelect) Int added in v1.0.12

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

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

func (*OauthProviderSelect) IntX added in v1.0.12

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

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

func (*OauthProviderSelect) Ints added in v1.0.12

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

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

func (*OauthProviderSelect) IntsX added in v1.0.12

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

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

func (OauthProviderSelect) QueryContext added in v1.1.6

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

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

func (*OauthProviderSelect) Scan added in v1.0.12

func (ops *OauthProviderSelect) Scan(ctx context.Context, v any) error

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

func (*OauthProviderSelect) ScanX added in v1.0.12

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

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

func (*OauthProviderSelect) String added in v1.0.12

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

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

func (*OauthProviderSelect) StringX added in v1.0.12

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

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

func (*OauthProviderSelect) Strings added in v1.0.12

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

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

func (*OauthProviderSelect) StringsX added in v1.0.12

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

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

type OauthProviderUpdate added in v1.0.12

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

OauthProviderUpdate is the builder for updating OauthProvider entities.

func (*OauthProviderUpdate) AddAuthStyle added in v1.0.12

func (opu *OauthProviderUpdate) AddAuthStyle(u int64) *OauthProviderUpdate

AddAuthStyle adds u to the "auth_style" field.

func (*OauthProviderUpdate) Exec added in v1.0.12

func (opu *OauthProviderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OauthProviderUpdate) ExecContext added in v1.1.6

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

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

func (*OauthProviderUpdate) ExecX added in v1.0.12

func (opu *OauthProviderUpdate) ExecX(ctx context.Context)

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

func (*OauthProviderUpdate) Mutation added in v1.0.12

func (opu *OauthProviderUpdate) Mutation() *OauthProviderMutation

Mutation returns the OauthProviderMutation object of the builder.

func (*OauthProviderUpdate) QueryContext added in v1.1.6

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

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

func (*OauthProviderUpdate) Save added in v1.0.12

func (opu *OauthProviderUpdate) Save(ctx context.Context) (int, error)

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

func (*OauthProviderUpdate) SaveX added in v1.0.12

func (opu *OauthProviderUpdate) SaveX(ctx context.Context) int

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

func (*OauthProviderUpdate) SetAuthStyle added in v1.0.12

func (opu *OauthProviderUpdate) SetAuthStyle(u uint64) *OauthProviderUpdate

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderUpdate) SetAuthURL added in v1.0.12

func (opu *OauthProviderUpdate) SetAuthURL(s string) *OauthProviderUpdate

SetAuthURL sets the "auth_url" field.

func (*OauthProviderUpdate) SetClientID added in v1.0.12

func (opu *OauthProviderUpdate) SetClientID(s string) *OauthProviderUpdate

SetClientID sets the "client_id" field.

func (*OauthProviderUpdate) SetClientSecret added in v1.0.12

func (opu *OauthProviderUpdate) SetClientSecret(s string) *OauthProviderUpdate

SetClientSecret sets the "client_secret" field.

func (*OauthProviderUpdate) SetInfoURL added in v1.0.12

func (opu *OauthProviderUpdate) SetInfoURL(s string) *OauthProviderUpdate

SetInfoURL sets the "info_url" field.

func (*OauthProviderUpdate) SetName added in v1.0.12

SetName sets the "name" field.

func (*OauthProviderUpdate) SetNillableAuthStyle added in v1.1.9

func (opu *OauthProviderUpdate) SetNillableAuthStyle(u *uint64) *OauthProviderUpdate

SetNillableAuthStyle sets the "auth_style" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableAuthURL added in v1.1.9

func (opu *OauthProviderUpdate) SetNillableAuthURL(s *string) *OauthProviderUpdate

SetNillableAuthURL sets the "auth_url" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableClientID added in v1.1.9

func (opu *OauthProviderUpdate) SetNillableClientID(s *string) *OauthProviderUpdate

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableClientSecret added in v1.1.9

func (opu *OauthProviderUpdate) SetNillableClientSecret(s *string) *OauthProviderUpdate

SetNillableClientSecret sets the "client_secret" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableInfoURL added in v1.1.9

func (opu *OauthProviderUpdate) SetNillableInfoURL(s *string) *OauthProviderUpdate

SetNillableInfoURL sets the "info_url" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableName added in v1.1.9

func (opu *OauthProviderUpdate) SetNillableName(s *string) *OauthProviderUpdate

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

func (*OauthProviderUpdate) SetNillableRedirectURL added in v1.1.9

func (opu *OauthProviderUpdate) SetNillableRedirectURL(s *string) *OauthProviderUpdate

SetNillableRedirectURL sets the "redirect_url" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableScopes added in v1.1.9

func (opu *OauthProviderUpdate) SetNillableScopes(s *string) *OauthProviderUpdate

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OauthProviderUpdate) SetNillableTokenURL added in v1.1.9

func (opu *OauthProviderUpdate) SetNillableTokenURL(s *string) *OauthProviderUpdate

SetNillableTokenURL sets the "token_url" field if the given value is not nil.

func (*OauthProviderUpdate) SetNotNilAuthStyle added in v1.0.12

func (op *OauthProviderUpdate) SetNotNilAuthStyle(value *uint64) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilAuthURL added in v1.0.12

func (op *OauthProviderUpdate) SetNotNilAuthURL(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilClientID added in v1.0.12

func (op *OauthProviderUpdate) SetNotNilClientID(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilClientSecret added in v1.0.12

func (op *OauthProviderUpdate) SetNotNilClientSecret(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilInfoURL added in v1.0.12

func (op *OauthProviderUpdate) SetNotNilInfoURL(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilName added in v1.0.12

func (op *OauthProviderUpdate) SetNotNilName(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilRedirectURL added in v1.0.12

func (op *OauthProviderUpdate) SetNotNilRedirectURL(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilScopes added in v1.0.12

func (op *OauthProviderUpdate) SetNotNilScopes(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilTokenURL added in v1.0.12

func (op *OauthProviderUpdate) SetNotNilTokenURL(value *string) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilUpdatedAt added in v1.0.12

func (op *OauthProviderUpdate) SetNotNilUpdatedAt(value *time.Time) *OauthProviderUpdate

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetRedirectURL added in v1.0.12

func (opu *OauthProviderUpdate) SetRedirectURL(s string) *OauthProviderUpdate

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderUpdate) SetScopes added in v1.0.12

func (opu *OauthProviderUpdate) SetScopes(s string) *OauthProviderUpdate

SetScopes sets the "scopes" field.

func (*OauthProviderUpdate) SetTokenURL added in v1.0.12

func (opu *OauthProviderUpdate) SetTokenURL(s string) *OauthProviderUpdate

SetTokenURL sets the "token_url" field.

func (*OauthProviderUpdate) SetUpdatedAt added in v1.0.12

func (opu *OauthProviderUpdate) SetUpdatedAt(t time.Time) *OauthProviderUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OauthProviderUpdate) Where added in v1.0.12

Where appends a list predicates to the OauthProviderUpdate builder.

type OauthProviderUpdateOne added in v1.0.12

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

OauthProviderUpdateOne is the builder for updating a single OauthProvider entity.

func (*OauthProviderUpdateOne) AddAuthStyle added in v1.0.12

func (opuo *OauthProviderUpdateOne) AddAuthStyle(u int64) *OauthProviderUpdateOne

AddAuthStyle adds u to the "auth_style" field.

func (*OauthProviderUpdateOne) Exec added in v1.0.12

func (opuo *OauthProviderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OauthProviderUpdateOne) ExecContext added in v1.1.6

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

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

func (*OauthProviderUpdateOne) ExecX added in v1.0.12

func (opuo *OauthProviderUpdateOne) ExecX(ctx context.Context)

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

func (*OauthProviderUpdateOne) Mutation added in v1.0.12

Mutation returns the OauthProviderMutation object of the builder.

func (*OauthProviderUpdateOne) QueryContext added in v1.1.6

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

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

func (*OauthProviderUpdateOne) Save added in v1.0.12

Save executes the query and returns the updated OauthProvider entity.

func (*OauthProviderUpdateOne) SaveX added in v1.0.12

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

func (*OauthProviderUpdateOne) Select added in v1.0.12

func (opuo *OauthProviderUpdateOne) Select(field string, fields ...string) *OauthProviderUpdateOne

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

func (*OauthProviderUpdateOne) SetAuthStyle added in v1.0.12

func (opuo *OauthProviderUpdateOne) SetAuthStyle(u uint64) *OauthProviderUpdateOne

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderUpdateOne) SetAuthURL added in v1.0.12

SetAuthURL sets the "auth_url" field.

func (*OauthProviderUpdateOne) SetClientID added in v1.0.12

SetClientID sets the "client_id" field.

func (*OauthProviderUpdateOne) SetClientSecret added in v1.0.12

func (opuo *OauthProviderUpdateOne) SetClientSecret(s string) *OauthProviderUpdateOne

SetClientSecret sets the "client_secret" field.

func (*OauthProviderUpdateOne) SetInfoURL added in v1.0.12

SetInfoURL sets the "info_url" field.

func (*OauthProviderUpdateOne) SetName added in v1.0.12

SetName sets the "name" field.

func (*OauthProviderUpdateOne) SetNillableAuthStyle added in v1.1.9

func (opuo *OauthProviderUpdateOne) SetNillableAuthStyle(u *uint64) *OauthProviderUpdateOne

SetNillableAuthStyle sets the "auth_style" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableAuthURL added in v1.1.9

func (opuo *OauthProviderUpdateOne) SetNillableAuthURL(s *string) *OauthProviderUpdateOne

SetNillableAuthURL sets the "auth_url" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableClientID added in v1.1.9

func (opuo *OauthProviderUpdateOne) SetNillableClientID(s *string) *OauthProviderUpdateOne

SetNillableClientID sets the "client_id" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableClientSecret added in v1.1.9

func (opuo *OauthProviderUpdateOne) SetNillableClientSecret(s *string) *OauthProviderUpdateOne

SetNillableClientSecret sets the "client_secret" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableInfoURL added in v1.1.9

func (opuo *OauthProviderUpdateOne) SetNillableInfoURL(s *string) *OauthProviderUpdateOne

SetNillableInfoURL sets the "info_url" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableName added in v1.1.9

func (opuo *OauthProviderUpdateOne) SetNillableName(s *string) *OauthProviderUpdateOne

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

func (*OauthProviderUpdateOne) SetNillableRedirectURL added in v1.1.9

func (opuo *OauthProviderUpdateOne) SetNillableRedirectURL(s *string) *OauthProviderUpdateOne

SetNillableRedirectURL sets the "redirect_url" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableScopes added in v1.1.9

func (opuo *OauthProviderUpdateOne) SetNillableScopes(s *string) *OauthProviderUpdateOne

SetNillableScopes sets the "scopes" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNillableTokenURL added in v1.1.9

func (opuo *OauthProviderUpdateOne) SetNillableTokenURL(s *string) *OauthProviderUpdateOne

SetNillableTokenURL sets the "token_url" field if the given value is not nil.

func (*OauthProviderUpdateOne) SetNotNilAuthStyle added in v1.0.12

func (op *OauthProviderUpdateOne) SetNotNilAuthStyle(value *uint64) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilAuthURL added in v1.0.12

func (op *OauthProviderUpdateOne) SetNotNilAuthURL(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilClientID added in v1.0.12

func (op *OauthProviderUpdateOne) SetNotNilClientID(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilClientSecret added in v1.0.12

func (op *OauthProviderUpdateOne) SetNotNilClientSecret(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilInfoURL added in v1.0.12

func (op *OauthProviderUpdateOne) SetNotNilInfoURL(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilName added in v1.0.12

func (op *OauthProviderUpdateOne) SetNotNilName(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilRedirectURL added in v1.0.12

func (op *OauthProviderUpdateOne) SetNotNilRedirectURL(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilScopes added in v1.0.12

func (op *OauthProviderUpdateOne) SetNotNilScopes(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilTokenURL added in v1.0.12

func (op *OauthProviderUpdateOne) SetNotNilTokenURL(value *string) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilUpdatedAt added in v1.0.12

func (op *OauthProviderUpdateOne) SetNotNilUpdatedAt(value *time.Time) *OauthProviderUpdateOne

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetRedirectURL added in v1.0.12

func (opuo *OauthProviderUpdateOne) SetRedirectURL(s string) *OauthProviderUpdateOne

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderUpdateOne) SetScopes added in v1.0.12

SetScopes sets the "scopes" field.

func (*OauthProviderUpdateOne) SetTokenURL added in v1.0.12

SetTokenURL sets the "token_url" field.

func (*OauthProviderUpdateOne) SetUpdatedAt added in v1.0.12

func (opuo *OauthProviderUpdateOne) SetUpdatedAt(t time.Time) *OauthProviderUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*OauthProviderUpdateOne) Where added in v1.0.12

Where appends a list predicates to the OauthProviderUpdate builder.

type OauthProviders added in v1.0.12

type OauthProviders []*OauthProvider

OauthProviders is a parsable slice of OauthProvider.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection string

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

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

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type PageDetails

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

type Policy

type Policy = ent.Policy

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

type 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 Token added in v1.0.12

type Token struct {

	// ID of the ent.
	// UUID
	ID uuid.UUID `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	//  User's UUID | 用户的UUID
	UUID uuid.UUID `json:"uuid,omitempty"`
	// Token string | Token 字符串
	Token string `json:"token,omitempty"`
	// Username | 用户名
	Username string `json:"username,omitempty"`
	// Log in source such as GitHub | Token 来源 (本地为core, 第三方如github等)
	Source string `json:"source,omitempty"`
	//  Expire time | 过期时间
	ExpiredAt time.Time `json:"expired_at,omitempty"`
	// contains filtered or unexported fields
}

Token is the model entity for the Token schema.

func (*Token) ExecContext added in v1.1.6

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

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

func (*Token) QueryContext added in v1.1.6

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

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

func (*Token) String added in v1.0.12

func (t *Token) String() string

String implements the fmt.Stringer.

func (*Token) Unwrap added in v1.0.12

func (t *Token) Unwrap() *Token

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

func (*Token) Update added in v1.0.12

func (t *Token) Update() *TokenUpdateOne

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

func (*Token) Value added in v1.0.12

func (t *Token) Value(name string) (ent.Value, error)

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

type TokenClient added in v1.0.12

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

TokenClient is a client for the Token schema.

func NewTokenClient added in v1.0.12

func NewTokenClient(c config) *TokenClient

NewTokenClient returns a client for the Token from the given config.

func (*TokenClient) Create added in v1.0.12

func (c *TokenClient) Create() *TokenCreate

Create returns a builder for creating a Token entity.

func (*TokenClient) CreateBulk added in v1.0.12

func (c *TokenClient) CreateBulk(builders ...*TokenCreate) *TokenCreateBulk

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

func (*TokenClient) Delete added in v1.0.12

func (c *TokenClient) Delete() *TokenDelete

Delete returns a delete builder for Token.

func (*TokenClient) DeleteOne added in v1.0.12

func (c *TokenClient) DeleteOne(t *Token) *TokenDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TokenClient) DeleteOneID added in v1.0.12

func (c *TokenClient) DeleteOneID(id uuid.UUID) *TokenDeleteOne

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

func (*TokenClient) ExecContext added in v1.1.6

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

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

func (*TokenClient) Get added in v1.0.12

func (c *TokenClient) Get(ctx context.Context, id uuid.UUID) (*Token, error)

Get returns a Token entity by its id.

func (*TokenClient) GetX added in v1.0.12

func (c *TokenClient) GetX(ctx context.Context, id uuid.UUID) *Token

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

func (*TokenClient) Hooks added in v1.0.12

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

Hooks returns the client hooks.

func (*TokenClient) Intercept added in v1.0.12

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

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

func (*TokenClient) Interceptors added in v1.0.12

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

Interceptors returns the client interceptors.

func (*TokenClient) MapCreateBulk added in v1.1.6

func (c *TokenClient) MapCreateBulk(slice any, setFunc func(*TokenCreate, int)) *TokenCreateBulk

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

func (*TokenClient) Query added in v1.0.12

func (c *TokenClient) Query() *TokenQuery

Query returns a query builder for Token.

func (*TokenClient) QueryContext added in v1.1.6

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

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

func (*TokenClient) Update added in v1.0.12

func (c *TokenClient) Update() *TokenUpdate

Update returns an update builder for Token.

func (*TokenClient) UpdateOne added in v1.0.12

func (c *TokenClient) UpdateOne(t *Token) *TokenUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TokenClient) UpdateOneID added in v1.0.12

func (c *TokenClient) UpdateOneID(id uuid.UUID) *TokenUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TokenClient) Use added in v1.0.12

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

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

type TokenCreate added in v1.0.12

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

TokenCreate is the builder for creating a Token entity.

func (*TokenCreate) Exec added in v1.0.12

func (tc *TokenCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenCreate) ExecContext added in v1.1.6

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

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

func (*TokenCreate) ExecX added in v1.0.12

func (tc *TokenCreate) ExecX(ctx context.Context)

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

func (*TokenCreate) Mutation added in v1.0.12

func (tc *TokenCreate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenCreate) QueryContext added in v1.1.6

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

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

func (*TokenCreate) Save added in v1.0.12

func (tc *TokenCreate) Save(ctx context.Context) (*Token, error)

Save creates the Token in the database.

func (*TokenCreate) SaveX added in v1.0.12

func (tc *TokenCreate) SaveX(ctx context.Context) *Token

SaveX calls Save and panics if Save returns an error.

func (*TokenCreate) SetCreatedAt added in v1.0.12

func (tc *TokenCreate) SetCreatedAt(t time.Time) *TokenCreate

SetCreatedAt sets the "created_at" field.

func (*TokenCreate) SetExpiredAt added in v1.0.12

func (tc *TokenCreate) SetExpiredAt(t time.Time) *TokenCreate

SetExpiredAt sets the "expired_at" field.

func (*TokenCreate) SetID added in v1.0.12

func (tc *TokenCreate) SetID(u uuid.UUID) *TokenCreate

SetID sets the "id" field.

func (*TokenCreate) SetNillableCreatedAt added in v1.0.12

func (tc *TokenCreate) SetNillableCreatedAt(t *time.Time) *TokenCreate

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

func (*TokenCreate) SetNillableID added in v1.0.12

func (tc *TokenCreate) SetNillableID(u *uuid.UUID) *TokenCreate

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

func (*TokenCreate) SetNillableStatus added in v1.0.12

func (tc *TokenCreate) SetNillableStatus(u *uint8) *TokenCreate

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

func (*TokenCreate) SetNillableUpdatedAt added in v1.0.12

func (tc *TokenCreate) SetNillableUpdatedAt(t *time.Time) *TokenCreate

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

func (*TokenCreate) SetNillableUsername added in v1.2.1

func (tc *TokenCreate) SetNillableUsername(s *string) *TokenCreate

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

func (*TokenCreate) SetNotNilExpiredAt added in v1.0.12

func (t *TokenCreate) SetNotNilExpiredAt(value *time.Time) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilSource added in v1.0.12

func (t *TokenCreate) SetNotNilSource(value *string) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilStatus added in v1.0.12

func (t *TokenCreate) SetNotNilStatus(value *uint8) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilToken added in v1.0.12

func (t *TokenCreate) SetNotNilToken(value *string) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilUUID added in v1.0.12

func (t *TokenCreate) SetNotNilUUID(value *uuid.UUID) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilUpdatedAt added in v1.0.12

func (t *TokenCreate) SetNotNilUpdatedAt(value *time.Time) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilUsername added in v1.2.1

func (t *TokenCreate) SetNotNilUsername(value *string) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetSource added in v1.0.12

func (tc *TokenCreate) SetSource(s string) *TokenCreate

SetSource sets the "source" field.

func (*TokenCreate) SetStatus added in v1.0.12

func (tc *TokenCreate) SetStatus(u uint8) *TokenCreate

SetStatus sets the "status" field.

func (*TokenCreate) SetToken added in v1.0.12

func (tc *TokenCreate) SetToken(s string) *TokenCreate

SetToken sets the "token" field.

func (*TokenCreate) SetUUID added in v1.0.12

func (tc *TokenCreate) SetUUID(u uuid.UUID) *TokenCreate

SetUUID sets the "uuid" field.

func (*TokenCreate) SetUpdatedAt added in v1.0.12

func (tc *TokenCreate) SetUpdatedAt(t time.Time) *TokenCreate

SetUpdatedAt sets the "updated_at" field.

func (*TokenCreate) SetUsername added in v1.2.1

func (tc *TokenCreate) SetUsername(s string) *TokenCreate

SetUsername sets the "username" field.

type TokenCreateBulk added in v1.0.12

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

TokenCreateBulk is the builder for creating many Token entities in bulk.

func (*TokenCreateBulk) Exec added in v1.0.12

func (tcb *TokenCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenCreateBulk) ExecContext added in v1.1.6

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

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

func (*TokenCreateBulk) ExecX added in v1.0.12

func (tcb *TokenCreateBulk) ExecX(ctx context.Context)

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

func (*TokenCreateBulk) QueryContext added in v1.1.6

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

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

func (*TokenCreateBulk) Save added in v1.0.12

func (tcb *TokenCreateBulk) Save(ctx context.Context) ([]*Token, error)

Save creates the Token entities in the database.

func (*TokenCreateBulk) SaveX added in v1.0.12

func (tcb *TokenCreateBulk) SaveX(ctx context.Context) []*Token

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

type TokenDelete added in v1.0.12

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

TokenDelete is the builder for deleting a Token entity.

func (*TokenDelete) Exec added in v1.0.12

func (td *TokenDelete) Exec(ctx context.Context) (int, error)

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

func (*TokenDelete) ExecContext added in v1.1.6

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

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

func (*TokenDelete) ExecX added in v1.0.12

func (td *TokenDelete) ExecX(ctx context.Context) int

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

func (*TokenDelete) QueryContext added in v1.1.6

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

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

func (*TokenDelete) Where added in v1.0.12

func (td *TokenDelete) Where(ps ...predicate.Token) *TokenDelete

Where appends a list predicates to the TokenDelete builder.

type TokenDeleteOne added in v1.0.12

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

TokenDeleteOne is the builder for deleting a single Token entity.

func (*TokenDeleteOne) Exec added in v1.0.12

func (tdo *TokenDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TokenDeleteOne) ExecX added in v1.0.12

func (tdo *TokenDeleteOne) ExecX(ctx context.Context)

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

func (*TokenDeleteOne) Where added in v1.0.12

func (tdo *TokenDeleteOne) Where(ps ...predicate.Token) *TokenDeleteOne

Where appends a list predicates to the TokenDelete builder.

type TokenGroupBy added in v1.0.12

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

TokenGroupBy is the group-by builder for Token entities.

func (*TokenGroupBy) Aggregate added in v1.0.12

func (tgb *TokenGroupBy) Aggregate(fns ...AggregateFunc) *TokenGroupBy

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

func (*TokenGroupBy) Bool added in v1.0.12

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

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

func (*TokenGroupBy) BoolX added in v1.0.12

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

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

func (*TokenGroupBy) Bools added in v1.0.12

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

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

func (*TokenGroupBy) BoolsX added in v1.0.12

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

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

func (*TokenGroupBy) Float64 added in v1.0.12

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

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

func (*TokenGroupBy) Float64X added in v1.0.12

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

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

func (*TokenGroupBy) Float64s added in v1.0.12

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

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

func (*TokenGroupBy) Float64sX added in v1.0.12

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

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

func (*TokenGroupBy) Int added in v1.0.12

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

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

func (*TokenGroupBy) IntX added in v1.0.12

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

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

func (*TokenGroupBy) Ints added in v1.0.12

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

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

func (*TokenGroupBy) IntsX added in v1.0.12

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

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

func (*TokenGroupBy) Scan added in v1.0.12

func (tgb *TokenGroupBy) Scan(ctx context.Context, v any) error

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

func (*TokenGroupBy) ScanX added in v1.0.12

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

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

func (*TokenGroupBy) String added in v1.0.12

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

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

func (*TokenGroupBy) StringX added in v1.0.12

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

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

func (*TokenGroupBy) Strings added in v1.0.12

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

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

func (*TokenGroupBy) StringsX added in v1.0.12

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

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

type TokenMutation added in v1.0.12

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

TokenMutation represents an operation that mutates the Token nodes in the graph.

func (*TokenMutation) AddField added in v1.0.12

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

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

func (*TokenMutation) AddStatus added in v1.0.12

func (m *TokenMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*TokenMutation) AddedEdges added in v1.0.12

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

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

func (*TokenMutation) AddedField added in v1.0.12

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

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

func (*TokenMutation) AddedFields added in v1.0.12

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

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

func (*TokenMutation) AddedIDs added in v1.0.12

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

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

func (*TokenMutation) AddedStatus added in v1.0.12

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

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

func (*TokenMutation) ClearEdge added in v1.0.12

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

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

func (*TokenMutation) ClearField added in v1.0.12

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

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

func (*TokenMutation) ClearStatus added in v1.0.12

func (m *TokenMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*TokenMutation) ClearedEdges added in v1.0.12

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

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

func (*TokenMutation) ClearedFields added in v1.0.12

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

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

func (TokenMutation) Client added in v1.0.12

func (m TokenMutation) Client() *Client

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

func (*TokenMutation) CreatedAt added in v1.0.12

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

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

func (*TokenMutation) EdgeCleared added in v1.0.12

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

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

func (*TokenMutation) ExecContext added in v1.1.6

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

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

func (*TokenMutation) ExpiredAt added in v1.0.12

func (m *TokenMutation) ExpiredAt() (r time.Time, exists bool)

ExpiredAt returns the value of the "expired_at" field in the mutation.

func (*TokenMutation) Field added in v1.0.12

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

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

func (*TokenMutation) FieldCleared added in v1.0.12

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

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

func (*TokenMutation) Fields added in v1.0.12

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

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

func (*TokenMutation) ID added in v1.0.12

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

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

func (*TokenMutation) IDs added in v1.0.12

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

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

func (*TokenMutation) OldCreatedAt added in v1.0.12

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

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

func (*TokenMutation) OldExpiredAt added in v1.0.12

func (m *TokenMutation) OldExpiredAt(ctx context.Context) (v time.Time, err error)

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

func (*TokenMutation) OldField added in v1.0.12

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

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

func (*TokenMutation) OldSource added in v1.0.12

func (m *TokenMutation) OldSource(ctx context.Context) (v string, err error)

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

func (*TokenMutation) OldStatus added in v1.0.12

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

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

func (*TokenMutation) OldToken added in v1.0.12

func (m *TokenMutation) OldToken(ctx context.Context) (v string, err error)

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

func (*TokenMutation) OldUUID added in v1.0.12

func (m *TokenMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

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

func (*TokenMutation) OldUpdatedAt added in v1.0.12

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

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

func (*TokenMutation) OldUsername added in v1.2.1

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

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

func (*TokenMutation) Op added in v1.0.12

func (m *TokenMutation) Op() Op

Op returns the operation name.

func (*TokenMutation) QueryContext added in v1.1.6

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

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

func (*TokenMutation) RemovedEdges added in v1.0.12

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

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

func (*TokenMutation) RemovedIDs added in v1.0.12

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

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

func (*TokenMutation) ResetCreatedAt added in v1.0.12

func (m *TokenMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TokenMutation) ResetEdge added in v1.0.12

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

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

func (*TokenMutation) ResetExpiredAt added in v1.0.12

func (m *TokenMutation) ResetExpiredAt()

ResetExpiredAt resets all changes to the "expired_at" field.

func (*TokenMutation) ResetField added in v1.0.12

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

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

func (*TokenMutation) ResetSource added in v1.0.12

func (m *TokenMutation) ResetSource()

ResetSource resets all changes to the "source" field.

func (*TokenMutation) ResetStatus added in v1.0.12

func (m *TokenMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TokenMutation) ResetToken added in v1.0.12

func (m *TokenMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*TokenMutation) ResetUUID added in v1.0.12

func (m *TokenMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*TokenMutation) ResetUpdatedAt added in v1.0.12

func (m *TokenMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TokenMutation) ResetUsername added in v1.2.1

func (m *TokenMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*TokenMutation) SetCreatedAt added in v1.0.12

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

SetCreatedAt sets the "created_at" field.

func (*TokenMutation) SetExpiredAt added in v1.0.12

func (m *TokenMutation) SetExpiredAt(t time.Time)

SetExpiredAt sets the "expired_at" field.

func (*TokenMutation) SetField added in v1.0.12

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

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

func (*TokenMutation) SetID added in v1.0.12

func (m *TokenMutation) SetID(id uuid.UUID)

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

func (*TokenMutation) SetOp added in v1.0.12

func (m *TokenMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TokenMutation) SetSource added in v1.0.12

func (m *TokenMutation) SetSource(s string)

SetSource sets the "source" field.

func (*TokenMutation) SetStatus added in v1.0.12

func (m *TokenMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*TokenMutation) SetToken added in v1.0.12

func (m *TokenMutation) SetToken(s string)

SetToken sets the "token" field.

func (*TokenMutation) SetUUID added in v1.0.12

func (m *TokenMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (*TokenMutation) SetUpdatedAt added in v1.0.12

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

SetUpdatedAt sets the "updated_at" field.

func (*TokenMutation) SetUsername added in v1.2.1

func (m *TokenMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*TokenMutation) Source added in v1.0.12

func (m *TokenMutation) Source() (r string, exists bool)

Source returns the value of the "source" field in the mutation.

func (*TokenMutation) Status added in v1.0.12

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

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

func (*TokenMutation) StatusCleared added in v1.0.12

func (m *TokenMutation) StatusCleared() bool

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

func (*TokenMutation) Token added in v1.0.12

func (m *TokenMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (TokenMutation) Tx added in v1.0.12

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

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

func (*TokenMutation) Type added in v1.0.12

func (m *TokenMutation) Type() string

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

func (*TokenMutation) UUID added in v1.0.12

func (m *TokenMutation) UUID() (r uuid.UUID, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*TokenMutation) UpdatedAt added in v1.0.12

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

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

func (*TokenMutation) Username added in v1.2.1

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

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

func (*TokenMutation) Where added in v1.0.12

func (m *TokenMutation) Where(ps ...predicate.Token)

Where appends a list predicates to the TokenMutation builder.

func (*TokenMutation) WhereP added in v1.0.12

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

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

type TokenPageList added in v1.0.12

type TokenPageList struct {
	List        []*Token     `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

TokenPageList is Token PageList result.

type TokenPager added in v1.0.12

type TokenPager struct {
	Order  token.OrderOption
	Filter func(*TokenQuery) (*TokenQuery, error)
}

func (*TokenPager) ApplyFilter added in v1.0.12

func (p *TokenPager) ApplyFilter(query *TokenQuery) (*TokenQuery, error)

type TokenPaginateOption added in v1.0.12

type TokenPaginateOption func(*TokenPager)

TokenPaginateOption enables pagination customization.

type TokenQuery added in v1.0.12

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

TokenQuery is the builder for querying Token entities.

func (*TokenQuery) Aggregate added in v1.0.12

func (tq *TokenQuery) Aggregate(fns ...AggregateFunc) *TokenSelect

Aggregate returns a TokenSelect configured with the given aggregations.

func (*TokenQuery) All added in v1.0.12

func (tq *TokenQuery) All(ctx context.Context) ([]*Token, error)

All executes the query and returns a list of Tokens.

func (*TokenQuery) AllX added in v1.0.12

func (tq *TokenQuery) AllX(ctx context.Context) []*Token

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

func (*TokenQuery) Clone added in v1.0.12

func (tq *TokenQuery) Clone() *TokenQuery

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

func (*TokenQuery) Count added in v1.0.12

func (tq *TokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TokenQuery) CountX added in v1.0.12

func (tq *TokenQuery) CountX(ctx context.Context) int

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

func (*TokenQuery) ExecContext added in v1.1.6

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

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

func (*TokenQuery) Exist added in v1.0.12

func (tq *TokenQuery) Exist(ctx context.Context) (bool, error)

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

func (*TokenQuery) ExistX added in v1.0.12

func (tq *TokenQuery) ExistX(ctx context.Context) bool

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

func (*TokenQuery) First added in v1.0.12

func (tq *TokenQuery) First(ctx context.Context) (*Token, error)

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

func (*TokenQuery) FirstID added in v1.0.12

func (tq *TokenQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*TokenQuery) FirstIDX added in v1.0.12

func (tq *TokenQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*TokenQuery) FirstX added in v1.0.12

func (tq *TokenQuery) FirstX(ctx context.Context) *Token

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

func (*TokenQuery) GroupBy added in v1.0.12

func (tq *TokenQuery) GroupBy(field string, fields ...string) *TokenGroupBy

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

Example:

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

client.Token.Query().
	GroupBy(token.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TokenQuery) IDs added in v1.0.12

func (tq *TokenQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

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

func (*TokenQuery) IDsX added in v1.0.12

func (tq *TokenQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*TokenQuery) Limit added in v1.0.12

func (tq *TokenQuery) Limit(limit int) *TokenQuery

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

func (*TokenQuery) Offset added in v1.0.12

func (tq *TokenQuery) Offset(offset int) *TokenQuery

Offset to start from.

func (*TokenQuery) Only added in v1.0.12

func (tq *TokenQuery) Only(ctx context.Context) (*Token, error)

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

func (*TokenQuery) OnlyID added in v1.0.12

func (tq *TokenQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*TokenQuery) OnlyIDX added in v1.0.12

func (tq *TokenQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*TokenQuery) OnlyX added in v1.0.12

func (tq *TokenQuery) OnlyX(ctx context.Context) *Token

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

func (*TokenQuery) Order added in v1.0.12

func (tq *TokenQuery) Order(o ...token.OrderOption) *TokenQuery

Order specifies how the records should be ordered.

func (*TokenQuery) Page added in v1.0.12

func (t *TokenQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...TokenPaginateOption,
) (*TokenPageList, error)

func (*TokenQuery) QueryContext added in v1.1.6

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

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

func (*TokenQuery) Select added in v1.0.12

func (tq *TokenQuery) Select(fields ...string) *TokenSelect

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

Example:

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

client.Token.Query().
	Select(token.FieldCreatedAt).
	Scan(ctx, &v)

func (*TokenQuery) Unique added in v1.0.12

func (tq *TokenQuery) Unique(unique bool) *TokenQuery

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

func (*TokenQuery) Where added in v1.0.12

func (tq *TokenQuery) Where(ps ...predicate.Token) *TokenQuery

Where adds a new predicate for the TokenQuery builder.

type TokenSelect added in v1.0.12

type TokenSelect struct {
	*TokenQuery
	// contains filtered or unexported fields
}

TokenSelect is the builder for selecting fields of Token entities.

func (*TokenSelect) Aggregate added in v1.0.12

func (ts *TokenSelect) Aggregate(fns ...AggregateFunc) *TokenSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TokenSelect) Bool added in v1.0.12

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

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

func (*TokenSelect) BoolX added in v1.0.12

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

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

func (*TokenSelect) Bools added in v1.0.12

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

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

func (*TokenSelect) BoolsX added in v1.0.12

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

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

func (TokenSelect) ExecContext added in v1.1.6

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

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

func (*TokenSelect) Float64 added in v1.0.12

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

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

func (*TokenSelect) Float64X added in v1.0.12

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

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

func (*TokenSelect) Float64s added in v1.0.12

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

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

func (*TokenSelect) Float64sX added in v1.0.12

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

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

func (*TokenSelect) Int added in v1.0.12

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

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

func (*TokenSelect) IntX added in v1.0.12

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

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

func (*TokenSelect) Ints added in v1.0.12

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

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

func (*TokenSelect) IntsX added in v1.0.12

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

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

func (TokenSelect) QueryContext added in v1.1.6

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

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

func (*TokenSelect) Scan added in v1.0.12

func (ts *TokenSelect) Scan(ctx context.Context, v any) error

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

func (*TokenSelect) ScanX added in v1.0.12

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

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

func (*TokenSelect) String added in v1.0.12

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

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

func (*TokenSelect) StringX added in v1.0.12

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

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

func (*TokenSelect) Strings added in v1.0.12

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

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

func (*TokenSelect) StringsX added in v1.0.12

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

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

type TokenUpdate added in v1.0.12

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

TokenUpdate is the builder for updating Token entities.

func (*TokenUpdate) AddStatus added in v1.0.12

func (tu *TokenUpdate) AddStatus(u int8) *TokenUpdate

AddStatus adds u to the "status" field.

func (*TokenUpdate) ClearStatus added in v1.0.12

func (tu *TokenUpdate) ClearStatus() *TokenUpdate

ClearStatus clears the value of the "status" field.

func (*TokenUpdate) Exec added in v1.0.12

func (tu *TokenUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUpdate) ExecContext added in v1.1.6

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

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

func (*TokenUpdate) ExecX added in v1.0.12

func (tu *TokenUpdate) ExecX(ctx context.Context)

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

func (*TokenUpdate) Mutation added in v1.0.12

func (tu *TokenUpdate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdate) QueryContext added in v1.1.6

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

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

func (*TokenUpdate) Save added in v1.0.12

func (tu *TokenUpdate) Save(ctx context.Context) (int, error)

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

func (*TokenUpdate) SaveX added in v1.0.12

func (tu *TokenUpdate) SaveX(ctx context.Context) int

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

func (*TokenUpdate) SetExpiredAt added in v1.0.12

func (tu *TokenUpdate) SetExpiredAt(t time.Time) *TokenUpdate

SetExpiredAt sets the "expired_at" field.

func (*TokenUpdate) SetNillableExpiredAt added in v1.1.9

func (tu *TokenUpdate) SetNillableExpiredAt(t *time.Time) *TokenUpdate

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*TokenUpdate) SetNillableSource added in v1.1.9

func (tu *TokenUpdate) SetNillableSource(s *string) *TokenUpdate

SetNillableSource sets the "source" field if the given value is not nil.

func (*TokenUpdate) SetNillableStatus added in v1.0.12

func (tu *TokenUpdate) SetNillableStatus(u *uint8) *TokenUpdate

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

func (*TokenUpdate) SetNillableToken added in v1.1.9

func (tu *TokenUpdate) SetNillableToken(s *string) *TokenUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*TokenUpdate) SetNillableUUID added in v1.1.9

func (tu *TokenUpdate) SetNillableUUID(u *uuid.UUID) *TokenUpdate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*TokenUpdate) SetNillableUsername added in v1.2.1

func (tu *TokenUpdate) SetNillableUsername(s *string) *TokenUpdate

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

func (*TokenUpdate) SetNotNilExpiredAt added in v1.0.12

func (t *TokenUpdate) SetNotNilExpiredAt(value *time.Time) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilSource added in v1.0.12

func (t *TokenUpdate) SetNotNilSource(value *string) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilStatus added in v1.0.12

func (t *TokenUpdate) SetNotNilStatus(value *uint8) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilToken added in v1.0.12

func (t *TokenUpdate) SetNotNilToken(value *string) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilUUID added in v1.0.12

func (t *TokenUpdate) SetNotNilUUID(value *uuid.UUID) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilUpdatedAt added in v1.0.12

func (t *TokenUpdate) SetNotNilUpdatedAt(value *time.Time) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilUsername added in v1.2.1

func (t *TokenUpdate) SetNotNilUsername(value *string) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetSource added in v1.0.12

func (tu *TokenUpdate) SetSource(s string) *TokenUpdate

SetSource sets the "source" field.

func (*TokenUpdate) SetStatus added in v1.0.12

func (tu *TokenUpdate) SetStatus(u uint8) *TokenUpdate

SetStatus sets the "status" field.

func (*TokenUpdate) SetToken added in v1.0.12

func (tu *TokenUpdate) SetToken(s string) *TokenUpdate

SetToken sets the "token" field.

func (*TokenUpdate) SetUUID added in v1.0.12

func (tu *TokenUpdate) SetUUID(u uuid.UUID) *TokenUpdate

SetUUID sets the "uuid" field.

func (*TokenUpdate) SetUpdatedAt added in v1.0.12

func (tu *TokenUpdate) SetUpdatedAt(t time.Time) *TokenUpdate

SetUpdatedAt sets the "updated_at" field.

func (*TokenUpdate) SetUsername added in v1.2.1

func (tu *TokenUpdate) SetUsername(s string) *TokenUpdate

SetUsername sets the "username" field.

func (*TokenUpdate) Where added in v1.0.12

func (tu *TokenUpdate) Where(ps ...predicate.Token) *TokenUpdate

Where appends a list predicates to the TokenUpdate builder.

type TokenUpdateOne added in v1.0.12

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

TokenUpdateOne is the builder for updating a single Token entity.

func (*TokenUpdateOne) AddStatus added in v1.0.12

func (tuo *TokenUpdateOne) AddStatus(u int8) *TokenUpdateOne

AddStatus adds u to the "status" field.

func (*TokenUpdateOne) ClearStatus added in v1.0.12

func (tuo *TokenUpdateOne) ClearStatus() *TokenUpdateOne

ClearStatus clears the value of the "status" field.

func (*TokenUpdateOne) Exec added in v1.0.12

func (tuo *TokenUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TokenUpdateOne) ExecContext added in v1.1.6

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

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

func (*TokenUpdateOne) ExecX added in v1.0.12

func (tuo *TokenUpdateOne) ExecX(ctx context.Context)

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

func (*TokenUpdateOne) Mutation added in v1.0.12

func (tuo *TokenUpdateOne) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdateOne) QueryContext added in v1.1.6

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

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

func (*TokenUpdateOne) Save added in v1.0.12

func (tuo *TokenUpdateOne) Save(ctx context.Context) (*Token, error)

Save executes the query and returns the updated Token entity.

func (*TokenUpdateOne) SaveX added in v1.0.12

func (tuo *TokenUpdateOne) SaveX(ctx context.Context) *Token

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

func (*TokenUpdateOne) Select added in v1.0.12

func (tuo *TokenUpdateOne) Select(field string, fields ...string) *TokenUpdateOne

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

func (*TokenUpdateOne) SetExpiredAt added in v1.0.12

func (tuo *TokenUpdateOne) SetExpiredAt(t time.Time) *TokenUpdateOne

SetExpiredAt sets the "expired_at" field.

func (*TokenUpdateOne) SetNillableExpiredAt added in v1.1.9

func (tuo *TokenUpdateOne) SetNillableExpiredAt(t *time.Time) *TokenUpdateOne

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableSource added in v1.1.9

func (tuo *TokenUpdateOne) SetNillableSource(s *string) *TokenUpdateOne

SetNillableSource sets the "source" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableStatus added in v1.0.12

func (tuo *TokenUpdateOne) SetNillableStatus(u *uint8) *TokenUpdateOne

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

func (*TokenUpdateOne) SetNillableToken added in v1.1.9

func (tuo *TokenUpdateOne) SetNillableToken(s *string) *TokenUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableUUID added in v1.1.9

func (tuo *TokenUpdateOne) SetNillableUUID(u *uuid.UUID) *TokenUpdateOne

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableUsername added in v1.2.1

func (tuo *TokenUpdateOne) SetNillableUsername(s *string) *TokenUpdateOne

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

func (*TokenUpdateOne) SetNotNilExpiredAt added in v1.0.12

func (t *TokenUpdateOne) SetNotNilExpiredAt(value *time.Time) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilSource added in v1.0.12

func (t *TokenUpdateOne) SetNotNilSource(value *string) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilStatus added in v1.0.12

func (t *TokenUpdateOne) SetNotNilStatus(value *uint8) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilToken added in v1.0.12

func (t *TokenUpdateOne) SetNotNilToken(value *string) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilUUID added in v1.0.12

func (t *TokenUpdateOne) SetNotNilUUID(value *uuid.UUID) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilUpdatedAt added in v1.0.12

func (t *TokenUpdateOne) SetNotNilUpdatedAt(value *time.Time) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilUsername added in v1.2.1

func (t *TokenUpdateOne) SetNotNilUsername(value *string) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetSource added in v1.0.12

func (tuo *TokenUpdateOne) SetSource(s string) *TokenUpdateOne

SetSource sets the "source" field.

func (*TokenUpdateOne) SetStatus added in v1.0.12

func (tuo *TokenUpdateOne) SetStatus(u uint8) *TokenUpdateOne

SetStatus sets the "status" field.

func (*TokenUpdateOne) SetToken added in v1.0.12

func (tuo *TokenUpdateOne) SetToken(s string) *TokenUpdateOne

SetToken sets the "token" field.

func (*TokenUpdateOne) SetUUID added in v1.0.12

func (tuo *TokenUpdateOne) SetUUID(u uuid.UUID) *TokenUpdateOne

SetUUID sets the "uuid" field.

func (*TokenUpdateOne) SetUpdatedAt added in v1.0.12

func (tuo *TokenUpdateOne) SetUpdatedAt(t time.Time) *TokenUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*TokenUpdateOne) SetUsername added in v1.2.1

func (tuo *TokenUpdateOne) SetUsername(s string) *TokenUpdateOne

SetUsername sets the "username" field.

func (*TokenUpdateOne) Where added in v1.0.12

func (tuo *TokenUpdateOne) Where(ps ...predicate.Token) *TokenUpdateOne

Where appends a list predicates to the TokenUpdate builder.

type Tokens added in v1.0.12

type Tokens []*Token

Tokens is a parsable slice of Token.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// Member is the client for interacting with the Member builders.
	Member *MemberClient
	// MemberRank is the client for interacting with the MemberRank builders.
	MemberRank *MemberRankClient
	// OauthProvider is the client for interacting with the OauthProvider builders.
	OauthProvider *OauthProviderClient
	// Token is the client for interacting with the Token builders.
	Token *TokenClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) ExecContext added in v1.1.6

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

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

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) QueryContext added in v1.1.6

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

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

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type 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