ent

package
v1.3.14 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 26 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.
	TypeComment       = "Comment"
	TypeMember        = "Member"
	TypeMemberRank    = "MemberRank"
	TypeOauthProvider = "OauthProvider"
	TypeReply         = "Reply"
	TypeToken         = "Token"
)

Variables

View Source
var DefaultCommentOrder = Desc(comment.FieldID)

DefaultCommentOrder is the default ordering of Comment.

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 DefaultReplyOrder = Desc(reply.FieldID)

DefaultReplyOrder is the default ordering of Reply.

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
	// Comment is the client for interacting with the Comment builders.
	Comment *CommentClient
	// 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
	// Reply is the client for interacting with the Reply builders.
	Reply *ReplyClient
	// 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().
	Comment.
	Query().
	Count(ctx)

func (*Client) ExecContext

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

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 Comment added in v1.3.4

type Comment 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"`
	// 标签
	Title string `json:"title,omitempty"`
	// 正文
	Content string `json:"content,omitempty"`
	// 会员id
	MemberId string `json:"memberId,omitempty"`
	// 发布时间
	CreateTime time.Time `json:"create_time,omitempty"`
	// 更新时间
	UpdateTime time.Time `json:"update_time,omitempty"`
	// 是否已回复
	IsReply bool `json:"is_reply,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CommentQuery when eager-loading is set.
	Edges CommentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Comment is the model entity for the Comment schema.

func (*Comment) ExecContext added in v1.3.14

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

func (c *Comment) 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 (*Comment) QueryReplys added in v1.3.4

func (c *Comment) QueryReplys() *ReplyQuery

QueryReplys queries the "replys" edge of the Comment entity.

func (*Comment) String added in v1.3.4

func (c *Comment) String() string

String implements the fmt.Stringer.

func (*Comment) Unwrap added in v1.3.4

func (c *Comment) Unwrap() *Comment

Unwrap unwraps the Comment 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 (*Comment) Update added in v1.3.4

func (c *Comment) Update() *CommentUpdateOne

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

func (*Comment) Value added in v1.3.4

func (c *Comment) Value(name string) (ent.Value, error)

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

type CommentClient added in v1.3.4

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

CommentClient is a client for the Comment schema.

func NewCommentClient added in v1.3.4

func NewCommentClient(c config) *CommentClient

NewCommentClient returns a client for the Comment from the given config.

func (*CommentClient) Create added in v1.3.4

func (c *CommentClient) Create() *CommentCreate

Create returns a builder for creating a Comment entity.

func (*CommentClient) CreateBulk added in v1.3.4

func (c *CommentClient) CreateBulk(builders ...*CommentCreate) *CommentCreateBulk

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

func (*CommentClient) Delete added in v1.3.4

func (c *CommentClient) Delete() *CommentDelete

Delete returns a delete builder for Comment.

func (*CommentClient) DeleteOne added in v1.3.4

func (c *CommentClient) DeleteOne(co *Comment) *CommentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CommentClient) DeleteOneID added in v1.3.4

func (c *CommentClient) DeleteOneID(id uint64) *CommentDeleteOne

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

func (*CommentClient) ExecContext added in v1.3.14

func (c *CommentClient) 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 (*CommentClient) Get added in v1.3.4

func (c *CommentClient) Get(ctx context.Context, id uint64) (*Comment, error)

Get returns a Comment entity by its id.

func (*CommentClient) GetX added in v1.3.4

func (c *CommentClient) GetX(ctx context.Context, id uint64) *Comment

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

func (*CommentClient) Hooks added in v1.3.4

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

Hooks returns the client hooks.

func (*CommentClient) Intercept added in v1.3.4

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

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

func (*CommentClient) Interceptors added in v1.3.4

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

Interceptors returns the client interceptors.

func (*CommentClient) MapCreateBulk added in v1.3.4

func (c *CommentClient) MapCreateBulk(slice any, setFunc func(*CommentCreate, int)) *CommentCreateBulk

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 (*CommentClient) Query added in v1.3.4

func (c *CommentClient) Query() *CommentQuery

Query returns a query builder for Comment.

func (*CommentClient) QueryContext added in v1.3.14

func (c *CommentClient) 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 (*CommentClient) QueryReplys added in v1.3.4

func (c *CommentClient) QueryReplys(co *Comment) *ReplyQuery

QueryReplys queries the replys edge of a Comment.

func (*CommentClient) Update added in v1.3.4

func (c *CommentClient) Update() *CommentUpdate

Update returns an update builder for Comment.

func (*CommentClient) UpdateOne added in v1.3.4

func (c *CommentClient) UpdateOne(co *Comment) *CommentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CommentClient) UpdateOneID added in v1.3.4

func (c *CommentClient) UpdateOneID(id uint64) *CommentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CommentClient) Use added in v1.3.4

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

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

type CommentCreate added in v1.3.4

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

CommentCreate is the builder for creating a Comment entity.

func (*CommentCreate) AddReplyIDs added in v1.3.4

func (cc *CommentCreate) AddReplyIDs(ids ...uint64) *CommentCreate

AddReplyIDs adds the "replys" edge to the Reply entity by IDs.

func (*CommentCreate) AddReplys added in v1.3.4

func (cc *CommentCreate) AddReplys(r ...*Reply) *CommentCreate

AddReplys adds the "replys" edges to the Reply entity.

func (*CommentCreate) Exec added in v1.3.4

func (cc *CommentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentCreate) ExecContext added in v1.3.14

func (c *CommentCreate) 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 (*CommentCreate) ExecX added in v1.3.4

func (cc *CommentCreate) ExecX(ctx context.Context)

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

func (*CommentCreate) Mutation added in v1.3.4

func (cc *CommentCreate) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentCreate) QueryContext added in v1.3.14

func (c *CommentCreate) 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 (*CommentCreate) Save added in v1.3.4

func (cc *CommentCreate) Save(ctx context.Context) (*Comment, error)

Save creates the Comment in the database.

func (*CommentCreate) SaveX added in v1.3.4

func (cc *CommentCreate) SaveX(ctx context.Context) *Comment

SaveX calls Save and panics if Save returns an error.

func (*CommentCreate) SetContent added in v1.3.4

func (cc *CommentCreate) SetContent(s string) *CommentCreate

SetContent sets the "content" field.

func (*CommentCreate) SetCreateTime added in v1.3.4

func (cc *CommentCreate) SetCreateTime(t time.Time) *CommentCreate

SetCreateTime sets the "create_time" field.

func (*CommentCreate) SetCreatedAt added in v1.3.4

func (cc *CommentCreate) SetCreatedAt(t time.Time) *CommentCreate

SetCreatedAt sets the "created_at" field.

func (*CommentCreate) SetID added in v1.3.4

func (cc *CommentCreate) SetID(u uint64) *CommentCreate

SetID sets the "id" field.

func (*CommentCreate) SetIsReply added in v1.3.4

func (cc *CommentCreate) SetIsReply(b bool) *CommentCreate

SetIsReply sets the "is_reply" field.

func (*CommentCreate) SetMemberId added in v1.3.4

func (cc *CommentCreate) SetMemberId(s string) *CommentCreate

SetMemberId sets the "memberId" field.

func (*CommentCreate) SetNillableContent added in v1.3.4

func (cc *CommentCreate) SetNillableContent(s *string) *CommentCreate

SetNillableContent sets the "content" field if the given value is not nil.

func (*CommentCreate) SetNillableCreateTime added in v1.3.4

func (cc *CommentCreate) SetNillableCreateTime(t *time.Time) *CommentCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CommentCreate) SetNillableCreatedAt added in v1.3.4

func (cc *CommentCreate) SetNillableCreatedAt(t *time.Time) *CommentCreate

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

func (*CommentCreate) SetNillableIsReply added in v1.3.4

func (cc *CommentCreate) SetNillableIsReply(b *bool) *CommentCreate

SetNillableIsReply sets the "is_reply" field if the given value is not nil.

func (*CommentCreate) SetNillableTitle added in v1.3.4

func (cc *CommentCreate) SetNillableTitle(s *string) *CommentCreate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*CommentCreate) SetNillableUpdateTime added in v1.3.4

func (cc *CommentCreate) SetNillableUpdateTime(t *time.Time) *CommentCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*CommentCreate) SetNillableUpdatedAt added in v1.3.4

func (cc *CommentCreate) SetNillableUpdatedAt(t *time.Time) *CommentCreate

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

func (*CommentCreate) SetNotNilContent added in v1.3.14

func (c *CommentCreate) SetNotNilContent(value *string) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilCreateTime added in v1.3.14

func (c *CommentCreate) SetNotNilCreateTime(value *time.Time) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilIsReply added in v1.3.14

func (c *CommentCreate) SetNotNilIsReply(value *bool) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilMemberId added in v1.3.14

func (c *CommentCreate) SetNotNilMemberId(value *string) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilTitle added in v1.3.14

func (c *CommentCreate) SetNotNilTitle(value *string) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilUpdateTime added in v1.3.14

func (c *CommentCreate) SetNotNilUpdateTime(value *time.Time) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetNotNilUpdatedAt added in v1.3.14

func (c *CommentCreate) SetNotNilUpdatedAt(value *time.Time) *CommentCreate

set field if value's pointer is not nil.

func (*CommentCreate) SetTitle added in v1.3.4

func (cc *CommentCreate) SetTitle(s string) *CommentCreate

SetTitle sets the "title" field.

func (*CommentCreate) SetUpdateTime added in v1.3.4

func (cc *CommentCreate) SetUpdateTime(t time.Time) *CommentCreate

SetUpdateTime sets the "update_time" field.

func (*CommentCreate) SetUpdatedAt added in v1.3.4

func (cc *CommentCreate) SetUpdatedAt(t time.Time) *CommentCreate

SetUpdatedAt sets the "updated_at" field.

type CommentCreateBulk added in v1.3.4

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

CommentCreateBulk is the builder for creating many Comment entities in bulk.

func (*CommentCreateBulk) Exec added in v1.3.4

func (ccb *CommentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentCreateBulk) ExecContext added in v1.3.14

func (c *CommentCreateBulk) 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 (*CommentCreateBulk) ExecX added in v1.3.4

func (ccb *CommentCreateBulk) ExecX(ctx context.Context)

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

func (*CommentCreateBulk) QueryContext added in v1.3.14

func (c *CommentCreateBulk) 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 (*CommentCreateBulk) Save added in v1.3.4

func (ccb *CommentCreateBulk) Save(ctx context.Context) ([]*Comment, error)

Save creates the Comment entities in the database.

func (*CommentCreateBulk) SaveX added in v1.3.4

func (ccb *CommentCreateBulk) SaveX(ctx context.Context) []*Comment

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

type CommentDelete added in v1.3.4

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

CommentDelete is the builder for deleting a Comment entity.

func (*CommentDelete) Exec added in v1.3.4

func (cd *CommentDelete) Exec(ctx context.Context) (int, error)

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

func (*CommentDelete) ExecContext added in v1.3.14

func (c *CommentDelete) 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 (*CommentDelete) ExecX added in v1.3.4

func (cd *CommentDelete) ExecX(ctx context.Context) int

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

func (*CommentDelete) QueryContext added in v1.3.14

func (c *CommentDelete) 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 (*CommentDelete) Where added in v1.3.4

func (cd *CommentDelete) Where(ps ...predicate.Comment) *CommentDelete

Where appends a list predicates to the CommentDelete builder.

type CommentDeleteOne added in v1.3.4

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

CommentDeleteOne is the builder for deleting a single Comment entity.

func (*CommentDeleteOne) Exec added in v1.3.4

func (cdo *CommentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CommentDeleteOne) ExecX added in v1.3.4

func (cdo *CommentDeleteOne) ExecX(ctx context.Context)

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

func (*CommentDeleteOne) Where added in v1.3.4

Where appends a list predicates to the CommentDelete builder.

type CommentEdges added in v1.3.4

type CommentEdges struct {
	// Replys holds the value of the replys edge.
	Replys []*Reply `json:"replys,omitempty"`
	// contains filtered or unexported fields
}

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

func (CommentEdges) ReplysOrErr added in v1.3.4

func (e CommentEdges) ReplysOrErr() ([]*Reply, error)

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

type CommentGroupBy added in v1.3.4

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

CommentGroupBy is the group-by builder for Comment entities.

func (*CommentGroupBy) Aggregate added in v1.3.4

func (cgb *CommentGroupBy) Aggregate(fns ...AggregateFunc) *CommentGroupBy

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

func (*CommentGroupBy) Bool added in v1.3.4

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

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

func (*CommentGroupBy) BoolX added in v1.3.4

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

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

func (*CommentGroupBy) Bools added in v1.3.4

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

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

func (*CommentGroupBy) BoolsX added in v1.3.4

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

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

func (*CommentGroupBy) Float64 added in v1.3.4

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

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

func (*CommentGroupBy) Float64X added in v1.3.4

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

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

func (*CommentGroupBy) Float64s added in v1.3.4

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

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

func (*CommentGroupBy) Float64sX added in v1.3.4

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

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

func (*CommentGroupBy) Int added in v1.3.4

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

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

func (*CommentGroupBy) IntX added in v1.3.4

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

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

func (*CommentGroupBy) Ints added in v1.3.4

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

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

func (*CommentGroupBy) IntsX added in v1.3.4

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

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

func (*CommentGroupBy) Scan added in v1.3.4

func (cgb *CommentGroupBy) Scan(ctx context.Context, v any) error

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

func (*CommentGroupBy) ScanX added in v1.3.4

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

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

func (*CommentGroupBy) String added in v1.3.4

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

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

func (*CommentGroupBy) StringX added in v1.3.4

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

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

func (*CommentGroupBy) Strings added in v1.3.4

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

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

func (*CommentGroupBy) StringsX added in v1.3.4

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

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

type CommentMutation added in v1.3.4

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

CommentMutation represents an operation that mutates the Comment nodes in the graph.

func (*CommentMutation) AddField added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) AddReplyIDs added in v1.3.4

func (m *CommentMutation) AddReplyIDs(ids ...uint64)

AddReplyIDs adds the "replys" edge to the Reply entity by ids.

func (*CommentMutation) AddedEdges added in v1.3.4

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

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

func (*CommentMutation) AddedField added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) AddedFields added in v1.3.4

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

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

func (*CommentMutation) AddedIDs added in v1.3.4

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

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

func (*CommentMutation) ClearContent added in v1.3.4

func (m *CommentMutation) ClearContent()

ClearContent clears the value of the "content" field.

func (*CommentMutation) ClearEdge added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) ClearField added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) ClearReplys added in v1.3.4

func (m *CommentMutation) ClearReplys()

ClearReplys clears the "replys" edge to the Reply entity.

func (*CommentMutation) ClearTitle added in v1.3.4

func (m *CommentMutation) ClearTitle()

ClearTitle clears the value of the "title" field.

func (*CommentMutation) ClearedEdges added in v1.3.4

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

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

func (*CommentMutation) ClearedFields added in v1.3.4

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

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

func (CommentMutation) Client added in v1.3.4

func (m CommentMutation) 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 (*CommentMutation) Content added in v1.3.4

func (m *CommentMutation) Content() (r string, exists bool)

Content returns the value of the "content" field in the mutation.

func (*CommentMutation) ContentCleared added in v1.3.4

func (m *CommentMutation) ContentCleared() bool

ContentCleared returns if the "content" field was cleared in this mutation.

func (*CommentMutation) CreateTime added in v1.3.4

func (m *CommentMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*CommentMutation) CreatedAt added in v1.3.4

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

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

func (*CommentMutation) EdgeCleared added in v1.3.4

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

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

func (*CommentMutation) ExecContext added in v1.3.14

func (c *CommentMutation) 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 (*CommentMutation) Field added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) FieldCleared added in v1.3.4

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

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

func (*CommentMutation) Fields added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) ID added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) IDs added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) IsReply added in v1.3.4

func (m *CommentMutation) IsReply() (r bool, exists bool)

IsReply returns the value of the "is_reply" field in the mutation.

func (*CommentMutation) MemberId added in v1.3.4

func (m *CommentMutation) MemberId() (r string, exists bool)

MemberId returns the value of the "memberId" field in the mutation.

func (*CommentMutation) OldContent added in v1.3.4

func (m *CommentMutation) OldContent(ctx context.Context) (v string, err error)

OldContent returns the old "content" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldCreateTime added in v1.3.4

func (m *CommentMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldCreatedAt added in v1.3.4

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

OldCreatedAt returns the old "created_at" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldField added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) OldIsReply added in v1.3.4

func (m *CommentMutation) OldIsReply(ctx context.Context) (v bool, err error)

OldIsReply returns the old "is_reply" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldMemberId added in v1.3.4

func (m *CommentMutation) OldMemberId(ctx context.Context) (v string, err error)

OldMemberId returns the old "memberId" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldTitle added in v1.3.4

func (m *CommentMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldUpdateTime added in v1.3.4

func (m *CommentMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Comment entity. If the Comment 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 (*CommentMutation) OldUpdatedAt added in v1.3.4

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

OldUpdatedAt returns the old "updated_at" field's value of the Comment entity. If the Comment 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 (*CommentMutation) Op added in v1.3.4

func (m *CommentMutation) Op() Op

Op returns the operation name.

func (*CommentMutation) QueryContext added in v1.3.14

func (c *CommentMutation) 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 (*CommentMutation) RemoveReplyIDs added in v1.3.4

func (m *CommentMutation) RemoveReplyIDs(ids ...uint64)

RemoveReplyIDs removes the "replys" edge to the Reply entity by IDs.

func (*CommentMutation) RemovedEdges added in v1.3.4

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

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

func (*CommentMutation) RemovedIDs added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) RemovedReplysIDs added in v1.3.4

func (m *CommentMutation) RemovedReplysIDs() (ids []uint64)

RemovedReplys returns the removed IDs of the "replys" edge to the Reply entity.

func (*CommentMutation) ReplysCleared added in v1.3.4

func (m *CommentMutation) ReplysCleared() bool

ReplysCleared reports if the "replys" edge to the Reply entity was cleared.

func (*CommentMutation) ReplysIDs added in v1.3.4

func (m *CommentMutation) ReplysIDs() (ids []uint64)

ReplysIDs returns the "replys" edge IDs in the mutation.

func (*CommentMutation) ResetContent added in v1.3.4

func (m *CommentMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*CommentMutation) ResetCreateTime added in v1.3.4

func (m *CommentMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*CommentMutation) ResetCreatedAt added in v1.3.4

func (m *CommentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CommentMutation) ResetEdge added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) ResetField added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) ResetIsReply added in v1.3.4

func (m *CommentMutation) ResetIsReply()

ResetIsReply resets all changes to the "is_reply" field.

func (*CommentMutation) ResetMemberId added in v1.3.4

func (m *CommentMutation) ResetMemberId()

ResetMemberId resets all changes to the "memberId" field.

func (*CommentMutation) ResetReplys added in v1.3.4

func (m *CommentMutation) ResetReplys()

ResetReplys resets all changes to the "replys" edge.

func (*CommentMutation) ResetTitle added in v1.3.4

func (m *CommentMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*CommentMutation) ResetUpdateTime added in v1.3.4

func (m *CommentMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*CommentMutation) ResetUpdatedAt added in v1.3.4

func (m *CommentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CommentMutation) SetContent added in v1.3.4

func (m *CommentMutation) SetContent(s string)

SetContent sets the "content" field.

func (*CommentMutation) SetCreateTime added in v1.3.4

func (m *CommentMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*CommentMutation) SetCreatedAt added in v1.3.4

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

SetCreatedAt sets the "created_at" field.

func (*CommentMutation) SetField added in v1.3.4

func (m *CommentMutation) 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 (*CommentMutation) SetID added in v1.3.4

func (m *CommentMutation) SetID(id uint64)

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

func (*CommentMutation) SetIsReply added in v1.3.4

func (m *CommentMutation) SetIsReply(b bool)

SetIsReply sets the "is_reply" field.

func (*CommentMutation) SetMemberId added in v1.3.4

func (m *CommentMutation) SetMemberId(s string)

SetMemberId sets the "memberId" field.

func (*CommentMutation) SetOp added in v1.3.4

func (m *CommentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CommentMutation) SetTitle added in v1.3.4

func (m *CommentMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*CommentMutation) SetUpdateTime added in v1.3.4

func (m *CommentMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*CommentMutation) SetUpdatedAt added in v1.3.4

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

SetUpdatedAt sets the "updated_at" field.

func (*CommentMutation) Title added in v1.3.4

func (m *CommentMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (*CommentMutation) TitleCleared added in v1.3.4

func (m *CommentMutation) TitleCleared() bool

TitleCleared returns if the "title" field was cleared in this mutation.

func (CommentMutation) Tx added in v1.3.4

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

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

func (*CommentMutation) Type added in v1.3.4

func (m *CommentMutation) Type() string

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

func (*CommentMutation) UpdateTime added in v1.3.4

func (m *CommentMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*CommentMutation) UpdatedAt added in v1.3.4

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

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

func (*CommentMutation) Where added in v1.3.4

func (m *CommentMutation) Where(ps ...predicate.Comment)

Where appends a list predicates to the CommentMutation builder.

func (*CommentMutation) WhereP added in v1.3.4

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

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

type CommentPageList added in v1.3.14

type CommentPageList struct {
	List        []*Comment   `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

CommentPageList is Comment PageList result.

type CommentPager added in v1.3.14

type CommentPager struct {
	Order  comment.OrderOption
	Filter func(*CommentQuery) (*CommentQuery, error)
}

func (*CommentPager) ApplyFilter added in v1.3.14

func (p *CommentPager) ApplyFilter(query *CommentQuery) (*CommentQuery, error)

type CommentPaginateOption added in v1.3.14

type CommentPaginateOption func(*CommentPager)

CommentPaginateOption enables pagination customization.

type CommentQuery added in v1.3.4

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

CommentQuery is the builder for querying Comment entities.

func (*CommentQuery) Aggregate added in v1.3.4

func (cq *CommentQuery) Aggregate(fns ...AggregateFunc) *CommentSelect

Aggregate returns a CommentSelect configured with the given aggregations.

func (*CommentQuery) All added in v1.3.4

func (cq *CommentQuery) All(ctx context.Context) ([]*Comment, error)

All executes the query and returns a list of Comments.

func (*CommentQuery) AllX added in v1.3.4

func (cq *CommentQuery) AllX(ctx context.Context) []*Comment

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

func (*CommentQuery) Clone added in v1.3.4

func (cq *CommentQuery) Clone() *CommentQuery

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

func (*CommentQuery) Count added in v1.3.4

func (cq *CommentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CommentQuery) CountX added in v1.3.4

func (cq *CommentQuery) CountX(ctx context.Context) int

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

func (*CommentQuery) ExecContext added in v1.3.14

func (c *CommentQuery) 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 (*CommentQuery) Exist added in v1.3.4

func (cq *CommentQuery) Exist(ctx context.Context) (bool, error)

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

func (*CommentQuery) ExistX added in v1.3.4

func (cq *CommentQuery) ExistX(ctx context.Context) bool

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

func (*CommentQuery) First added in v1.3.4

func (cq *CommentQuery) First(ctx context.Context) (*Comment, error)

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

func (*CommentQuery) FirstID added in v1.3.4

func (cq *CommentQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*CommentQuery) FirstIDX added in v1.3.4

func (cq *CommentQuery) FirstIDX(ctx context.Context) uint64

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

func (*CommentQuery) FirstX added in v1.3.4

func (cq *CommentQuery) FirstX(ctx context.Context) *Comment

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

func (*CommentQuery) GroupBy added in v1.3.4

func (cq *CommentQuery) GroupBy(field string, fields ...string) *CommentGroupBy

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

func (*CommentQuery) IDs added in v1.3.4

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

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

func (*CommentQuery) IDsX added in v1.3.4

func (cq *CommentQuery) IDsX(ctx context.Context) []uint64

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

func (*CommentQuery) Limit added in v1.3.4

func (cq *CommentQuery) Limit(limit int) *CommentQuery

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

func (*CommentQuery) Offset added in v1.3.4

func (cq *CommentQuery) Offset(offset int) *CommentQuery

Offset to start from.

func (*CommentQuery) Only added in v1.3.4

func (cq *CommentQuery) Only(ctx context.Context) (*Comment, error)

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

func (*CommentQuery) OnlyID added in v1.3.4

func (cq *CommentQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*CommentQuery) OnlyIDX added in v1.3.4

func (cq *CommentQuery) OnlyIDX(ctx context.Context) uint64

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

func (*CommentQuery) OnlyX added in v1.3.4

func (cq *CommentQuery) OnlyX(ctx context.Context) *Comment

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

func (*CommentQuery) Order added in v1.3.4

func (cq *CommentQuery) Order(o ...comment.OrderOption) *CommentQuery

Order specifies how the records should be ordered.

func (*CommentQuery) Page added in v1.3.14

func (c *CommentQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...CommentPaginateOption,
) (*CommentPageList, error)

func (*CommentQuery) QueryContext added in v1.3.14

func (c *CommentQuery) 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 (*CommentQuery) QueryReplys added in v1.3.4

func (cq *CommentQuery) QueryReplys() *ReplyQuery

QueryReplys chains the current query on the "replys" edge.

func (*CommentQuery) Select added in v1.3.4

func (cq *CommentQuery) Select(fields ...string) *CommentSelect

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

func (*CommentQuery) Unique added in v1.3.4

func (cq *CommentQuery) Unique(unique bool) *CommentQuery

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 (*CommentQuery) Where added in v1.3.4

func (cq *CommentQuery) Where(ps ...predicate.Comment) *CommentQuery

Where adds a new predicate for the CommentQuery builder.

func (*CommentQuery) WithReplys added in v1.3.4

func (cq *CommentQuery) WithReplys(opts ...func(*ReplyQuery)) *CommentQuery

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

type CommentSelect added in v1.3.4

type CommentSelect struct {
	*CommentQuery
	// contains filtered or unexported fields
}

CommentSelect is the builder for selecting fields of Comment entities.

func (*CommentSelect) Aggregate added in v1.3.4

func (cs *CommentSelect) Aggregate(fns ...AggregateFunc) *CommentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CommentSelect) Bool added in v1.3.4

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

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

func (*CommentSelect) BoolX added in v1.3.4

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

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

func (*CommentSelect) Bools added in v1.3.4

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

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

func (*CommentSelect) BoolsX added in v1.3.4

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

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

func (CommentSelect) ExecContext added in v1.3.14

func (c CommentSelect) 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 (*CommentSelect) Float64 added in v1.3.4

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

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

func (*CommentSelect) Float64X added in v1.3.4

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

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

func (*CommentSelect) Float64s added in v1.3.4

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

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

func (*CommentSelect) Float64sX added in v1.3.4

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

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

func (*CommentSelect) Int added in v1.3.4

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

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

func (*CommentSelect) IntX added in v1.3.4

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

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

func (*CommentSelect) Ints added in v1.3.4

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

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

func (*CommentSelect) IntsX added in v1.3.4

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

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

func (CommentSelect) QueryContext added in v1.3.14

func (c CommentSelect) 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 (*CommentSelect) Scan added in v1.3.4

func (cs *CommentSelect) Scan(ctx context.Context, v any) error

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

func (*CommentSelect) ScanX added in v1.3.4

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

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

func (*CommentSelect) String added in v1.3.4

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

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

func (*CommentSelect) StringX added in v1.3.4

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

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

func (*CommentSelect) Strings added in v1.3.4

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

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

func (*CommentSelect) StringsX added in v1.3.4

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

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

type CommentUpdate added in v1.3.4

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

CommentUpdate is the builder for updating Comment entities.

func (*CommentUpdate) AddReplyIDs added in v1.3.4

func (cu *CommentUpdate) AddReplyIDs(ids ...uint64) *CommentUpdate

AddReplyIDs adds the "replys" edge to the Reply entity by IDs.

func (*CommentUpdate) AddReplys added in v1.3.4

func (cu *CommentUpdate) AddReplys(r ...*Reply) *CommentUpdate

AddReplys adds the "replys" edges to the Reply entity.

func (*CommentUpdate) ClearContent added in v1.3.4

func (cu *CommentUpdate) ClearContent() *CommentUpdate

ClearContent clears the value of the "content" field.

func (*CommentUpdate) ClearReplys added in v1.3.4

func (cu *CommentUpdate) ClearReplys() *CommentUpdate

ClearReplys clears all "replys" edges to the Reply entity.

func (*CommentUpdate) ClearTitle added in v1.3.4

func (cu *CommentUpdate) ClearTitle() *CommentUpdate

ClearTitle clears the value of the "title" field.

func (*CommentUpdate) Exec added in v1.3.4

func (cu *CommentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CommentUpdate) ExecContext added in v1.3.14

func (c *CommentUpdate) 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 (*CommentUpdate) ExecX added in v1.3.4

func (cu *CommentUpdate) ExecX(ctx context.Context)

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

func (*CommentUpdate) Mutation added in v1.3.4

func (cu *CommentUpdate) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentUpdate) QueryContext added in v1.3.14

func (c *CommentUpdate) 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 (*CommentUpdate) RemoveReplyIDs added in v1.3.4

func (cu *CommentUpdate) RemoveReplyIDs(ids ...uint64) *CommentUpdate

RemoveReplyIDs removes the "replys" edge to Reply entities by IDs.

func (*CommentUpdate) RemoveReplys added in v1.3.4

func (cu *CommentUpdate) RemoveReplys(r ...*Reply) *CommentUpdate

RemoveReplys removes "replys" edges to Reply entities.

func (*CommentUpdate) Save added in v1.3.4

func (cu *CommentUpdate) Save(ctx context.Context) (int, error)

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

func (*CommentUpdate) SaveX added in v1.3.4

func (cu *CommentUpdate) SaveX(ctx context.Context) int

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

func (*CommentUpdate) SetContent added in v1.3.4

func (cu *CommentUpdate) SetContent(s string) *CommentUpdate

SetContent sets the "content" field.

func (*CommentUpdate) SetCreateTime added in v1.3.4

func (cu *CommentUpdate) SetCreateTime(t time.Time) *CommentUpdate

SetCreateTime sets the "create_time" field.

func (*CommentUpdate) SetIsReply added in v1.3.4

func (cu *CommentUpdate) SetIsReply(b bool) *CommentUpdate

SetIsReply sets the "is_reply" field.

func (*CommentUpdate) SetMemberId added in v1.3.4

func (cu *CommentUpdate) SetMemberId(s string) *CommentUpdate

SetMemberId sets the "memberId" field.

func (*CommentUpdate) SetNillableContent added in v1.3.4

func (cu *CommentUpdate) SetNillableContent(s *string) *CommentUpdate

SetNillableContent sets the "content" field if the given value is not nil.

func (*CommentUpdate) SetNillableCreateTime added in v1.3.4

func (cu *CommentUpdate) SetNillableCreateTime(t *time.Time) *CommentUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CommentUpdate) SetNillableIsReply added in v1.3.4

func (cu *CommentUpdate) SetNillableIsReply(b *bool) *CommentUpdate

SetNillableIsReply sets the "is_reply" field if the given value is not nil.

func (*CommentUpdate) SetNillableMemberId added in v1.3.4

func (cu *CommentUpdate) SetNillableMemberId(s *string) *CommentUpdate

SetNillableMemberId sets the "memberId" field if the given value is not nil.

func (*CommentUpdate) SetNillableTitle added in v1.3.4

func (cu *CommentUpdate) SetNillableTitle(s *string) *CommentUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*CommentUpdate) SetNillableUpdateTime added in v1.3.4

func (cu *CommentUpdate) SetNillableUpdateTime(t *time.Time) *CommentUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*CommentUpdate) SetNotNilContent added in v1.3.14

func (c *CommentUpdate) SetNotNilContent(value *string) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilCreateTime added in v1.3.14

func (c *CommentUpdate) SetNotNilCreateTime(value *time.Time) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilIsReply added in v1.3.14

func (c *CommentUpdate) SetNotNilIsReply(value *bool) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilMemberId added in v1.3.14

func (c *CommentUpdate) SetNotNilMemberId(value *string) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilTitle added in v1.3.14

func (c *CommentUpdate) SetNotNilTitle(value *string) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilUpdateTime added in v1.3.14

func (c *CommentUpdate) SetNotNilUpdateTime(value *time.Time) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetNotNilUpdatedAt added in v1.3.14

func (c *CommentUpdate) SetNotNilUpdatedAt(value *time.Time) *CommentUpdate

set field if value's pointer is not nil.

func (*CommentUpdate) SetTitle added in v1.3.4

func (cu *CommentUpdate) SetTitle(s string) *CommentUpdate

SetTitle sets the "title" field.

func (*CommentUpdate) SetUpdateTime added in v1.3.4

func (cu *CommentUpdate) SetUpdateTime(t time.Time) *CommentUpdate

SetUpdateTime sets the "update_time" field.

func (*CommentUpdate) SetUpdatedAt added in v1.3.4

func (cu *CommentUpdate) SetUpdatedAt(t time.Time) *CommentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CommentUpdate) Where added in v1.3.4

func (cu *CommentUpdate) Where(ps ...predicate.Comment) *CommentUpdate

Where appends a list predicates to the CommentUpdate builder.

type CommentUpdateOne added in v1.3.4

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

CommentUpdateOne is the builder for updating a single Comment entity.

func (*CommentUpdateOne) AddReplyIDs added in v1.3.4

func (cuo *CommentUpdateOne) AddReplyIDs(ids ...uint64) *CommentUpdateOne

AddReplyIDs adds the "replys" edge to the Reply entity by IDs.

func (*CommentUpdateOne) AddReplys added in v1.3.4

func (cuo *CommentUpdateOne) AddReplys(r ...*Reply) *CommentUpdateOne

AddReplys adds the "replys" edges to the Reply entity.

func (*CommentUpdateOne) ClearContent added in v1.3.4

func (cuo *CommentUpdateOne) ClearContent() *CommentUpdateOne

ClearContent clears the value of the "content" field.

func (*CommentUpdateOne) ClearReplys added in v1.3.4

func (cuo *CommentUpdateOne) ClearReplys() *CommentUpdateOne

ClearReplys clears all "replys" edges to the Reply entity.

func (*CommentUpdateOne) ClearTitle added in v1.3.4

func (cuo *CommentUpdateOne) ClearTitle() *CommentUpdateOne

ClearTitle clears the value of the "title" field.

func (*CommentUpdateOne) Exec added in v1.3.4

func (cuo *CommentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CommentUpdateOne) ExecContext added in v1.3.14

func (c *CommentUpdateOne) 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 (*CommentUpdateOne) ExecX added in v1.3.4

func (cuo *CommentUpdateOne) ExecX(ctx context.Context)

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

func (*CommentUpdateOne) Mutation added in v1.3.4

func (cuo *CommentUpdateOne) Mutation() *CommentMutation

Mutation returns the CommentMutation object of the builder.

func (*CommentUpdateOne) QueryContext added in v1.3.14

func (c *CommentUpdateOne) 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 (*CommentUpdateOne) RemoveReplyIDs added in v1.3.4

func (cuo *CommentUpdateOne) RemoveReplyIDs(ids ...uint64) *CommentUpdateOne

RemoveReplyIDs removes the "replys" edge to Reply entities by IDs.

func (*CommentUpdateOne) RemoveReplys added in v1.3.4

func (cuo *CommentUpdateOne) RemoveReplys(r ...*Reply) *CommentUpdateOne

RemoveReplys removes "replys" edges to Reply entities.

func (*CommentUpdateOne) Save added in v1.3.4

func (cuo *CommentUpdateOne) Save(ctx context.Context) (*Comment, error)

Save executes the query and returns the updated Comment entity.

func (*CommentUpdateOne) SaveX added in v1.3.4

func (cuo *CommentUpdateOne) SaveX(ctx context.Context) *Comment

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

func (*CommentUpdateOne) Select added in v1.3.4

func (cuo *CommentUpdateOne) Select(field string, fields ...string) *CommentUpdateOne

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

func (*CommentUpdateOne) SetContent added in v1.3.4

func (cuo *CommentUpdateOne) SetContent(s string) *CommentUpdateOne

SetContent sets the "content" field.

func (*CommentUpdateOne) SetCreateTime added in v1.3.4

func (cuo *CommentUpdateOne) SetCreateTime(t time.Time) *CommentUpdateOne

SetCreateTime sets the "create_time" field.

func (*CommentUpdateOne) SetIsReply added in v1.3.4

func (cuo *CommentUpdateOne) SetIsReply(b bool) *CommentUpdateOne

SetIsReply sets the "is_reply" field.

func (*CommentUpdateOne) SetMemberId added in v1.3.4

func (cuo *CommentUpdateOne) SetMemberId(s string) *CommentUpdateOne

SetMemberId sets the "memberId" field.

func (*CommentUpdateOne) SetNillableContent added in v1.3.4

func (cuo *CommentUpdateOne) SetNillableContent(s *string) *CommentUpdateOne

SetNillableContent sets the "content" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableCreateTime added in v1.3.4

func (cuo *CommentUpdateOne) SetNillableCreateTime(t *time.Time) *CommentUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableIsReply added in v1.3.4

func (cuo *CommentUpdateOne) SetNillableIsReply(b *bool) *CommentUpdateOne

SetNillableIsReply sets the "is_reply" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableMemberId added in v1.3.4

func (cuo *CommentUpdateOne) SetNillableMemberId(s *string) *CommentUpdateOne

SetNillableMemberId sets the "memberId" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableTitle added in v1.3.4

func (cuo *CommentUpdateOne) SetNillableTitle(s *string) *CommentUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*CommentUpdateOne) SetNillableUpdateTime added in v1.3.4

func (cuo *CommentUpdateOne) SetNillableUpdateTime(t *time.Time) *CommentUpdateOne

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*CommentUpdateOne) SetNotNilContent added in v1.3.14

func (c *CommentUpdateOne) SetNotNilContent(value *string) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilCreateTime added in v1.3.14

func (c *CommentUpdateOne) SetNotNilCreateTime(value *time.Time) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilIsReply added in v1.3.14

func (c *CommentUpdateOne) SetNotNilIsReply(value *bool) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilMemberId added in v1.3.14

func (c *CommentUpdateOne) SetNotNilMemberId(value *string) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilTitle added in v1.3.14

func (c *CommentUpdateOne) SetNotNilTitle(value *string) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilUpdateTime added in v1.3.14

func (c *CommentUpdateOne) SetNotNilUpdateTime(value *time.Time) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetNotNilUpdatedAt added in v1.3.14

func (c *CommentUpdateOne) SetNotNilUpdatedAt(value *time.Time) *CommentUpdateOne

set field if value's pointer is not nil.

func (*CommentUpdateOne) SetTitle added in v1.3.4

func (cuo *CommentUpdateOne) SetTitle(s string) *CommentUpdateOne

SetTitle sets the "title" field.

func (*CommentUpdateOne) SetUpdateTime added in v1.3.4

func (cuo *CommentUpdateOne) SetUpdateTime(t time.Time) *CommentUpdateOne

SetUpdateTime sets the "update_time" field.

func (*CommentUpdateOne) SetUpdatedAt added in v1.3.4

func (cuo *CommentUpdateOne) SetUpdatedAt(t time.Time) *CommentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CommentUpdateOne) Where added in v1.3.4

Where appends a list predicates to the CommentUpdate builder.

type Comments added in v1.3.4

type Comments []*Comment

Comments is a parsable slice of Comment.

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 forein id | 外部ID
	ForeinID string `json:"forein_id,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

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

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

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

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

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

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

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

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

SetExpiredAt sets the "expired_at" field.

func (*MemberCreate) SetForeinID added in v1.3.5

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

SetForeinID sets the "forein_id" 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

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

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

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

func (*MemberCreate) SetNotNilAvatar

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

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilEmail

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

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilExpiredAt

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

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilForeinID added in v1.3.14

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

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilMobile

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

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilNickname

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

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilPassword

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

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilRankID

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

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilStatus

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

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilUpdatedAt

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

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilUsername

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

set field if value's pointer is not nil.

func (*MemberCreate) SetNotNilWechatOpenID

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

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

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

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

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

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

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

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

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

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

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

func (*MemberMutation) ExpiredAtCleared

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) ForeinID added in v1.3.5

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

ForeinID returns the value of the "forein_id" field in the mutation.

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

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) OldForeinID added in v1.3.5

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

OldForeinID returns the old "forein_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) 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

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

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

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) ResetForeinID added in v1.3.5

func (m *MemberMutation) ResetForeinID()

ResetForeinID resets all changes to the "forein_id" field.

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

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

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) SetForeinID added in v1.3.5

func (m *MemberMutation) SetForeinID(s string)

SetForeinID sets the "forein_id" field.

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

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

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

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

func (*MemberMutation) WechatOpenIDCleared

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

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

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

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

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

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

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

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

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

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

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

set field if value's pointer is not nil.

func (*MemberRankCreate) SetNotNilDescription

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

set field if value's pointer is not nil.

func (*MemberRankCreate) SetNotNilName

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

set field if value's pointer is not nil.

func (*MemberRankCreate) SetNotNilRemark

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

set field if value's pointer is not nil.

func (*MemberRankCreate) SetNotNilUpdatedAt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

func (*MemberRankUpdate) SetNillableDescription

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

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

func (*MemberRankUpdate) SetNillableName

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

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

func (*MemberRankUpdate) SetNillableRemark

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

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

set field if value's pointer is not nil.

func (*MemberRankUpdate) SetNotNilDescription

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

set field if value's pointer is not nil.

func (*MemberRankUpdate) SetNotNilName

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

set field if value's pointer is not nil.

func (*MemberRankUpdate) SetNotNilRemark

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

set field if value's pointer is not nil.

func (*MemberRankUpdate) SetNotNilUpdatedAt

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

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

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

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

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

func (*MemberRankUpdateOne) SetNillableDescription

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

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

func (*MemberRankUpdateOne) SetNillableName

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

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

func (*MemberRankUpdateOne) SetNillableRemark

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

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

set field if value's pointer is not nil.

func (*MemberRankUpdateOne) SetNotNilDescription

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

set field if value's pointer is not nil.

func (*MemberRankUpdateOne) SetNotNilName

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

set field if value's pointer is not nil.

func (*MemberRankUpdateOne) SetNotNilRemark

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

set field if value's pointer is not nil.

func (*MemberRankUpdateOne) SetNotNilUpdatedAt

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

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

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

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

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

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

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

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

SetExpiredAt sets the "expired_at" field.

func (*MemberUpdate) SetForeinID added in v1.3.5

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

SetForeinID sets the "forein_id" 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

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

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*MemberUpdate) SetNillableForeinID added in v1.3.5

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

SetNillableForeinID sets the "forein_id" 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

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

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

func (*MemberUpdate) SetNillablePassword

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

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

func (*MemberUpdate) 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

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

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

func (*MemberUpdate) SetNillableWechatOpenID

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

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilEmail

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilExpiredAt

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilForeinID added in v1.3.14

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilMobile

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilNickname

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilPassword

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilRankID

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilStatus

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilUpdatedAt

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilUsername

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

set field if value's pointer is not nil.

func (*MemberUpdate) SetNotNilWechatOpenID

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

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

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

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

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

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

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

SetExpiredAt sets the "expired_at" field.

func (*MemberUpdateOne) SetForeinID added in v1.3.5

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

SetForeinID sets the "forein_id" 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

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

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*MemberUpdateOne) SetNillableForeinID added in v1.3.5

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

SetNillableForeinID sets the "forein_id" 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

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

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

func (*MemberUpdateOne) SetNillablePassword

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

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

func (*MemberUpdateOne) 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

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

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

func (*MemberUpdateOne) SetNillableWechatOpenID

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

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilEmail

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilExpiredAt

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilForeinID added in v1.3.14

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilMobile

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilNickname

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilPassword

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilRankID

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilStatus

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilUpdatedAt

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilUsername

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

set field if value's pointer is not nil.

func (*MemberUpdateOne) SetNotNilWechatOpenID

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

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

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

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

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

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

func (*OauthProvider) String

func (op *OauthProvider) String() string

String implements the fmt.Stringer.

func (*OauthProvider) Unwrap

func (op *OauthProvider) Unwrap() *OauthProvider

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

func (*OauthProvider) Update

func (op *OauthProvider) Update() *OauthProviderUpdateOne

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

func (*OauthProvider) Value

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

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

type OauthProviderClient

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

OauthProviderClient is a client for the OauthProvider schema.

func NewOauthProviderClient

func NewOauthProviderClient(c config) *OauthProviderClient

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

func (*OauthProviderClient) Create

Create returns a builder for creating a OauthProvider entity.

func (*OauthProviderClient) CreateBulk

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

func (*OauthProviderClient) Delete

Delete returns a delete builder for OauthProvider.

func (*OauthProviderClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OauthProviderClient) DeleteOneID

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

func (*OauthProviderClient) ExecContext

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

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

func (*OauthProviderClient) Get

Get returns a OauthProvider entity by its id.

func (*OauthProviderClient) GetX

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

func (*OauthProviderClient) Hooks

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

Hooks returns the client hooks.

func (*OauthProviderClient) Intercept

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

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

func (*OauthProviderClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OauthProviderClient) MapCreateBulk

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

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

func (*OauthProviderClient) Query

Query returns a query builder for OauthProvider.

func (*OauthProviderClient) QueryContext

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

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

func (*OauthProviderClient) Update

Update returns an update builder for OauthProvider.

func (*OauthProviderClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*OauthProviderClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*OauthProviderClient) Use

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

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

type OauthProviderCreate

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

OauthProviderCreate is the builder for creating a OauthProvider entity.

func (*OauthProviderCreate) Exec

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

Exec executes the query.

func (*OauthProviderCreate) ExecContext

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

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

func (*OauthProviderCreate) ExecX

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

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

func (*OauthProviderCreate) Mutation

func (opc *OauthProviderCreate) Mutation() *OauthProviderMutation

Mutation returns the OauthProviderMutation object of the builder.

func (*OauthProviderCreate) QueryContext

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

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

func (*OauthProviderCreate) Save

Save creates the OauthProvider in the database.

func (*OauthProviderCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*OauthProviderCreate) SetAuthStyle

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

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderCreate) SetAuthURL

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

SetAuthURL sets the "auth_url" field.

func (*OauthProviderCreate) SetClientID

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

SetClientID sets the "client_id" field.

func (*OauthProviderCreate) SetClientSecret

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

SetClientSecret sets the "client_secret" field.

func (*OauthProviderCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*OauthProviderCreate) SetID

SetID sets the "id" field.

func (*OauthProviderCreate) SetInfoURL

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

SetInfoURL sets the "info_url" field.

func (*OauthProviderCreate) SetName

SetName sets the "name" field.

func (*OauthProviderCreate) SetNillableCreatedAt

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

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

func (*OauthProviderCreate) SetNillableUpdatedAt

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

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

func (*OauthProviderCreate) SetNotNilAuthStyle

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

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilAuthURL

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

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilClientID

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

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilClientSecret

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

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilInfoURL

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

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilName

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

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilRedirectURL

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

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilScopes

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

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilTokenURL

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

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetNotNilUpdatedAt

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

set field if value's pointer is not nil.

func (*OauthProviderCreate) SetRedirectURL

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

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderCreate) SetScopes

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

SetScopes sets the "scopes" field.

func (*OauthProviderCreate) SetTokenURL

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

SetTokenURL sets the "token_url" field.

func (*OauthProviderCreate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

type OauthProviderCreateBulk

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

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

func (*OauthProviderCreateBulk) Exec

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

Exec executes the query.

func (*OauthProviderCreateBulk) ExecContext

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

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

func (*OauthProviderCreateBulk) ExecX

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

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

func (*OauthProviderCreateBulk) QueryContext

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

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

func (*OauthProviderCreateBulk) Save

Save creates the OauthProvider entities in the database.

func (*OauthProviderCreateBulk) SaveX

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

type OauthProviderDelete

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

OauthProviderDelete is the builder for deleting a OauthProvider entity.

func (*OauthProviderDelete) Exec

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

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

func (*OauthProviderDelete) ExecContext

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

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

func (*OauthProviderDelete) ExecX

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

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

func (*OauthProviderDelete) QueryContext

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

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

func (*OauthProviderDelete) Where

Where appends a list predicates to the OauthProviderDelete builder.

type OauthProviderDeleteOne

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

OauthProviderDeleteOne is the builder for deleting a single OauthProvider entity.

func (*OauthProviderDeleteOne) Exec

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

Exec executes the deletion query.

func (*OauthProviderDeleteOne) ExecX

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

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

func (*OauthProviderDeleteOne) Where

Where appends a list predicates to the OauthProviderDelete builder.

type OauthProviderGroupBy

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

OauthProviderGroupBy is the group-by builder for OauthProvider entities.

func (*OauthProviderGroupBy) Aggregate

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

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

func (*OauthProviderGroupBy) Bool

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

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

func (*OauthProviderGroupBy) BoolX

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

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

func (*OauthProviderGroupBy) Bools

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

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

func (*OauthProviderGroupBy) BoolsX

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

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

func (*OauthProviderGroupBy) Float64

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

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

func (*OauthProviderGroupBy) Float64X

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

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

func (*OauthProviderGroupBy) Float64s

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

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

func (*OauthProviderGroupBy) Float64sX

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

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

func (*OauthProviderGroupBy) Int

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

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

func (*OauthProviderGroupBy) IntX

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

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

func (*OauthProviderGroupBy) Ints

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

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

func (*OauthProviderGroupBy) IntsX

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

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

func (*OauthProviderGroupBy) Scan

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

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

func (*OauthProviderGroupBy) ScanX

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

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

func (*OauthProviderGroupBy) String

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

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

func (*OauthProviderGroupBy) StringX

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

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

func (*OauthProviderGroupBy) Strings

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

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

func (*OauthProviderGroupBy) StringsX

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

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

type OauthProviderMutation

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

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

func (*OauthProviderMutation) AddAuthStyle

func (m *OauthProviderMutation) AddAuthStyle(u int64)

AddAuthStyle adds u to the "auth_style" field.

func (*OauthProviderMutation) AddField

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

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

func (*OauthProviderMutation) AddedAuthStyle

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

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

func (*OauthProviderMutation) AddedEdges

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

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

func (*OauthProviderMutation) AddedField

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

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

func (*OauthProviderMutation) AddedFields

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

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

func (*OauthProviderMutation) AddedIDs

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

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

func (*OauthProviderMutation) AuthStyle

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

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

func (*OauthProviderMutation) AuthURL

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

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

func (*OauthProviderMutation) ClearEdge

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

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

func (*OauthProviderMutation) ClearField

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

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

func (*OauthProviderMutation) ClearedEdges

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

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

func (*OauthProviderMutation) ClearedFields

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

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

func (OauthProviderMutation) Client

func (m OauthProviderMutation) Client() *Client

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

func (*OauthProviderMutation) ClientID

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

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

func (*OauthProviderMutation) ClientSecret

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

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

func (*OauthProviderMutation) CreatedAt

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

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

func (*OauthProviderMutation) EdgeCleared

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

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

func (*OauthProviderMutation) ExecContext

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

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

func (*OauthProviderMutation) Field

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

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

func (*OauthProviderMutation) FieldCleared

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

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

func (*OauthProviderMutation) Fields

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

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

func (*OauthProviderMutation) ID

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

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

func (*OauthProviderMutation) IDs

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

func (*OauthProviderMutation) InfoURL

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

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

func (*OauthProviderMutation) Name

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

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

func (*OauthProviderMutation) OldAuthStyle

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

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

func (*OauthProviderMutation) OldAuthURL

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

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

func (*OauthProviderMutation) OldClientID

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

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

func (*OauthProviderMutation) OldClientSecret

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

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

func (*OauthProviderMutation) OldCreatedAt

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

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

func (*OauthProviderMutation) OldField

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

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

func (*OauthProviderMutation) OldInfoURL

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

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

func (*OauthProviderMutation) OldName

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

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

func (*OauthProviderMutation) OldRedirectURL

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

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

func (*OauthProviderMutation) OldScopes

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

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

func (*OauthProviderMutation) OldTokenURL

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

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

func (*OauthProviderMutation) OldUpdatedAt

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

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

func (*OauthProviderMutation) Op

func (m *OauthProviderMutation) Op() Op

Op returns the operation name.

func (*OauthProviderMutation) QueryContext

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

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

func (*OauthProviderMutation) RedirectURL

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

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

func (*OauthProviderMutation) RemovedEdges

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

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

func (*OauthProviderMutation) RemovedIDs

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

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

func (*OauthProviderMutation) ResetAuthStyle

func (m *OauthProviderMutation) ResetAuthStyle()

ResetAuthStyle resets all changes to the "auth_style" field.

func (*OauthProviderMutation) ResetAuthURL

func (m *OauthProviderMutation) ResetAuthURL()

ResetAuthURL resets all changes to the "auth_url" field.

func (*OauthProviderMutation) ResetClientID

func (m *OauthProviderMutation) ResetClientID()

ResetClientID resets all changes to the "client_id" field.

func (*OauthProviderMutation) ResetClientSecret

func (m *OauthProviderMutation) ResetClientSecret()

ResetClientSecret resets all changes to the "client_secret" field.

func (*OauthProviderMutation) ResetCreatedAt

func (m *OauthProviderMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OauthProviderMutation) ResetEdge

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

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

func (*OauthProviderMutation) ResetField

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

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

func (*OauthProviderMutation) ResetInfoURL

func (m *OauthProviderMutation) ResetInfoURL()

ResetInfoURL resets all changes to the "info_url" field.

func (*OauthProviderMutation) ResetName

func (m *OauthProviderMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*OauthProviderMutation) ResetRedirectURL

func (m *OauthProviderMutation) ResetRedirectURL()

ResetRedirectURL resets all changes to the "redirect_url" field.

func (*OauthProviderMutation) ResetScopes

func (m *OauthProviderMutation) ResetScopes()

ResetScopes resets all changes to the "scopes" field.

func (*OauthProviderMutation) ResetTokenURL

func (m *OauthProviderMutation) ResetTokenURL()

ResetTokenURL resets all changes to the "token_url" field.

func (*OauthProviderMutation) ResetUpdatedAt

func (m *OauthProviderMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OauthProviderMutation) Scopes

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

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

func (*OauthProviderMutation) SetAuthStyle

func (m *OauthProviderMutation) SetAuthStyle(u uint64)

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderMutation) SetAuthURL

func (m *OauthProviderMutation) SetAuthURL(s string)

SetAuthURL sets the "auth_url" field.

func (*OauthProviderMutation) SetClientID

func (m *OauthProviderMutation) SetClientID(s string)

SetClientID sets the "client_id" field.

func (*OauthProviderMutation) SetClientSecret

func (m *OauthProviderMutation) SetClientSecret(s string)

SetClientSecret sets the "client_secret" field.

func (*OauthProviderMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*OauthProviderMutation) SetField

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

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

func (*OauthProviderMutation) SetID

func (m *OauthProviderMutation) SetID(id uint64)

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

func (*OauthProviderMutation) SetInfoURL

func (m *OauthProviderMutation) SetInfoURL(s string)

SetInfoURL sets the "info_url" field.

func (*OauthProviderMutation) SetName

func (m *OauthProviderMutation) SetName(s string)

SetName sets the "name" field.

func (*OauthProviderMutation) SetOp

func (m *OauthProviderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OauthProviderMutation) SetRedirectURL

func (m *OauthProviderMutation) SetRedirectURL(s string)

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderMutation) SetScopes

func (m *OauthProviderMutation) SetScopes(s string)

SetScopes sets the "scopes" field.

func (*OauthProviderMutation) SetTokenURL

func (m *OauthProviderMutation) SetTokenURL(s string)

SetTokenURL sets the "token_url" field.

func (*OauthProviderMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*OauthProviderMutation) TokenURL

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

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

func (OauthProviderMutation) Tx

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

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

func (*OauthProviderMutation) Type

func (m *OauthProviderMutation) Type() string

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

func (*OauthProviderMutation) UpdatedAt

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

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

func (*OauthProviderMutation) Where

Where appends a list predicates to the OauthProviderMutation builder.

func (*OauthProviderMutation) WhereP

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

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

type OauthProviderPageList

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

OauthProviderPageList is OauthProvider PageList result.

type OauthProviderPager

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

func (*OauthProviderPager) ApplyFilter

type OauthProviderPaginateOption

type OauthProviderPaginateOption func(*OauthProviderPager)

OauthProviderPaginateOption enables pagination customization.

type OauthProviderQuery

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

OauthProviderQuery is the builder for querying OauthProvider entities.

func (*OauthProviderQuery) Aggregate

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

Aggregate returns a OauthProviderSelect configured with the given aggregations.

func (*OauthProviderQuery) All

All executes the query and returns a list of OauthProviders.

func (*OauthProviderQuery) AllX

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

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

func (*OauthProviderQuery) Clone

func (opq *OauthProviderQuery) Clone() *OauthProviderQuery

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

func (*OauthProviderQuery) Count

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

Count returns the count of the given query.

func (*OauthProviderQuery) CountX

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

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

func (*OauthProviderQuery) ExecContext

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

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

func (*OauthProviderQuery) Exist

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

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

func (*OauthProviderQuery) ExistX

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

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

func (*OauthProviderQuery) First

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

func (*OauthProviderQuery) FirstID

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

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

func (*OauthProviderQuery) FirstIDX

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

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

func (*OauthProviderQuery) FirstX

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

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

func (*OauthProviderQuery) GroupBy

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

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

Example:

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

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

func (*OauthProviderQuery) IDs

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

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

func (*OauthProviderQuery) IDsX

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

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

func (*OauthProviderQuery) Limit

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

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

func (*OauthProviderQuery) Offset

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

Offset to start from.

func (*OauthProviderQuery) Only

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

func (*OauthProviderQuery) OnlyID

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

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

func (*OauthProviderQuery) OnlyIDX

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

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

func (*OauthProviderQuery) OnlyX

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

func (*OauthProviderQuery) Order

Order specifies how the records should be ordered.

func (*OauthProviderQuery) Page

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

func (*OauthProviderQuery) QueryContext

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

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

func (*OauthProviderQuery) Select

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

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

Example:

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

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

func (*OauthProviderQuery) Unique

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

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

func (*OauthProviderQuery) Where

Where adds a new predicate for the OauthProviderQuery builder.

type OauthProviderSelect

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

OauthProviderSelect is the builder for selecting fields of OauthProvider entities.

func (*OauthProviderSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*OauthProviderSelect) Bool

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

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

func (*OauthProviderSelect) BoolX

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

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

func (*OauthProviderSelect) Bools

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

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

func (*OauthProviderSelect) BoolsX

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

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

func (OauthProviderSelect) ExecContext

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

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

func (*OauthProviderSelect) Float64

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

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

func (*OauthProviderSelect) Float64X

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

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

func (*OauthProviderSelect) Float64s

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

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

func (*OauthProviderSelect) Float64sX

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

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

func (*OauthProviderSelect) Int

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

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

func (*OauthProviderSelect) IntX

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

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

func (*OauthProviderSelect) Ints

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

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

func (*OauthProviderSelect) IntsX

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

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

func (OauthProviderSelect) QueryContext

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

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

func (*OauthProviderSelect) Scan

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

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

func (*OauthProviderSelect) ScanX

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

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

func (*OauthProviderSelect) String

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

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

func (*OauthProviderSelect) StringX

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

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

func (*OauthProviderSelect) Strings

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

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

func (*OauthProviderSelect) StringsX

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

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

type OauthProviderUpdate

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

OauthProviderUpdate is the builder for updating OauthProvider entities.

func (*OauthProviderUpdate) AddAuthStyle

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

AddAuthStyle adds u to the "auth_style" field.

func (*OauthProviderUpdate) Exec

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

Exec executes the query.

func (*OauthProviderUpdate) ExecContext

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

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

func (*OauthProviderUpdate) ExecX

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

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

func (*OauthProviderUpdate) Mutation

func (opu *OauthProviderUpdate) Mutation() *OauthProviderMutation

Mutation returns the OauthProviderMutation object of the builder.

func (*OauthProviderUpdate) QueryContext

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

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

func (*OauthProviderUpdate) Save

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

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

func (*OauthProviderUpdate) SaveX

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

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

func (*OauthProviderUpdate) SetAuthStyle

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

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderUpdate) SetAuthURL

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

SetAuthURL sets the "auth_url" field.

func (*OauthProviderUpdate) SetClientID

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

SetClientID sets the "client_id" field.

func (*OauthProviderUpdate) SetClientSecret

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

SetClientSecret sets the "client_secret" field.

func (*OauthProviderUpdate) SetInfoURL

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

SetInfoURL sets the "info_url" field.

func (*OauthProviderUpdate) SetName

SetName sets the "name" field.

func (*OauthProviderUpdate) SetNillableAuthStyle

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

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

func (*OauthProviderUpdate) SetNillableAuthURL

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

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

func (*OauthProviderUpdate) SetNillableClientID

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

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

func (*OauthProviderUpdate) SetNillableClientSecret

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

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

func (*OauthProviderUpdate) SetNillableInfoURL

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

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

func (*OauthProviderUpdate) SetNillableName

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

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

func (*OauthProviderUpdate) SetNillableRedirectURL

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

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

func (*OauthProviderUpdate) SetNillableScopes

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

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

func (*OauthProviderUpdate) SetNillableTokenURL

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

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

func (*OauthProviderUpdate) SetNotNilAuthStyle

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

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilAuthURL

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

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilClientID

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

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilClientSecret

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

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilInfoURL

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

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilName

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

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilRedirectURL

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

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilScopes

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

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilTokenURL

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

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetNotNilUpdatedAt

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

set field if value's pointer is not nil.

func (*OauthProviderUpdate) SetRedirectURL

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

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderUpdate) SetScopes

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

SetScopes sets the "scopes" field.

func (*OauthProviderUpdate) SetTokenURL

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

SetTokenURL sets the "token_url" field.

func (*OauthProviderUpdate) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*OauthProviderUpdate) Where

Where appends a list predicates to the OauthProviderUpdate builder.

type OauthProviderUpdateOne

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

OauthProviderUpdateOne is the builder for updating a single OauthProvider entity.

func (*OauthProviderUpdateOne) AddAuthStyle

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

AddAuthStyle adds u to the "auth_style" field.

func (*OauthProviderUpdateOne) Exec

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

Exec executes the query on the entity.

func (*OauthProviderUpdateOne) ExecContext

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

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

func (*OauthProviderUpdateOne) ExecX

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

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

func (*OauthProviderUpdateOne) Mutation

Mutation returns the OauthProviderMutation object of the builder.

func (*OauthProviderUpdateOne) QueryContext

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

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

func (*OauthProviderUpdateOne) Save

Save executes the query and returns the updated OauthProvider entity.

func (*OauthProviderUpdateOne) SaveX

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

func (*OauthProviderUpdateOne) Select

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

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

func (*OauthProviderUpdateOne) SetAuthStyle

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

SetAuthStyle sets the "auth_style" field.

func (*OauthProviderUpdateOne) SetAuthURL

SetAuthURL sets the "auth_url" field.

func (*OauthProviderUpdateOne) SetClientID

SetClientID sets the "client_id" field.

func (*OauthProviderUpdateOne) SetClientSecret

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

SetClientSecret sets the "client_secret" field.

func (*OauthProviderUpdateOne) SetInfoURL

SetInfoURL sets the "info_url" field.

func (*OauthProviderUpdateOne) SetName

SetName sets the "name" field.

func (*OauthProviderUpdateOne) SetNillableAuthStyle

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

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

func (*OauthProviderUpdateOne) SetNillableAuthURL

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

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

func (*OauthProviderUpdateOne) SetNillableClientID

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

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

func (*OauthProviderUpdateOne) SetNillableClientSecret

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

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

func (*OauthProviderUpdateOne) SetNillableInfoURL

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

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

func (*OauthProviderUpdateOne) SetNillableName

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

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

func (*OauthProviderUpdateOne) SetNillableRedirectURL

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

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

func (*OauthProviderUpdateOne) SetNillableScopes

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

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

func (*OauthProviderUpdateOne) SetNillableTokenURL

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

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

func (*OauthProviderUpdateOne) SetNotNilAuthStyle

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

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilAuthURL

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

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilClientID

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

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilClientSecret

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

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilInfoURL

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

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilName

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

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilRedirectURL

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

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilScopes

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

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilTokenURL

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

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetNotNilUpdatedAt

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

set field if value's pointer is not nil.

func (*OauthProviderUpdateOne) SetRedirectURL

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

SetRedirectURL sets the "redirect_url" field.

func (*OauthProviderUpdateOne) SetScopes

SetScopes sets the "scopes" field.

func (*OauthProviderUpdateOne) SetTokenURL

SetTokenURL sets the "token_url" field.

func (*OauthProviderUpdateOne) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*OauthProviderUpdateOne) Where

Where appends a list predicates to the OauthProviderUpdate builder.

type OauthProviders

type OauthProviders []*OauthProvider

OauthProviders is a parsable slice of OauthProvider.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection string

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

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

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type PageDetails

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

type Policy

type Policy = ent.Policy

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

type 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 Replies added in v1.3.4

type Replies []*Reply

Replies is a parsable slice of Reply.

type Reply added in v1.3.4

type Reply 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"`
	// 评论id
	CommentID uint64 `json:"comment_id,omitempty"`
	// 回复内容
	Reply string `json:"reply,omitempty"`
	// 管理员id
	AdminId string `json:"adminId,omitempty"`
	// 管理员名字
	AdminName string `json:"adminName,omitempty"`
	// 发布时间
	CreateTime time.Time `json:"create_time,omitempty"`
	// 更新时间
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ReplyQuery when eager-loading is set.
	Edges ReplyEdges `json:"edges"`
	// contains filtered or unexported fields
}

Reply is the model entity for the Reply schema.

func (*Reply) ExecContext added in v1.3.14

func (c *Reply) 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 (*Reply) QueryComment added in v1.3.4

func (r *Reply) QueryComment() *CommentQuery

QueryComment queries the "comment" edge of the Reply entity.

func (*Reply) QueryContext added in v1.3.14

func (c *Reply) 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 (*Reply) String added in v1.3.4

func (r *Reply) String() string

String implements the fmt.Stringer.

func (*Reply) Unwrap added in v1.3.4

func (r *Reply) Unwrap() *Reply

Unwrap unwraps the Reply 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 (*Reply) Update added in v1.3.4

func (r *Reply) Update() *ReplyUpdateOne

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

func (*Reply) Value added in v1.3.4

func (r *Reply) Value(name string) (ent.Value, error)

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

type ReplyClient added in v1.3.4

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

ReplyClient is a client for the Reply schema.

func NewReplyClient added in v1.3.4

func NewReplyClient(c config) *ReplyClient

NewReplyClient returns a client for the Reply from the given config.

func (*ReplyClient) Create added in v1.3.4

func (c *ReplyClient) Create() *ReplyCreate

Create returns a builder for creating a Reply entity.

func (*ReplyClient) CreateBulk added in v1.3.4

func (c *ReplyClient) CreateBulk(builders ...*ReplyCreate) *ReplyCreateBulk

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

func (*ReplyClient) Delete added in v1.3.4

func (c *ReplyClient) Delete() *ReplyDelete

Delete returns a delete builder for Reply.

func (*ReplyClient) DeleteOne added in v1.3.4

func (c *ReplyClient) DeleteOne(r *Reply) *ReplyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ReplyClient) DeleteOneID added in v1.3.4

func (c *ReplyClient) DeleteOneID(id uint64) *ReplyDeleteOne

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

func (*ReplyClient) ExecContext added in v1.3.14

func (c *ReplyClient) 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 (*ReplyClient) Get added in v1.3.4

func (c *ReplyClient) Get(ctx context.Context, id uint64) (*Reply, error)

Get returns a Reply entity by its id.

func (*ReplyClient) GetX added in v1.3.4

func (c *ReplyClient) GetX(ctx context.Context, id uint64) *Reply

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

func (*ReplyClient) Hooks added in v1.3.4

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

Hooks returns the client hooks.

func (*ReplyClient) Intercept added in v1.3.4

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

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

func (*ReplyClient) Interceptors added in v1.3.4

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

Interceptors returns the client interceptors.

func (*ReplyClient) MapCreateBulk added in v1.3.4

func (c *ReplyClient) MapCreateBulk(slice any, setFunc func(*ReplyCreate, int)) *ReplyCreateBulk

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 (*ReplyClient) Query added in v1.3.4

func (c *ReplyClient) Query() *ReplyQuery

Query returns a query builder for Reply.

func (*ReplyClient) QueryComment added in v1.3.4

func (c *ReplyClient) QueryComment(r *Reply) *CommentQuery

QueryComment queries the comment edge of a Reply.

func (*ReplyClient) QueryContext added in v1.3.14

func (c *ReplyClient) 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 (*ReplyClient) Update added in v1.3.4

func (c *ReplyClient) Update() *ReplyUpdate

Update returns an update builder for Reply.

func (*ReplyClient) UpdateOne added in v1.3.4

func (c *ReplyClient) UpdateOne(r *Reply) *ReplyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReplyClient) UpdateOneID added in v1.3.4

func (c *ReplyClient) UpdateOneID(id uint64) *ReplyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ReplyClient) Use added in v1.3.4

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

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

type ReplyCreate added in v1.3.4

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

ReplyCreate is the builder for creating a Reply entity.

func (*ReplyCreate) Exec added in v1.3.4

func (rc *ReplyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReplyCreate) ExecContext added in v1.3.14

func (c *ReplyCreate) 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 (*ReplyCreate) ExecX added in v1.3.4

func (rc *ReplyCreate) ExecX(ctx context.Context)

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

func (*ReplyCreate) Mutation added in v1.3.4

func (rc *ReplyCreate) Mutation() *ReplyMutation

Mutation returns the ReplyMutation object of the builder.

func (*ReplyCreate) QueryContext added in v1.3.14

func (c *ReplyCreate) 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 (*ReplyCreate) Save added in v1.3.4

func (rc *ReplyCreate) Save(ctx context.Context) (*Reply, error)

Save creates the Reply in the database.

func (*ReplyCreate) SaveX added in v1.3.4

func (rc *ReplyCreate) SaveX(ctx context.Context) *Reply

SaveX calls Save and panics if Save returns an error.

func (*ReplyCreate) SetAdminId added in v1.3.4

func (rc *ReplyCreate) SetAdminId(s string) *ReplyCreate

SetAdminId sets the "adminId" field.

func (*ReplyCreate) SetAdminName added in v1.3.4

func (rc *ReplyCreate) SetAdminName(s string) *ReplyCreate

SetAdminName sets the "adminName" field.

func (*ReplyCreate) SetComment added in v1.3.4

func (rc *ReplyCreate) SetComment(c *Comment) *ReplyCreate

SetComment sets the "comment" edge to the Comment entity.

func (*ReplyCreate) SetCommentID added in v1.3.4

func (rc *ReplyCreate) SetCommentID(u uint64) *ReplyCreate

SetCommentID sets the "comment_id" field.

func (*ReplyCreate) SetCreateTime added in v1.3.4

func (rc *ReplyCreate) SetCreateTime(t time.Time) *ReplyCreate

SetCreateTime sets the "create_time" field.

func (*ReplyCreate) SetCreatedAt added in v1.3.4

func (rc *ReplyCreate) SetCreatedAt(t time.Time) *ReplyCreate

SetCreatedAt sets the "created_at" field.

func (*ReplyCreate) SetID added in v1.3.4

func (rc *ReplyCreate) SetID(u uint64) *ReplyCreate

SetID sets the "id" field.

func (*ReplyCreate) SetNillableCreateTime added in v1.3.4

func (rc *ReplyCreate) SetNillableCreateTime(t *time.Time) *ReplyCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ReplyCreate) SetNillableCreatedAt added in v1.3.4

func (rc *ReplyCreate) SetNillableCreatedAt(t *time.Time) *ReplyCreate

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

func (*ReplyCreate) SetNillableUpdateTime added in v1.3.4

func (rc *ReplyCreate) SetNillableUpdateTime(t *time.Time) *ReplyCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ReplyCreate) SetNillableUpdatedAt added in v1.3.4

func (rc *ReplyCreate) SetNillableUpdatedAt(t *time.Time) *ReplyCreate

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

func (*ReplyCreate) SetNotNilAdminId added in v1.3.14

func (r *ReplyCreate) SetNotNilAdminId(value *string) *ReplyCreate

set field if value's pointer is not nil.

func (*ReplyCreate) SetNotNilAdminName added in v1.3.14

func (r *ReplyCreate) SetNotNilAdminName(value *string) *ReplyCreate

set field if value's pointer is not nil.

func (*ReplyCreate) SetNotNilCommentID added in v1.3.14

func (r *ReplyCreate) SetNotNilCommentID(value *uint64) *ReplyCreate

set field if value's pointer is not nil.

func (*ReplyCreate) SetNotNilCreateTime added in v1.3.14

func (r *ReplyCreate) SetNotNilCreateTime(value *time.Time) *ReplyCreate

set field if value's pointer is not nil.

func (*ReplyCreate) SetNotNilReply added in v1.3.14

func (r *ReplyCreate) SetNotNilReply(value *string) *ReplyCreate

set field if value's pointer is not nil.

func (*ReplyCreate) SetNotNilUpdateTime added in v1.3.14

func (r *ReplyCreate) SetNotNilUpdateTime(value *time.Time) *ReplyCreate

set field if value's pointer is not nil.

func (*ReplyCreate) SetNotNilUpdatedAt added in v1.3.14

func (r *ReplyCreate) SetNotNilUpdatedAt(value *time.Time) *ReplyCreate

set field if value's pointer is not nil.

func (*ReplyCreate) SetReply added in v1.3.4

func (rc *ReplyCreate) SetReply(s string) *ReplyCreate

SetReply sets the "reply" field.

func (*ReplyCreate) SetUpdateTime added in v1.3.4

func (rc *ReplyCreate) SetUpdateTime(t time.Time) *ReplyCreate

SetUpdateTime sets the "update_time" field.

func (*ReplyCreate) SetUpdatedAt added in v1.3.4

func (rc *ReplyCreate) SetUpdatedAt(t time.Time) *ReplyCreate

SetUpdatedAt sets the "updated_at" field.

type ReplyCreateBulk added in v1.3.4

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

ReplyCreateBulk is the builder for creating many Reply entities in bulk.

func (*ReplyCreateBulk) Exec added in v1.3.4

func (rcb *ReplyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReplyCreateBulk) ExecContext added in v1.3.14

func (c *ReplyCreateBulk) 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 (*ReplyCreateBulk) ExecX added in v1.3.4

func (rcb *ReplyCreateBulk) ExecX(ctx context.Context)

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

func (*ReplyCreateBulk) QueryContext added in v1.3.14

func (c *ReplyCreateBulk) 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 (*ReplyCreateBulk) Save added in v1.3.4

func (rcb *ReplyCreateBulk) Save(ctx context.Context) ([]*Reply, error)

Save creates the Reply entities in the database.

func (*ReplyCreateBulk) SaveX added in v1.3.4

func (rcb *ReplyCreateBulk) SaveX(ctx context.Context) []*Reply

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

type ReplyDelete added in v1.3.4

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

ReplyDelete is the builder for deleting a Reply entity.

func (*ReplyDelete) Exec added in v1.3.4

func (rd *ReplyDelete) Exec(ctx context.Context) (int, error)

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

func (*ReplyDelete) ExecContext added in v1.3.14

func (c *ReplyDelete) 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 (*ReplyDelete) ExecX added in v1.3.4

func (rd *ReplyDelete) ExecX(ctx context.Context) int

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

func (*ReplyDelete) QueryContext added in v1.3.14

func (c *ReplyDelete) 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 (*ReplyDelete) Where added in v1.3.4

func (rd *ReplyDelete) Where(ps ...predicate.Reply) *ReplyDelete

Where appends a list predicates to the ReplyDelete builder.

type ReplyDeleteOne added in v1.3.4

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

ReplyDeleteOne is the builder for deleting a single Reply entity.

func (*ReplyDeleteOne) Exec added in v1.3.4

func (rdo *ReplyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReplyDeleteOne) ExecX added in v1.3.4

func (rdo *ReplyDeleteOne) ExecX(ctx context.Context)

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

func (*ReplyDeleteOne) Where added in v1.3.4

func (rdo *ReplyDeleteOne) Where(ps ...predicate.Reply) *ReplyDeleteOne

Where appends a list predicates to the ReplyDelete builder.

type ReplyEdges added in v1.3.4

type ReplyEdges struct {
	// Comment holds the value of the comment edge.
	Comment *Comment `json:"comment,omitempty"`
	// contains filtered or unexported fields
}

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

func (ReplyEdges) CommentOrErr added in v1.3.4

func (e ReplyEdges) CommentOrErr() (*Comment, error)

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

type ReplyGroupBy added in v1.3.4

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

ReplyGroupBy is the group-by builder for Reply entities.

func (*ReplyGroupBy) Aggregate added in v1.3.4

func (rgb *ReplyGroupBy) Aggregate(fns ...AggregateFunc) *ReplyGroupBy

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

func (*ReplyGroupBy) Bool added in v1.3.4

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

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

func (*ReplyGroupBy) BoolX added in v1.3.4

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

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

func (*ReplyGroupBy) Bools added in v1.3.4

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

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

func (*ReplyGroupBy) BoolsX added in v1.3.4

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

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

func (*ReplyGroupBy) Float64 added in v1.3.4

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

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

func (*ReplyGroupBy) Float64X added in v1.3.4

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

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

func (*ReplyGroupBy) Float64s added in v1.3.4

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

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

func (*ReplyGroupBy) Float64sX added in v1.3.4

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

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

func (*ReplyGroupBy) Int added in v1.3.4

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

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

func (*ReplyGroupBy) IntX added in v1.3.4

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

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

func (*ReplyGroupBy) Ints added in v1.3.4

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

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

func (*ReplyGroupBy) IntsX added in v1.3.4

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

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

func (*ReplyGroupBy) Scan added in v1.3.4

func (rgb *ReplyGroupBy) Scan(ctx context.Context, v any) error

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

func (*ReplyGroupBy) ScanX added in v1.3.4

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

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

func (*ReplyGroupBy) String added in v1.3.4

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

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

func (*ReplyGroupBy) StringX added in v1.3.4

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

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

func (*ReplyGroupBy) Strings added in v1.3.4

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

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

func (*ReplyGroupBy) StringsX added in v1.3.4

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

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

type ReplyMutation added in v1.3.4

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

ReplyMutation represents an operation that mutates the Reply nodes in the graph.

func (*ReplyMutation) AddField added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) AddedEdges added in v1.3.4

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

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

func (*ReplyMutation) AddedField added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) AddedFields added in v1.3.4

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

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

func (*ReplyMutation) AddedIDs added in v1.3.4

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

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

func (*ReplyMutation) AdminId added in v1.3.4

func (m *ReplyMutation) AdminId() (r string, exists bool)

AdminId returns the value of the "adminId" field in the mutation.

func (*ReplyMutation) AdminName added in v1.3.4

func (m *ReplyMutation) AdminName() (r string, exists bool)

AdminName returns the value of the "adminName" field in the mutation.

func (*ReplyMutation) ClearComment added in v1.3.4

func (m *ReplyMutation) ClearComment()

ClearComment clears the "comment" edge to the Comment entity.

func (*ReplyMutation) ClearEdge added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) ClearField added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) ClearedEdges added in v1.3.4

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

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

func (*ReplyMutation) ClearedFields added in v1.3.4

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

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

func (ReplyMutation) Client added in v1.3.4

func (m ReplyMutation) 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 (*ReplyMutation) CommentCleared added in v1.3.4

func (m *ReplyMutation) CommentCleared() bool

CommentCleared reports if the "comment" edge to the Comment entity was cleared.

func (*ReplyMutation) CommentID added in v1.3.4

func (m *ReplyMutation) CommentID() (r uint64, exists bool)

CommentID returns the value of the "comment_id" field in the mutation.

func (*ReplyMutation) CommentIDs added in v1.3.4

func (m *ReplyMutation) CommentIDs() (ids []uint64)

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

func (*ReplyMutation) CreateTime added in v1.3.4

func (m *ReplyMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*ReplyMutation) CreatedAt added in v1.3.4

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

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

func (*ReplyMutation) EdgeCleared added in v1.3.4

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

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

func (*ReplyMutation) ExecContext added in v1.3.14

func (c *ReplyMutation) 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 (*ReplyMutation) Field added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) FieldCleared added in v1.3.4

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

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

func (*ReplyMutation) Fields added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) ID added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) IDs added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) OldAdminId added in v1.3.4

func (m *ReplyMutation) OldAdminId(ctx context.Context) (v string, err error)

OldAdminId returns the old "adminId" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldAdminName added in v1.3.4

func (m *ReplyMutation) OldAdminName(ctx context.Context) (v string, err error)

OldAdminName returns the old "adminName" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldCommentID added in v1.3.4

func (m *ReplyMutation) OldCommentID(ctx context.Context) (v uint64, err error)

OldCommentID returns the old "comment_id" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldCreateTime added in v1.3.4

func (m *ReplyMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldCreatedAt added in v1.3.4

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

OldCreatedAt returns the old "created_at" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldField added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) OldReply added in v1.3.4

func (m *ReplyMutation) OldReply(ctx context.Context) (v string, err error)

OldReply returns the old "reply" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldUpdateTime added in v1.3.4

func (m *ReplyMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) OldUpdatedAt added in v1.3.4

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

OldUpdatedAt returns the old "updated_at" field's value of the Reply entity. If the Reply 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 (*ReplyMutation) Op added in v1.3.4

func (m *ReplyMutation) Op() Op

Op returns the operation name.

func (*ReplyMutation) QueryContext added in v1.3.14

func (c *ReplyMutation) 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 (*ReplyMutation) RemovedEdges added in v1.3.4

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

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

func (*ReplyMutation) RemovedIDs added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) Reply added in v1.3.4

func (m *ReplyMutation) Reply() (r string, exists bool)

Reply returns the value of the "reply" field in the mutation.

func (*ReplyMutation) ResetAdminId added in v1.3.4

func (m *ReplyMutation) ResetAdminId()

ResetAdminId resets all changes to the "adminId" field.

func (*ReplyMutation) ResetAdminName added in v1.3.4

func (m *ReplyMutation) ResetAdminName()

ResetAdminName resets all changes to the "adminName" field.

func (*ReplyMutation) ResetComment added in v1.3.4

func (m *ReplyMutation) ResetComment()

ResetComment resets all changes to the "comment" edge.

func (*ReplyMutation) ResetCommentID added in v1.3.4

func (m *ReplyMutation) ResetCommentID()

ResetCommentID resets all changes to the "comment_id" field.

func (*ReplyMutation) ResetCreateTime added in v1.3.4

func (m *ReplyMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*ReplyMutation) ResetCreatedAt added in v1.3.4

func (m *ReplyMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ReplyMutation) ResetEdge added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) ResetField added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) ResetReply added in v1.3.4

func (m *ReplyMutation) ResetReply()

ResetReply resets all changes to the "reply" field.

func (*ReplyMutation) ResetUpdateTime added in v1.3.4

func (m *ReplyMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*ReplyMutation) ResetUpdatedAt added in v1.3.4

func (m *ReplyMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ReplyMutation) SetAdminId added in v1.3.4

func (m *ReplyMutation) SetAdminId(s string)

SetAdminId sets the "adminId" field.

func (*ReplyMutation) SetAdminName added in v1.3.4

func (m *ReplyMutation) SetAdminName(s string)

SetAdminName sets the "adminName" field.

func (*ReplyMutation) SetCommentID added in v1.3.4

func (m *ReplyMutation) SetCommentID(u uint64)

SetCommentID sets the "comment_id" field.

func (*ReplyMutation) SetCreateTime added in v1.3.4

func (m *ReplyMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*ReplyMutation) SetCreatedAt added in v1.3.4

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

SetCreatedAt sets the "created_at" field.

func (*ReplyMutation) SetField added in v1.3.4

func (m *ReplyMutation) 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 (*ReplyMutation) SetID added in v1.3.4

func (m *ReplyMutation) SetID(id uint64)

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

func (*ReplyMutation) SetOp added in v1.3.4

func (m *ReplyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ReplyMutation) SetReply added in v1.3.4

func (m *ReplyMutation) SetReply(s string)

SetReply sets the "reply" field.

func (*ReplyMutation) SetUpdateTime added in v1.3.4

func (m *ReplyMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*ReplyMutation) SetUpdatedAt added in v1.3.4

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

SetUpdatedAt sets the "updated_at" field.

func (ReplyMutation) Tx added in v1.3.4

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

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

func (*ReplyMutation) Type added in v1.3.4

func (m *ReplyMutation) Type() string

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

func (*ReplyMutation) UpdateTime added in v1.3.4

func (m *ReplyMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*ReplyMutation) UpdatedAt added in v1.3.4

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

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

func (*ReplyMutation) Where added in v1.3.4

func (m *ReplyMutation) Where(ps ...predicate.Reply)

Where appends a list predicates to the ReplyMutation builder.

func (*ReplyMutation) WhereP added in v1.3.4

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

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

type ReplyPageList added in v1.3.14

type ReplyPageList struct {
	List        []*Reply     `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

ReplyPageList is Reply PageList result.

type ReplyPager added in v1.3.14

type ReplyPager struct {
	Order  reply.OrderOption
	Filter func(*ReplyQuery) (*ReplyQuery, error)
}

func (*ReplyPager) ApplyFilter added in v1.3.14

func (p *ReplyPager) ApplyFilter(query *ReplyQuery) (*ReplyQuery, error)

type ReplyPaginateOption added in v1.3.14

type ReplyPaginateOption func(*ReplyPager)

ReplyPaginateOption enables pagination customization.

type ReplyQuery added in v1.3.4

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

ReplyQuery is the builder for querying Reply entities.

func (*ReplyQuery) Aggregate added in v1.3.4

func (rq *ReplyQuery) Aggregate(fns ...AggregateFunc) *ReplySelect

Aggregate returns a ReplySelect configured with the given aggregations.

func (*ReplyQuery) All added in v1.3.4

func (rq *ReplyQuery) All(ctx context.Context) ([]*Reply, error)

All executes the query and returns a list of Replies.

func (*ReplyQuery) AllX added in v1.3.4

func (rq *ReplyQuery) AllX(ctx context.Context) []*Reply

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

func (*ReplyQuery) Clone added in v1.3.4

func (rq *ReplyQuery) Clone() *ReplyQuery

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

func (*ReplyQuery) Count added in v1.3.4

func (rq *ReplyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReplyQuery) CountX added in v1.3.4

func (rq *ReplyQuery) CountX(ctx context.Context) int

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

func (*ReplyQuery) ExecContext added in v1.3.14

func (c *ReplyQuery) 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 (*ReplyQuery) Exist added in v1.3.4

func (rq *ReplyQuery) Exist(ctx context.Context) (bool, error)

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

func (*ReplyQuery) ExistX added in v1.3.4

func (rq *ReplyQuery) ExistX(ctx context.Context) bool

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

func (*ReplyQuery) First added in v1.3.4

func (rq *ReplyQuery) First(ctx context.Context) (*Reply, error)

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

func (*ReplyQuery) FirstID added in v1.3.4

func (rq *ReplyQuery) FirstID(ctx context.Context) (id uint64, err error)

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

func (*ReplyQuery) FirstIDX added in v1.3.4

func (rq *ReplyQuery) FirstIDX(ctx context.Context) uint64

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

func (*ReplyQuery) FirstX added in v1.3.4

func (rq *ReplyQuery) FirstX(ctx context.Context) *Reply

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

func (*ReplyQuery) GroupBy added in v1.3.4

func (rq *ReplyQuery) GroupBy(field string, fields ...string) *ReplyGroupBy

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

func (*ReplyQuery) IDs added in v1.3.4

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

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

func (*ReplyQuery) IDsX added in v1.3.4

func (rq *ReplyQuery) IDsX(ctx context.Context) []uint64

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

func (*ReplyQuery) Limit added in v1.3.4

func (rq *ReplyQuery) Limit(limit int) *ReplyQuery

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

func (*ReplyQuery) Offset added in v1.3.4

func (rq *ReplyQuery) Offset(offset int) *ReplyQuery

Offset to start from.

func (*ReplyQuery) Only added in v1.3.4

func (rq *ReplyQuery) Only(ctx context.Context) (*Reply, error)

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

func (*ReplyQuery) OnlyID added in v1.3.4

func (rq *ReplyQuery) OnlyID(ctx context.Context) (id uint64, err error)

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

func (*ReplyQuery) OnlyIDX added in v1.3.4

func (rq *ReplyQuery) OnlyIDX(ctx context.Context) uint64

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

func (*ReplyQuery) OnlyX added in v1.3.4

func (rq *ReplyQuery) OnlyX(ctx context.Context) *Reply

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

func (*ReplyQuery) Order added in v1.3.4

func (rq *ReplyQuery) Order(o ...reply.OrderOption) *ReplyQuery

Order specifies how the records should be ordered.

func (*ReplyQuery) Page added in v1.3.14

func (r *ReplyQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...ReplyPaginateOption,
) (*ReplyPageList, error)

func (*ReplyQuery) QueryComment added in v1.3.4

func (rq *ReplyQuery) QueryComment() *CommentQuery

QueryComment chains the current query on the "comment" edge.

func (*ReplyQuery) QueryContext added in v1.3.14

func (c *ReplyQuery) 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 (*ReplyQuery) Select added in v1.3.4

func (rq *ReplyQuery) Select(fields ...string) *ReplySelect

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

func (*ReplyQuery) Unique added in v1.3.4

func (rq *ReplyQuery) Unique(unique bool) *ReplyQuery

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 (*ReplyQuery) Where added in v1.3.4

func (rq *ReplyQuery) Where(ps ...predicate.Reply) *ReplyQuery

Where adds a new predicate for the ReplyQuery builder.

func (*ReplyQuery) WithComment added in v1.3.4

func (rq *ReplyQuery) WithComment(opts ...func(*CommentQuery)) *ReplyQuery

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

type ReplySelect added in v1.3.4

type ReplySelect struct {
	*ReplyQuery
	// contains filtered or unexported fields
}

ReplySelect is the builder for selecting fields of Reply entities.

func (*ReplySelect) Aggregate added in v1.3.4

func (rs *ReplySelect) Aggregate(fns ...AggregateFunc) *ReplySelect

Aggregate adds the given aggregation functions to the selector query.

func (*ReplySelect) Bool added in v1.3.4

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

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

func (*ReplySelect) BoolX added in v1.3.4

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

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

func (*ReplySelect) Bools added in v1.3.4

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

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

func (*ReplySelect) BoolsX added in v1.3.4

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

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

func (ReplySelect) ExecContext added in v1.3.14

func (c ReplySelect) 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 (*ReplySelect) Float64 added in v1.3.4

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

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

func (*ReplySelect) Float64X added in v1.3.4

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

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

func (*ReplySelect) Float64s added in v1.3.4

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

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

func (*ReplySelect) Float64sX added in v1.3.4

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

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

func (*ReplySelect) Int added in v1.3.4

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

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

func (*ReplySelect) IntX added in v1.3.4

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

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

func (*ReplySelect) Ints added in v1.3.4

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

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

func (*ReplySelect) IntsX added in v1.3.4

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

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

func (ReplySelect) QueryContext added in v1.3.14

func (c ReplySelect) 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 (*ReplySelect) Scan added in v1.3.4

func (rs *ReplySelect) Scan(ctx context.Context, v any) error

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

func (*ReplySelect) ScanX added in v1.3.4

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

ScanX is like Scan, but panics if an error occurs.

func (*ReplySelect) String added in v1.3.4

func (s *ReplySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ReplySelect) StringX added in v1.3.4

func (s *ReplySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ReplySelect) Strings added in v1.3.4

func (s *ReplySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ReplySelect) StringsX added in v1.3.4

func (s *ReplySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ReplyUpdate added in v1.3.4

type ReplyUpdate struct {
	// contains filtered or unexported fields
}

ReplyUpdate is the builder for updating Reply entities.

func (*ReplyUpdate) ClearComment added in v1.3.4

func (ru *ReplyUpdate) ClearComment() *ReplyUpdate

ClearComment clears the "comment" edge to the Comment entity.

func (*ReplyUpdate) Exec added in v1.3.4

func (ru *ReplyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReplyUpdate) ExecContext added in v1.3.14

func (c *ReplyUpdate) 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 (*ReplyUpdate) ExecX added in v1.3.4

func (ru *ReplyUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReplyUpdate) Mutation added in v1.3.4

func (ru *ReplyUpdate) Mutation() *ReplyMutation

Mutation returns the ReplyMutation object of the builder.

func (*ReplyUpdate) QueryContext added in v1.3.14

func (c *ReplyUpdate) 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 (*ReplyUpdate) Save added in v1.3.4

func (ru *ReplyUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ReplyUpdate) SaveX added in v1.3.4

func (ru *ReplyUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ReplyUpdate) SetAdminId added in v1.3.4

func (ru *ReplyUpdate) SetAdminId(s string) *ReplyUpdate

SetAdminId sets the "adminId" field.

func (*ReplyUpdate) SetAdminName added in v1.3.4

func (ru *ReplyUpdate) SetAdminName(s string) *ReplyUpdate

SetAdminName sets the "adminName" field.

func (*ReplyUpdate) SetComment added in v1.3.4

func (ru *ReplyUpdate) SetComment(c *Comment) *ReplyUpdate

SetComment sets the "comment" edge to the Comment entity.

func (*ReplyUpdate) SetCommentID added in v1.3.4

func (ru *ReplyUpdate) SetCommentID(u uint64) *ReplyUpdate

SetCommentID sets the "comment_id" field.

func (*ReplyUpdate) SetCreateTime added in v1.3.4

func (ru *ReplyUpdate) SetCreateTime(t time.Time) *ReplyUpdate

SetCreateTime sets the "create_time" field.

func (*ReplyUpdate) SetNillableAdminId added in v1.3.4

func (ru *ReplyUpdate) SetNillableAdminId(s *string) *ReplyUpdate

SetNillableAdminId sets the "adminId" field if the given value is not nil.

func (*ReplyUpdate) SetNillableAdminName added in v1.3.4

func (ru *ReplyUpdate) SetNillableAdminName(s *string) *ReplyUpdate

SetNillableAdminName sets the "adminName" field if the given value is not nil.

func (*ReplyUpdate) SetNillableCommentID added in v1.3.4

func (ru *ReplyUpdate) SetNillableCommentID(u *uint64) *ReplyUpdate

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*ReplyUpdate) SetNillableCreateTime added in v1.3.4

func (ru *ReplyUpdate) SetNillableCreateTime(t *time.Time) *ReplyUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ReplyUpdate) SetNillableReply added in v1.3.4

func (ru *ReplyUpdate) SetNillableReply(s *string) *ReplyUpdate

SetNillableReply sets the "reply" field if the given value is not nil.

func (*ReplyUpdate) SetNillableUpdateTime added in v1.3.4

func (ru *ReplyUpdate) SetNillableUpdateTime(t *time.Time) *ReplyUpdate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ReplyUpdate) SetNotNilAdminId added in v1.3.14

func (r *ReplyUpdate) SetNotNilAdminId(value *string) *ReplyUpdate

set field if value's pointer is not nil.

func (*ReplyUpdate) SetNotNilAdminName added in v1.3.14

func (r *ReplyUpdate) SetNotNilAdminName(value *string) *ReplyUpdate

set field if value's pointer is not nil.

func (*ReplyUpdate) SetNotNilCommentID added in v1.3.14

func (r *ReplyUpdate) SetNotNilCommentID(value *uint64) *ReplyUpdate

set field if value's pointer is not nil.

func (*ReplyUpdate) SetNotNilCreateTime added in v1.3.14

func (r *ReplyUpdate) SetNotNilCreateTime(value *time.Time) *ReplyUpdate

set field if value's pointer is not nil.

func (*ReplyUpdate) SetNotNilReply added in v1.3.14

func (r *ReplyUpdate) SetNotNilReply(value *string) *ReplyUpdate

set field if value's pointer is not nil.

func (*ReplyUpdate) SetNotNilUpdateTime added in v1.3.14

func (r *ReplyUpdate) SetNotNilUpdateTime(value *time.Time) *ReplyUpdate

set field if value's pointer is not nil.

func (*ReplyUpdate) SetNotNilUpdatedAt added in v1.3.14

func (r *ReplyUpdate) SetNotNilUpdatedAt(value *time.Time) *ReplyUpdate

set field if value's pointer is not nil.

func (*ReplyUpdate) SetReply added in v1.3.4

func (ru *ReplyUpdate) SetReply(s string) *ReplyUpdate

SetReply sets the "reply" field.

func (*ReplyUpdate) SetUpdateTime added in v1.3.4

func (ru *ReplyUpdate) SetUpdateTime(t time.Time) *ReplyUpdate

SetUpdateTime sets the "update_time" field.

func (*ReplyUpdate) SetUpdatedAt added in v1.3.4

func (ru *ReplyUpdate) SetUpdatedAt(t time.Time) *ReplyUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ReplyUpdate) Where added in v1.3.4

func (ru *ReplyUpdate) Where(ps ...predicate.Reply) *ReplyUpdate

Where appends a list predicates to the ReplyUpdate builder.

type ReplyUpdateOne added in v1.3.4

type ReplyUpdateOne struct {
	// contains filtered or unexported fields
}

ReplyUpdateOne is the builder for updating a single Reply entity.

func (*ReplyUpdateOne) ClearComment added in v1.3.4

func (ruo *ReplyUpdateOne) ClearComment() *ReplyUpdateOne

ClearComment clears the "comment" edge to the Comment entity.

func (*ReplyUpdateOne) Exec added in v1.3.4

func (ruo *ReplyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReplyUpdateOne) ExecContext added in v1.3.14

func (c *ReplyUpdateOne) 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 (*ReplyUpdateOne) ExecX added in v1.3.4

func (ruo *ReplyUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ReplyUpdateOne) Mutation added in v1.3.4

func (ruo *ReplyUpdateOne) Mutation() *ReplyMutation

Mutation returns the ReplyMutation object of the builder.

func (*ReplyUpdateOne) QueryContext added in v1.3.14

func (c *ReplyUpdateOne) 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 (*ReplyUpdateOne) Save added in v1.3.4

func (ruo *ReplyUpdateOne) Save(ctx context.Context) (*Reply, error)

Save executes the query and returns the updated Reply entity.

func (*ReplyUpdateOne) SaveX added in v1.3.4

func (ruo *ReplyUpdateOne) SaveX(ctx context.Context) *Reply

SaveX is like Save, but panics if an error occurs.

func (*ReplyUpdateOne) Select added in v1.3.4

func (ruo *ReplyUpdateOne) Select(field string, fields ...string) *ReplyUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ReplyUpdateOne) SetAdminId added in v1.3.4

func (ruo *ReplyUpdateOne) SetAdminId(s string) *ReplyUpdateOne

SetAdminId sets the "adminId" field.

func (*ReplyUpdateOne) SetAdminName added in v1.3.4

func (ruo *ReplyUpdateOne) SetAdminName(s string) *ReplyUpdateOne

SetAdminName sets the "adminName" field.

func (*ReplyUpdateOne) SetComment added in v1.3.4

func (ruo *ReplyUpdateOne) SetComment(c *Comment) *ReplyUpdateOne

SetComment sets the "comment" edge to the Comment entity.

func (*ReplyUpdateOne) SetCommentID added in v1.3.4

func (ruo *ReplyUpdateOne) SetCommentID(u uint64) *ReplyUpdateOne

SetCommentID sets the "comment_id" field.

func (*ReplyUpdateOne) SetCreateTime added in v1.3.4

func (ruo *ReplyUpdateOne) SetCreateTime(t time.Time) *ReplyUpdateOne

SetCreateTime sets the "create_time" field.

func (*ReplyUpdateOne) SetNillableAdminId added in v1.3.4

func (ruo *ReplyUpdateOne) SetNillableAdminId(s *string) *ReplyUpdateOne

SetNillableAdminId sets the "adminId" field if the given value is not nil.

func (*ReplyUpdateOne) SetNillableAdminName added in v1.3.4

func (ruo *ReplyUpdateOne) SetNillableAdminName(s *string) *ReplyUpdateOne

SetNillableAdminName sets the "adminName" field if the given value is not nil.

func (*ReplyUpdateOne) SetNillableCommentID added in v1.3.4

func (ruo *ReplyUpdateOne) SetNillableCommentID(u *uint64) *ReplyUpdateOne

SetNillableCommentID sets the "comment_id" field if the given value is not nil.

func (*ReplyUpdateOne) SetNillableCreateTime added in v1.3.4

func (ruo *ReplyUpdateOne) SetNillableCreateTime(t *time.Time) *ReplyUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*ReplyUpdateOne) SetNillableReply added in v1.3.4

func (ruo *ReplyUpdateOne) SetNillableReply(s *string) *ReplyUpdateOne

SetNillableReply sets the "reply" field if the given value is not nil.

func (*ReplyUpdateOne) SetNillableUpdateTime added in v1.3.4

func (ruo *ReplyUpdateOne) SetNillableUpdateTime(t *time.Time) *ReplyUpdateOne

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*ReplyUpdateOne) SetNotNilAdminId added in v1.3.14

func (r *ReplyUpdateOne) SetNotNilAdminId(value *string) *ReplyUpdateOne

set field if value's pointer is not nil.

func (*ReplyUpdateOne) SetNotNilAdminName added in v1.3.14

func (r *ReplyUpdateOne) SetNotNilAdminName(value *string) *ReplyUpdateOne

set field if value's pointer is not nil.

func (*ReplyUpdateOne) SetNotNilCommentID added in v1.3.14

func (r *ReplyUpdateOne) SetNotNilCommentID(value *uint64) *ReplyUpdateOne

set field if value's pointer is not nil.

func (*ReplyUpdateOne) SetNotNilCreateTime added in v1.3.14

func (r *ReplyUpdateOne) SetNotNilCreateTime(value *time.Time) *ReplyUpdateOne

set field if value's pointer is not nil.

func (*ReplyUpdateOne) SetNotNilReply added in v1.3.14

func (r *ReplyUpdateOne) SetNotNilReply(value *string) *ReplyUpdateOne

set field if value's pointer is not nil.

func (*ReplyUpdateOne) SetNotNilUpdateTime added in v1.3.14

func (r *ReplyUpdateOne) SetNotNilUpdateTime(value *time.Time) *ReplyUpdateOne

set field if value's pointer is not nil.

func (*ReplyUpdateOne) SetNotNilUpdatedAt added in v1.3.14

func (r *ReplyUpdateOne) SetNotNilUpdatedAt(value *time.Time) *ReplyUpdateOne

set field if value's pointer is not nil.

func (*ReplyUpdateOne) SetReply added in v1.3.4

func (ruo *ReplyUpdateOne) SetReply(s string) *ReplyUpdateOne

SetReply sets the "reply" field.

func (*ReplyUpdateOne) SetUpdateTime added in v1.3.4

func (ruo *ReplyUpdateOne) SetUpdateTime(t time.Time) *ReplyUpdateOne

SetUpdateTime sets the "update_time" field.

func (*ReplyUpdateOne) SetUpdatedAt added in v1.3.4

func (ruo *ReplyUpdateOne) SetUpdatedAt(t time.Time) *ReplyUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ReplyUpdateOne) Where added in v1.3.4

func (ruo *ReplyUpdateOne) Where(ps ...predicate.Reply) *ReplyUpdateOne

Where appends a list predicates to the ReplyUpdate builder.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Token

type Token struct {

	// ID of the ent.
	// UUID
	ID uuid.UUID `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	//  User's UUID | 用户的UUID
	UUID uuid.UUID `json:"uuid,omitempty"`
	// Token string | Token 字符串
	Token string `json:"token,omitempty"`
	// 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

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

func (c *Token) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Token) String

func (t *Token) String() string

String implements the fmt.Stringer.

func (*Token) Unwrap

func (t *Token) Unwrap() *Token

Unwrap unwraps the Token entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Token) Update

func (t *Token) Update() *TokenUpdateOne

Update returns a builder for updating this Token. Note that you need to call Token.Unwrap() before calling this method if this Token was returned from a transaction, and the transaction was committed or rolled back.

func (*Token) Value

func (t *Token) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the Token. This includes values selected through modifiers, order, etc.

type TokenClient

type TokenClient struct {
	// contains filtered or unexported fields
}

TokenClient is a client for the Token schema.

func NewTokenClient

func NewTokenClient(c config) *TokenClient

NewTokenClient returns a client for the Token from the given config.

func (*TokenClient) Create

func (c *TokenClient) Create() *TokenCreate

Create returns a builder for creating a Token entity.

func (*TokenClient) CreateBulk

func (c *TokenClient) CreateBulk(builders ...*TokenCreate) *TokenCreateBulk

CreateBulk returns a builder for creating a bulk of Token entities.

func (*TokenClient) Delete

func (c *TokenClient) Delete() *TokenDelete

Delete returns a delete builder for Token.

func (*TokenClient) DeleteOne

func (c *TokenClient) DeleteOne(t *Token) *TokenDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TokenClient) DeleteOneID

func (c *TokenClient) DeleteOneID(id uuid.UUID) *TokenDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TokenClient) ExecContext

func (c *TokenClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenClient) Get

func (c *TokenClient) Get(ctx context.Context, id uuid.UUID) (*Token, error)

Get returns a Token entity by its id.

func (*TokenClient) GetX

func (c *TokenClient) GetX(ctx context.Context, id uuid.UUID) *Token

GetX is like Get, but panics if an error occurs.

func (*TokenClient) Hooks

func (c *TokenClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TokenClient) Intercept

func (c *TokenClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `token.Intercept(f(g(h())))`.

func (*TokenClient) Interceptors

func (c *TokenClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TokenClient) MapCreateBulk

func (c *TokenClient) MapCreateBulk(slice any, setFunc func(*TokenCreate, int)) *TokenCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*TokenClient) Query

func (c *TokenClient) Query() *TokenQuery

Query returns a query builder for Token.

func (*TokenClient) QueryContext

func (c *TokenClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenClient) Update

func (c *TokenClient) Update() *TokenUpdate

Update returns an update builder for Token.

func (*TokenClient) UpdateOne

func (c *TokenClient) UpdateOne(t *Token) *TokenUpdateOne

UpdateOne returns an update builder for the given entity.

func (*TokenClient) UpdateOneID

func (c *TokenClient) UpdateOneID(id uuid.UUID) *TokenUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TokenClient) Use

func (c *TokenClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `token.Hooks(f(g(h())))`.

type TokenCreate

type TokenCreate struct {
	// contains filtered or unexported fields
}

TokenCreate is the builder for creating a Token entity.

func (*TokenCreate) Exec

func (tc *TokenCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenCreate) ExecContext

func (c *TokenCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenCreate) ExecX

func (tc *TokenCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenCreate) Mutation

func (tc *TokenCreate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenCreate) QueryContext

func (c *TokenCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenCreate) Save

func (tc *TokenCreate) Save(ctx context.Context) (*Token, error)

Save creates the Token in the database.

func (*TokenCreate) SaveX

func (tc *TokenCreate) SaveX(ctx context.Context) *Token

SaveX calls Save and panics if Save returns an error.

func (*TokenCreate) SetCreatedAt

func (tc *TokenCreate) SetCreatedAt(t time.Time) *TokenCreate

SetCreatedAt sets the "created_at" field.

func (*TokenCreate) SetExpiredAt

func (tc *TokenCreate) SetExpiredAt(t time.Time) *TokenCreate

SetExpiredAt sets the "expired_at" field.

func (*TokenCreate) SetID

func (tc *TokenCreate) SetID(u uuid.UUID) *TokenCreate

SetID sets the "id" field.

func (*TokenCreate) SetNillableCreatedAt

func (tc *TokenCreate) SetNillableCreatedAt(t *time.Time) *TokenCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*TokenCreate) SetNillableID

func (tc *TokenCreate) SetNillableID(u *uuid.UUID) *TokenCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*TokenCreate) SetNillableStatus

func (tc *TokenCreate) SetNillableStatus(u *uint8) *TokenCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TokenCreate) SetNillableUpdatedAt

func (tc *TokenCreate) SetNillableUpdatedAt(t *time.Time) *TokenCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*TokenCreate) SetNillableUsername

func (tc *TokenCreate) SetNillableUsername(s *string) *TokenCreate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*TokenCreate) SetNotNilExpiredAt

func (t *TokenCreate) SetNotNilExpiredAt(value *time.Time) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilSource

func (t *TokenCreate) SetNotNilSource(value *string) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilStatus

func (t *TokenCreate) SetNotNilStatus(value *uint8) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilToken

func (t *TokenCreate) SetNotNilToken(value *string) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilUUID

func (t *TokenCreate) SetNotNilUUID(value *uuid.UUID) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilUpdatedAt

func (t *TokenCreate) SetNotNilUpdatedAt(value *time.Time) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetNotNilUsername

func (t *TokenCreate) SetNotNilUsername(value *string) *TokenCreate

set field if value's pointer is not nil.

func (*TokenCreate) SetSource

func (tc *TokenCreate) SetSource(s string) *TokenCreate

SetSource sets the "source" field.

func (*TokenCreate) SetStatus

func (tc *TokenCreate) SetStatus(u uint8) *TokenCreate

SetStatus sets the "status" field.

func (*TokenCreate) SetToken

func (tc *TokenCreate) SetToken(s string) *TokenCreate

SetToken sets the "token" field.

func (*TokenCreate) SetUUID

func (tc *TokenCreate) SetUUID(u uuid.UUID) *TokenCreate

SetUUID sets the "uuid" field.

func (*TokenCreate) SetUpdatedAt

func (tc *TokenCreate) SetUpdatedAt(t time.Time) *TokenCreate

SetUpdatedAt sets the "updated_at" field.

func (*TokenCreate) SetUsername

func (tc *TokenCreate) SetUsername(s string) *TokenCreate

SetUsername sets the "username" field.

type TokenCreateBulk

type TokenCreateBulk struct {
	// contains filtered or unexported fields
}

TokenCreateBulk is the builder for creating many Token entities in bulk.

func (*TokenCreateBulk) Exec

func (tcb *TokenCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenCreateBulk) ExecContext

func (c *TokenCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenCreateBulk) ExecX

func (tcb *TokenCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenCreateBulk) QueryContext

func (c *TokenCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenCreateBulk) Save

func (tcb *TokenCreateBulk) Save(ctx context.Context) ([]*Token, error)

Save creates the Token entities in the database.

func (*TokenCreateBulk) SaveX

func (tcb *TokenCreateBulk) SaveX(ctx context.Context) []*Token

SaveX is like Save, but panics if an error occurs.

type TokenDelete

type TokenDelete struct {
	// contains filtered or unexported fields
}

TokenDelete is the builder for deleting a Token entity.

func (*TokenDelete) Exec

func (td *TokenDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TokenDelete) ExecContext

func (c *TokenDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenDelete) ExecX

func (td *TokenDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TokenDelete) QueryContext

func (c *TokenDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenDelete) Where

func (td *TokenDelete) Where(ps ...predicate.Token) *TokenDelete

Where appends a list predicates to the TokenDelete builder.

type TokenDeleteOne

type TokenDeleteOne struct {
	// contains filtered or unexported fields
}

TokenDeleteOne is the builder for deleting a single Token entity.

func (*TokenDeleteOne) Exec

func (tdo *TokenDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TokenDeleteOne) ExecX

func (tdo *TokenDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenDeleteOne) Where

func (tdo *TokenDeleteOne) Where(ps ...predicate.Token) *TokenDeleteOne

Where appends a list predicates to the TokenDelete builder.

type TokenGroupBy

type TokenGroupBy struct {
	// contains filtered or unexported fields
}

TokenGroupBy is the group-by builder for Token entities.

func (*TokenGroupBy) Aggregate

func (tgb *TokenGroupBy) Aggregate(fns ...AggregateFunc) *TokenGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TokenGroupBy) Bool

func (s *TokenGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) BoolX

func (s *TokenGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TokenGroupBy) Bools

func (s *TokenGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) BoolsX

func (s *TokenGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TokenGroupBy) Float64

func (s *TokenGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) Float64X

func (s *TokenGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TokenGroupBy) Float64s

func (s *TokenGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) Float64sX

func (s *TokenGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TokenGroupBy) Int

func (s *TokenGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) IntX

func (s *TokenGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TokenGroupBy) Ints

func (s *TokenGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) IntsX

func (s *TokenGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TokenGroupBy) Scan

func (tgb *TokenGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TokenGroupBy) ScanX

func (s *TokenGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TokenGroupBy) String

func (s *TokenGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) StringX

func (s *TokenGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TokenGroupBy) Strings

func (s *TokenGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TokenGroupBy) StringsX

func (s *TokenGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TokenMutation

type TokenMutation struct {
	// contains filtered or unexported fields
}

TokenMutation represents an operation that mutates the Token nodes in the graph.

func (*TokenMutation) AddField

func (m *TokenMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TokenMutation) AddStatus

func (m *TokenMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*TokenMutation) AddedEdges

func (m *TokenMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TokenMutation) AddedField

func (m *TokenMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TokenMutation) AddedFields

func (m *TokenMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TokenMutation) AddedIDs

func (m *TokenMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TokenMutation) AddedStatus

func (m *TokenMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*TokenMutation) ClearEdge

func (m *TokenMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*TokenMutation) ClearField

func (m *TokenMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*TokenMutation) ClearStatus

func (m *TokenMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*TokenMutation) ClearedEdges

func (m *TokenMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TokenMutation) ClearedFields

func (m *TokenMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TokenMutation) Client

func (m TokenMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*TokenMutation) CreatedAt

func (m *TokenMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*TokenMutation) EdgeCleared

func (m *TokenMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TokenMutation) ExecContext

func (c *TokenMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenMutation) ExpiredAt

func (m *TokenMutation) ExpiredAt() (r time.Time, exists bool)

ExpiredAt returns the value of the "expired_at" field in the mutation.

func (*TokenMutation) Field

func (m *TokenMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TokenMutation) FieldCleared

func (m *TokenMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TokenMutation) Fields

func (m *TokenMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*TokenMutation) ID

func (m *TokenMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*TokenMutation) IDs

func (m *TokenMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*TokenMutation) OldCreatedAt

func (m *TokenMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldExpiredAt

func (m *TokenMutation) OldExpiredAt(ctx context.Context) (v time.Time, err error)

OldExpiredAt returns the old "expired_at" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldField

func (m *TokenMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*TokenMutation) OldSource

func (m *TokenMutation) OldSource(ctx context.Context) (v string, err error)

OldSource returns the old "source" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldStatus

func (m *TokenMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldToken

func (m *TokenMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldUUID

func (m *TokenMutation) OldUUID(ctx context.Context) (v uuid.UUID, err error)

OldUUID returns the old "uuid" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldUpdatedAt

func (m *TokenMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Token entity. If the Token object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TokenMutation) OldUsername

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

func (m *TokenMutation) Op() Op

Op returns the operation name.

func (*TokenMutation) QueryContext

func (c *TokenMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenMutation) RemovedEdges

func (m *TokenMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TokenMutation) RemovedIDs

func (m *TokenMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*TokenMutation) ResetCreatedAt

func (m *TokenMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*TokenMutation) ResetEdge

func (m *TokenMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*TokenMutation) ResetExpiredAt

func (m *TokenMutation) ResetExpiredAt()

ResetExpiredAt resets all changes to the "expired_at" field.

func (*TokenMutation) ResetField

func (m *TokenMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*TokenMutation) ResetSource

func (m *TokenMutation) ResetSource()

ResetSource resets all changes to the "source" field.

func (*TokenMutation) ResetStatus

func (m *TokenMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TokenMutation) ResetToken

func (m *TokenMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*TokenMutation) ResetUUID

func (m *TokenMutation) ResetUUID()

ResetUUID resets all changes to the "uuid" field.

func (*TokenMutation) ResetUpdatedAt

func (m *TokenMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*TokenMutation) ResetUsername

func (m *TokenMutation) ResetUsername()

ResetUsername resets all changes to the "username" field.

func (*TokenMutation) SetCreatedAt

func (m *TokenMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*TokenMutation) SetExpiredAt

func (m *TokenMutation) SetExpiredAt(t time.Time)

SetExpiredAt sets the "expired_at" field.

func (*TokenMutation) SetField

func (m *TokenMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TokenMutation) SetID

func (m *TokenMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Token entities.

func (*TokenMutation) SetOp

func (m *TokenMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TokenMutation) SetSource

func (m *TokenMutation) SetSource(s string)

SetSource sets the "source" field.

func (*TokenMutation) SetStatus

func (m *TokenMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*TokenMutation) SetToken

func (m *TokenMutation) SetToken(s string)

SetToken sets the "token" field.

func (*TokenMutation) SetUUID

func (m *TokenMutation) SetUUID(u uuid.UUID)

SetUUID sets the "uuid" field.

func (*TokenMutation) SetUpdatedAt

func (m *TokenMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*TokenMutation) SetUsername

func (m *TokenMutation) SetUsername(s string)

SetUsername sets the "username" field.

func (*TokenMutation) Source

func (m *TokenMutation) Source() (r string, exists bool)

Source returns the value of the "source" field in the mutation.

func (*TokenMutation) Status

func (m *TokenMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*TokenMutation) StatusCleared

func (m *TokenMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (*TokenMutation) Token

func (m *TokenMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (TokenMutation) Tx

func (m TokenMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TokenMutation) Type

func (m *TokenMutation) Type() string

Type returns the node type of this mutation (Token).

func (*TokenMutation) UUID

func (m *TokenMutation) UUID() (r uuid.UUID, exists bool)

UUID returns the value of the "uuid" field in the mutation.

func (*TokenMutation) UpdatedAt

func (m *TokenMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*TokenMutation) Username

func (m *TokenMutation) Username() (r string, exists bool)

Username returns the value of the "username" field in the mutation.

func (*TokenMutation) Where

func (m *TokenMutation) Where(ps ...predicate.Token)

Where appends a list predicates to the TokenMutation builder.

func (*TokenMutation) WhereP

func (m *TokenMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TokenMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TokenPageList

type TokenPageList struct {
	List        []*Token     `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

TokenPageList is Token PageList result.

type TokenPager

type TokenPager struct {
	Order  token.OrderOption
	Filter func(*TokenQuery) (*TokenQuery, error)
}

func (*TokenPager) ApplyFilter

func (p *TokenPager) ApplyFilter(query *TokenQuery) (*TokenQuery, error)

type TokenPaginateOption

type TokenPaginateOption func(*TokenPager)

TokenPaginateOption enables pagination customization.

type TokenQuery

type TokenQuery struct {
	// contains filtered or unexported fields
}

TokenQuery is the builder for querying Token entities.

func (*TokenQuery) Aggregate

func (tq *TokenQuery) Aggregate(fns ...AggregateFunc) *TokenSelect

Aggregate returns a TokenSelect configured with the given aggregations.

func (*TokenQuery) All

func (tq *TokenQuery) All(ctx context.Context) ([]*Token, error)

All executes the query and returns a list of Tokens.

func (*TokenQuery) AllX

func (tq *TokenQuery) AllX(ctx context.Context) []*Token

AllX is like All, but panics if an error occurs.

func (*TokenQuery) Clone

func (tq *TokenQuery) Clone() *TokenQuery

Clone returns a duplicate of the TokenQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TokenQuery) Count

func (tq *TokenQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TokenQuery) CountX

func (tq *TokenQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TokenQuery) ExecContext

func (c *TokenQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenQuery) Exist

func (tq *TokenQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TokenQuery) ExistX

func (tq *TokenQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TokenQuery) First

func (tq *TokenQuery) First(ctx context.Context) (*Token, error)

First returns the first Token entity from the query. Returns a *NotFoundError when no Token was found.

func (*TokenQuery) FirstID

func (tq *TokenQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first Token ID from the query. Returns a *NotFoundError when no Token ID was found.

func (*TokenQuery) FirstIDX

func (tq *TokenQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*TokenQuery) FirstX

func (tq *TokenQuery) FirstX(ctx context.Context) *Token

FirstX is like First, but panics if an error occurs.

func (*TokenQuery) GroupBy

func (tq *TokenQuery) GroupBy(field string, fields ...string) *TokenGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Token.Query().
	GroupBy(token.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TokenQuery) IDs

func (tq *TokenQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of Token IDs.

func (*TokenQuery) IDsX

func (tq *TokenQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*TokenQuery) Limit

func (tq *TokenQuery) Limit(limit int) *TokenQuery

Limit the number of records to be returned by this query.

func (*TokenQuery) Offset

func (tq *TokenQuery) Offset(offset int) *TokenQuery

Offset to start from.

func (*TokenQuery) Only

func (tq *TokenQuery) Only(ctx context.Context) (*Token, error)

Only returns a single Token entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Token entity is found. Returns a *NotFoundError when no Token entities are found.

func (*TokenQuery) OnlyID

func (tq *TokenQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only Token ID in the query. Returns a *NotSingularError when more than one Token ID is found. Returns a *NotFoundError when no entities are found.

func (*TokenQuery) OnlyIDX

func (tq *TokenQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TokenQuery) OnlyX

func (tq *TokenQuery) OnlyX(ctx context.Context) *Token

OnlyX is like Only, but panics if an error occurs.

func (*TokenQuery) Order

func (tq *TokenQuery) Order(o ...token.OrderOption) *TokenQuery

Order specifies how the records should be ordered.

func (*TokenQuery) Page

func (t *TokenQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...TokenPaginateOption,
) (*TokenPageList, error)

func (*TokenQuery) QueryContext

func (c *TokenQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenQuery) Select

func (tq *TokenQuery) Select(fields ...string) *TokenSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.Token.Query().
	Select(token.FieldCreatedAt).
	Scan(ctx, &v)

func (*TokenQuery) Unique

func (tq *TokenQuery) Unique(unique bool) *TokenQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*TokenQuery) Where

func (tq *TokenQuery) Where(ps ...predicate.Token) *TokenQuery

Where adds a new predicate for the TokenQuery builder.

type TokenSelect

type TokenSelect struct {
	*TokenQuery
	// contains filtered or unexported fields
}

TokenSelect is the builder for selecting fields of Token entities.

func (*TokenSelect) Aggregate

func (ts *TokenSelect) Aggregate(fns ...AggregateFunc) *TokenSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TokenSelect) Bool

func (s *TokenSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TokenSelect) BoolX

func (s *TokenSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TokenSelect) Bools

func (s *TokenSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TokenSelect) BoolsX

func (s *TokenSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (TokenSelect) ExecContext

func (c TokenSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenSelect) Float64

func (s *TokenSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TokenSelect) Float64X

func (s *TokenSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TokenSelect) Float64s

func (s *TokenSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TokenSelect) Float64sX

func (s *TokenSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TokenSelect) Int

func (s *TokenSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TokenSelect) IntX

func (s *TokenSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TokenSelect) Ints

func (s *TokenSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TokenSelect) IntsX

func (s *TokenSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (TokenSelect) QueryContext

func (c TokenSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenSelect) Scan

func (ts *TokenSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TokenSelect) ScanX

func (s *TokenSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TokenSelect) String

func (s *TokenSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TokenSelect) StringX

func (s *TokenSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TokenSelect) Strings

func (s *TokenSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TokenSelect) StringsX

func (s *TokenSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TokenUpdate

type TokenUpdate struct {
	// contains filtered or unexported fields
}

TokenUpdate is the builder for updating Token entities.

func (*TokenUpdate) AddStatus

func (tu *TokenUpdate) AddStatus(u int8) *TokenUpdate

AddStatus adds u to the "status" field.

func (*TokenUpdate) ClearStatus

func (tu *TokenUpdate) ClearStatus() *TokenUpdate

ClearStatus clears the value of the "status" field.

func (*TokenUpdate) Exec

func (tu *TokenUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TokenUpdate) ExecContext

func (c *TokenUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenUpdate) ExecX

func (tu *TokenUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUpdate) Mutation

func (tu *TokenUpdate) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdate) QueryContext

func (c *TokenUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenUpdate) Save

func (tu *TokenUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TokenUpdate) SaveX

func (tu *TokenUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TokenUpdate) SetExpiredAt

func (tu *TokenUpdate) SetExpiredAt(t time.Time) *TokenUpdate

SetExpiredAt sets the "expired_at" field.

func (*TokenUpdate) SetNillableExpiredAt

func (tu *TokenUpdate) SetNillableExpiredAt(t *time.Time) *TokenUpdate

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*TokenUpdate) SetNillableSource

func (tu *TokenUpdate) SetNillableSource(s *string) *TokenUpdate

SetNillableSource sets the "source" field if the given value is not nil.

func (*TokenUpdate) SetNillableStatus

func (tu *TokenUpdate) SetNillableStatus(u *uint8) *TokenUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TokenUpdate) SetNillableToken

func (tu *TokenUpdate) SetNillableToken(s *string) *TokenUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*TokenUpdate) SetNillableUUID

func (tu *TokenUpdate) SetNillableUUID(u *uuid.UUID) *TokenUpdate

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*TokenUpdate) SetNillableUsername

func (tu *TokenUpdate) SetNillableUsername(s *string) *TokenUpdate

SetNillableUsername sets the "username" field if the given value is not nil.

func (*TokenUpdate) SetNotNilExpiredAt

func (t *TokenUpdate) SetNotNilExpiredAt(value *time.Time) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilSource

func (t *TokenUpdate) SetNotNilSource(value *string) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilStatus

func (t *TokenUpdate) SetNotNilStatus(value *uint8) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilToken

func (t *TokenUpdate) SetNotNilToken(value *string) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilUUID

func (t *TokenUpdate) SetNotNilUUID(value *uuid.UUID) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilUpdatedAt

func (t *TokenUpdate) SetNotNilUpdatedAt(value *time.Time) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetNotNilUsername

func (t *TokenUpdate) SetNotNilUsername(value *string) *TokenUpdate

set field if value's pointer is not nil.

func (*TokenUpdate) SetSource

func (tu *TokenUpdate) SetSource(s string) *TokenUpdate

SetSource sets the "source" field.

func (*TokenUpdate) SetStatus

func (tu *TokenUpdate) SetStatus(u uint8) *TokenUpdate

SetStatus sets the "status" field.

func (*TokenUpdate) SetToken

func (tu *TokenUpdate) SetToken(s string) *TokenUpdate

SetToken sets the "token" field.

func (*TokenUpdate) SetUUID

func (tu *TokenUpdate) SetUUID(u uuid.UUID) *TokenUpdate

SetUUID sets the "uuid" field.

func (*TokenUpdate) SetUpdatedAt

func (tu *TokenUpdate) SetUpdatedAt(t time.Time) *TokenUpdate

SetUpdatedAt sets the "updated_at" field.

func (*TokenUpdate) SetUsername

func (tu *TokenUpdate) SetUsername(s string) *TokenUpdate

SetUsername sets the "username" field.

func (*TokenUpdate) Where

func (tu *TokenUpdate) Where(ps ...predicate.Token) *TokenUpdate

Where appends a list predicates to the TokenUpdate builder.

type TokenUpdateOne

type TokenUpdateOne struct {
	// contains filtered or unexported fields
}

TokenUpdateOne is the builder for updating a single Token entity.

func (*TokenUpdateOne) AddStatus

func (tuo *TokenUpdateOne) AddStatus(u int8) *TokenUpdateOne

AddStatus adds u to the "status" field.

func (*TokenUpdateOne) ClearStatus

func (tuo *TokenUpdateOne) ClearStatus() *TokenUpdateOne

ClearStatus clears the value of the "status" field.

func (*TokenUpdateOne) Exec

func (tuo *TokenUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TokenUpdateOne) ExecContext

func (c *TokenUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*TokenUpdateOne) ExecX

func (tuo *TokenUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TokenUpdateOne) Mutation

func (tuo *TokenUpdateOne) Mutation() *TokenMutation

Mutation returns the TokenMutation object of the builder.

func (*TokenUpdateOne) QueryContext

func (c *TokenUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*TokenUpdateOne) Save

func (tuo *TokenUpdateOne) Save(ctx context.Context) (*Token, error)

Save executes the query and returns the updated Token entity.

func (*TokenUpdateOne) SaveX

func (tuo *TokenUpdateOne) SaveX(ctx context.Context) *Token

SaveX is like Save, but panics if an error occurs.

func (*TokenUpdateOne) Select

func (tuo *TokenUpdateOne) Select(field string, fields ...string) *TokenUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TokenUpdateOne) SetExpiredAt

func (tuo *TokenUpdateOne) SetExpiredAt(t time.Time) *TokenUpdateOne

SetExpiredAt sets the "expired_at" field.

func (*TokenUpdateOne) SetNillableExpiredAt

func (tuo *TokenUpdateOne) SetNillableExpiredAt(t *time.Time) *TokenUpdateOne

SetNillableExpiredAt sets the "expired_at" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableSource

func (tuo *TokenUpdateOne) SetNillableSource(s *string) *TokenUpdateOne

SetNillableSource sets the "source" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableStatus

func (tuo *TokenUpdateOne) SetNillableStatus(u *uint8) *TokenUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableToken

func (tuo *TokenUpdateOne) SetNillableToken(s *string) *TokenUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableUUID

func (tuo *TokenUpdateOne) SetNillableUUID(u *uuid.UUID) *TokenUpdateOne

SetNillableUUID sets the "uuid" field if the given value is not nil.

func (*TokenUpdateOne) SetNillableUsername

func (tuo *TokenUpdateOne) SetNillableUsername(s *string) *TokenUpdateOne

SetNillableUsername sets the "username" field if the given value is not nil.

func (*TokenUpdateOne) SetNotNilExpiredAt

func (t *TokenUpdateOne) SetNotNilExpiredAt(value *time.Time) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilSource

func (t *TokenUpdateOne) SetNotNilSource(value *string) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilStatus

func (t *TokenUpdateOne) SetNotNilStatus(value *uint8) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilToken

func (t *TokenUpdateOne) SetNotNilToken(value *string) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilUUID

func (t *TokenUpdateOne) SetNotNilUUID(value *uuid.UUID) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilUpdatedAt

func (t *TokenUpdateOne) SetNotNilUpdatedAt(value *time.Time) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetNotNilUsername

func (t *TokenUpdateOne) SetNotNilUsername(value *string) *TokenUpdateOne

set field if value's pointer is not nil.

func (*TokenUpdateOne) SetSource

func (tuo *TokenUpdateOne) SetSource(s string) *TokenUpdateOne

SetSource sets the "source" field.

func (*TokenUpdateOne) SetStatus

func (tuo *TokenUpdateOne) SetStatus(u uint8) *TokenUpdateOne

SetStatus sets the "status" field.

func (*TokenUpdateOne) SetToken

func (tuo *TokenUpdateOne) SetToken(s string) *TokenUpdateOne

SetToken sets the "token" field.

func (*TokenUpdateOne) SetUUID

func (tuo *TokenUpdateOne) SetUUID(u uuid.UUID) *TokenUpdateOne

SetUUID sets the "uuid" field.

func (*TokenUpdateOne) SetUpdatedAt

func (tuo *TokenUpdateOne) SetUpdatedAt(t time.Time) *TokenUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*TokenUpdateOne) SetUsername

func (tuo *TokenUpdateOne) SetUsername(s string) *TokenUpdateOne

SetUsername sets the "username" field.

func (*TokenUpdateOne) Where

func (tuo *TokenUpdateOne) Where(ps ...predicate.Token) *TokenUpdateOne

Where appends a list predicates to the TokenUpdate builder.

type Tokens

type Tokens []*Token

Tokens is a parsable slice of Token.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Comment is the client for interacting with the Comment builders.
	Comment *CommentClient
	// 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
	// Reply is the client for interacting with the Reply builders.
	Reply *ReplyClient
	// 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

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

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