ent

package
v0.0.0-...-aa092f0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 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.
	TypeRdMessage           = "RdMessage"
	TypeRdMoment            = "RdMoment"
	TypeRdRMomentsFollowing = "RdRMomentsFollowing"
	TypeRdRUserFollowers    = "RdRUserFollowers"
	TypeRdRUserFollowing    = "RdRUserFollowing"
	TypeRdUser              = "RdUser"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type 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
	// RdMessage is the client for interacting with the RdMessage builders.
	RdMessage *RdMessageClient
	// RdMoment is the client for interacting with the RdMoment builders.
	RdMoment *RdMomentClient
	// RdRMomentsFollowing is the client for interacting with the RdRMomentsFollowing builders.
	RdRMomentsFollowing *RdRMomentsFollowingClient
	// RdRUserFollowers is the client for interacting with the RdRUserFollowers builders.
	RdRUserFollowers *RdRUserFollowersClient
	// RdRUserFollowing is the client for interacting with the RdRUserFollowing builders.
	RdRUserFollowing *RdRUserFollowingClient
	// RdUser is the client for interacting with the RdUser builders.
	RdUser *RdUserClient
	// 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().
	RdMessage.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RdMessage

type RdMessage struct {

	// ID of the ent.
	// 消息ID
	ID int32 `json:"id,omitempty"`
	// 发送者id
	SenderUID int32 `json:"sender_uid,omitempty"`
	// 接收者id
	RecverUID int32 `json:"recver_uid,omitempty"`
	// 聊天内容
	Content *biz.Content `json:"content,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

RdMessage is the model entity for the RdMessage schema.

func (*RdMessage) String

func (rm *RdMessage) String() string

String implements the fmt.Stringer.

func (*RdMessage) Unwrap

func (rm *RdMessage) Unwrap() *RdMessage

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

func (rm *RdMessage) Update() *RdMessageUpdateOne

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

type RdMessageClient

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

RdMessageClient is a client for the RdMessage schema.

func NewRdMessageClient

func NewRdMessageClient(c config) *RdMessageClient

NewRdMessageClient returns a client for the RdMessage from the given config.

func (*RdMessageClient) Create

func (c *RdMessageClient) Create() *RdMessageCreate

Create returns a builder for creating a RdMessage entity.

func (*RdMessageClient) CreateBulk

func (c *RdMessageClient) CreateBulk(builders ...*RdMessageCreate) *RdMessageCreateBulk

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

func (*RdMessageClient) Delete

func (c *RdMessageClient) Delete() *RdMessageDelete

Delete returns a delete builder for RdMessage.

func (*RdMessageClient) DeleteOne

func (c *RdMessageClient) DeleteOne(rm *RdMessage) *RdMessageDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RdMessageClient) DeleteOneID

func (c *RdMessageClient) DeleteOneID(id int32) *RdMessageDeleteOne

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

func (*RdMessageClient) Get

func (c *RdMessageClient) Get(ctx context.Context, id int32) (*RdMessage, error)

Get returns a RdMessage entity by its id.

func (*RdMessageClient) GetX

func (c *RdMessageClient) GetX(ctx context.Context, id int32) *RdMessage

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

func (*RdMessageClient) Hooks

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

Hooks returns the client hooks.

func (*RdMessageClient) Intercept

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

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

func (*RdMessageClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RdMessageClient) Query

func (c *RdMessageClient) Query() *RdMessageQuery

Query returns a query builder for RdMessage.

func (*RdMessageClient) Update

func (c *RdMessageClient) Update() *RdMessageUpdate

Update returns an update builder for RdMessage.

func (*RdMessageClient) UpdateOne

func (c *RdMessageClient) UpdateOne(rm *RdMessage) *RdMessageUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RdMessageClient) UpdateOneID

func (c *RdMessageClient) UpdateOneID(id int32) *RdMessageUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RdMessageClient) Use

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

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

type RdMessageCreate

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

RdMessageCreate is the builder for creating a RdMessage entity.

func (*RdMessageCreate) Exec

func (rmc *RdMessageCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RdMessageCreate) ExecX

func (rmc *RdMessageCreate) ExecX(ctx context.Context)

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

func (*RdMessageCreate) Mutation

func (rmc *RdMessageCreate) Mutation() *RdMessageMutation

Mutation returns the RdMessageMutation object of the builder.

func (*RdMessageCreate) Save

func (rmc *RdMessageCreate) Save(ctx context.Context) (*RdMessage, error)

Save creates the RdMessage in the database.

func (*RdMessageCreate) SaveX

func (rmc *RdMessageCreate) SaveX(ctx context.Context) *RdMessage

SaveX calls Save and panics if Save returns an error.

func (*RdMessageCreate) SetContent

func (rmc *RdMessageCreate) SetContent(b *biz.Content) *RdMessageCreate

SetContent sets the "content" field.

func (*RdMessageCreate) SetCreateTime

func (rmc *RdMessageCreate) SetCreateTime(t time.Time) *RdMessageCreate

SetCreateTime sets the "create_time" field.

func (*RdMessageCreate) SetID

func (rmc *RdMessageCreate) SetID(i int32) *RdMessageCreate

SetID sets the "id" field.

func (*RdMessageCreate) SetNillableCreateTime

func (rmc *RdMessageCreate) SetNillableCreateTime(t *time.Time) *RdMessageCreate

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

func (*RdMessageCreate) SetNillableRecverUID

func (rmc *RdMessageCreate) SetNillableRecverUID(i *int32) *RdMessageCreate

SetNillableRecverUID sets the "recver_uid" field if the given value is not nil.

func (*RdMessageCreate) SetNillableSenderUID

func (rmc *RdMessageCreate) SetNillableSenderUID(i *int32) *RdMessageCreate

SetNillableSenderUID sets the "sender_uid" field if the given value is not nil.

func (*RdMessageCreate) SetRecverUID

func (rmc *RdMessageCreate) SetRecverUID(i int32) *RdMessageCreate

SetRecverUID sets the "recver_uid" field.

func (*RdMessageCreate) SetSenderUID

func (rmc *RdMessageCreate) SetSenderUID(i int32) *RdMessageCreate

SetSenderUID sets the "sender_uid" field.

type RdMessageCreateBulk

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

RdMessageCreateBulk is the builder for creating many RdMessage entities in bulk.

func (*RdMessageCreateBulk) Exec

func (rmcb *RdMessageCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RdMessageCreateBulk) ExecX

func (rmcb *RdMessageCreateBulk) ExecX(ctx context.Context)

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

func (*RdMessageCreateBulk) Save

func (rmcb *RdMessageCreateBulk) Save(ctx context.Context) ([]*RdMessage, error)

Save creates the RdMessage entities in the database.

func (*RdMessageCreateBulk) SaveX

func (rmcb *RdMessageCreateBulk) SaveX(ctx context.Context) []*RdMessage

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

type RdMessageDelete

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

RdMessageDelete is the builder for deleting a RdMessage entity.

func (*RdMessageDelete) Exec

func (rmd *RdMessageDelete) Exec(ctx context.Context) (int, error)

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

func (*RdMessageDelete) ExecX

func (rmd *RdMessageDelete) ExecX(ctx context.Context) int

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

func (*RdMessageDelete) Where

Where appends a list predicates to the RdMessageDelete builder.

type RdMessageDeleteOne

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

RdMessageDeleteOne is the builder for deleting a single RdMessage entity.

func (*RdMessageDeleteOne) Exec

func (rmdo *RdMessageDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RdMessageDeleteOne) ExecX

func (rmdo *RdMessageDeleteOne) ExecX(ctx context.Context)

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

type RdMessageGroupBy

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

RdMessageGroupBy is the group-by builder for RdMessage entities.

func (*RdMessageGroupBy) Aggregate

func (rmgb *RdMessageGroupBy) Aggregate(fns ...AggregateFunc) *RdMessageGroupBy

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

func (*RdMessageGroupBy) Bool

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

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

func (*RdMessageGroupBy) BoolX

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

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

func (*RdMessageGroupBy) Bools

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

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

func (*RdMessageGroupBy) BoolsX

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

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

func (*RdMessageGroupBy) Float64

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

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

func (*RdMessageGroupBy) Float64X

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

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

func (*RdMessageGroupBy) Float64s

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

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

func (*RdMessageGroupBy) Float64sX

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

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

func (*RdMessageGroupBy) Int

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

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

func (*RdMessageGroupBy) IntX

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

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

func (*RdMessageGroupBy) Ints

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

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

func (*RdMessageGroupBy) IntsX

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

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

func (*RdMessageGroupBy) Scan

func (rmgb *RdMessageGroupBy) Scan(ctx context.Context, v any) error

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

func (*RdMessageGroupBy) ScanX

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

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

func (*RdMessageGroupBy) String

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

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

func (*RdMessageGroupBy) StringX

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

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

func (*RdMessageGroupBy) Strings

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

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

func (*RdMessageGroupBy) StringsX

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

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

type RdMessageMutation

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

RdMessageMutation represents an operation that mutates the RdMessage nodes in the graph.

func (*RdMessageMutation) AddField

func (m *RdMessageMutation) 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 (*RdMessageMutation) AddRecverUID

func (m *RdMessageMutation) AddRecverUID(i int32)

AddRecverUID adds i to the "recver_uid" field.

func (*RdMessageMutation) AddSenderUID

func (m *RdMessageMutation) AddSenderUID(i int32)

AddSenderUID adds i to the "sender_uid" field.

func (*RdMessageMutation) AddedEdges

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

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

func (*RdMessageMutation) AddedField

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

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

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

func (*RdMessageMutation) AddedIDs

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

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

func (*RdMessageMutation) AddedRecverUID

func (m *RdMessageMutation) AddedRecverUID() (r int32, exists bool)

AddedRecverUID returns the value that was added to the "recver_uid" field in this mutation.

func (*RdMessageMutation) AddedSenderUID

func (m *RdMessageMutation) AddedSenderUID() (r int32, exists bool)

AddedSenderUID returns the value that was added to the "sender_uid" field in this mutation.

func (*RdMessageMutation) ClearEdge

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

func (m *RdMessageMutation) 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 (*RdMessageMutation) ClearRecverUID

func (m *RdMessageMutation) ClearRecverUID()

ClearRecverUID clears the value of the "recver_uid" field.

func (*RdMessageMutation) ClearSenderUID

func (m *RdMessageMutation) ClearSenderUID()

ClearSenderUID clears the value of the "sender_uid" field.

func (*RdMessageMutation) ClearedEdges

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

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

func (*RdMessageMutation) ClearedFields

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

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

func (RdMessageMutation) Client

func (m RdMessageMutation) 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 (*RdMessageMutation) Content

func (m *RdMessageMutation) Content() (r *biz.Content, exists bool)

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

func (*RdMessageMutation) CreateTime

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

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

func (*RdMessageMutation) EdgeCleared

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

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

func (*RdMessageMutation) Field

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

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

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

func (*RdMessageMutation) Fields

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

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

func (m *RdMessageMutation) IDs(ctx context.Context) ([]int32, 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 (*RdMessageMutation) OldContent

func (m *RdMessageMutation) OldContent(ctx context.Context) (v *biz.Content, err error)

OldContent returns the old "content" field's value of the RdMessage entity. If the RdMessage 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 (*RdMessageMutation) OldCreateTime

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

OldCreateTime returns the old "create_time" field's value of the RdMessage entity. If the RdMessage 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 (*RdMessageMutation) OldField

func (m *RdMessageMutation) 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 (*RdMessageMutation) OldRecverUID

func (m *RdMessageMutation) OldRecverUID(ctx context.Context) (v int32, err error)

OldRecverUID returns the old "recver_uid" field's value of the RdMessage entity. If the RdMessage 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 (*RdMessageMutation) OldSenderUID

func (m *RdMessageMutation) OldSenderUID(ctx context.Context) (v int32, err error)

OldSenderUID returns the old "sender_uid" field's value of the RdMessage entity. If the RdMessage 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 (*RdMessageMutation) Op

func (m *RdMessageMutation) Op() Op

Op returns the operation name.

func (*RdMessageMutation) RecverUID

func (m *RdMessageMutation) RecverUID() (r int32, exists bool)

RecverUID returns the value of the "recver_uid" field in the mutation.

func (*RdMessageMutation) RecverUIDCleared

func (m *RdMessageMutation) RecverUIDCleared() bool

RecverUIDCleared returns if the "recver_uid" field was cleared in this mutation.

func (*RdMessageMutation) RemovedEdges

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

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

func (*RdMessageMutation) RemovedIDs

func (m *RdMessageMutation) 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 (*RdMessageMutation) ResetContent

func (m *RdMessageMutation) ResetContent()

ResetContent resets all changes to the "content" field.

func (*RdMessageMutation) ResetCreateTime

func (m *RdMessageMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*RdMessageMutation) ResetEdge

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

func (m *RdMessageMutation) 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 (*RdMessageMutation) ResetRecverUID

func (m *RdMessageMutation) ResetRecverUID()

ResetRecverUID resets all changes to the "recver_uid" field.

func (*RdMessageMutation) ResetSenderUID

func (m *RdMessageMutation) ResetSenderUID()

ResetSenderUID resets all changes to the "sender_uid" field.

func (*RdMessageMutation) SenderUID

func (m *RdMessageMutation) SenderUID() (r int32, exists bool)

SenderUID returns the value of the "sender_uid" field in the mutation.

func (*RdMessageMutation) SenderUIDCleared

func (m *RdMessageMutation) SenderUIDCleared() bool

SenderUIDCleared returns if the "sender_uid" field was cleared in this mutation.

func (*RdMessageMutation) SetContent

func (m *RdMessageMutation) SetContent(b *biz.Content)

SetContent sets the "content" field.

func (*RdMessageMutation) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*RdMessageMutation) SetField

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

func (m *RdMessageMutation) SetID(id int32)

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

func (*RdMessageMutation) SetOp

func (m *RdMessageMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RdMessageMutation) SetRecverUID

func (m *RdMessageMutation) SetRecverUID(i int32)

SetRecverUID sets the "recver_uid" field.

func (*RdMessageMutation) SetSenderUID

func (m *RdMessageMutation) SetSenderUID(i int32)

SetSenderUID sets the "sender_uid" field.

func (RdMessageMutation) Tx

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

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

func (*RdMessageMutation) Type

func (m *RdMessageMutation) Type() string

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

func (*RdMessageMutation) Where

func (m *RdMessageMutation) Where(ps ...predicate.RdMessage)

Where appends a list predicates to the RdMessageMutation builder.

func (*RdMessageMutation) WhereP

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

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

type RdMessageQuery

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

RdMessageQuery is the builder for querying RdMessage entities.

func (*RdMessageQuery) Aggregate

func (rmq *RdMessageQuery) Aggregate(fns ...AggregateFunc) *RdMessageSelect

Aggregate returns a RdMessageSelect configured with the given aggregations.

func (*RdMessageQuery) All

func (rmq *RdMessageQuery) All(ctx context.Context) ([]*RdMessage, error)

All executes the query and returns a list of RdMessages.

func (*RdMessageQuery) AllX

func (rmq *RdMessageQuery) AllX(ctx context.Context) []*RdMessage

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

func (*RdMessageQuery) Clone

func (rmq *RdMessageQuery) Clone() *RdMessageQuery

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

func (*RdMessageQuery) Count

func (rmq *RdMessageQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RdMessageQuery) CountX

func (rmq *RdMessageQuery) CountX(ctx context.Context) int

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

func (*RdMessageQuery) Exist

func (rmq *RdMessageQuery) Exist(ctx context.Context) (bool, error)

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

func (*RdMessageQuery) ExistX

func (rmq *RdMessageQuery) ExistX(ctx context.Context) bool

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

func (*RdMessageQuery) First

func (rmq *RdMessageQuery) First(ctx context.Context) (*RdMessage, error)

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

func (*RdMessageQuery) FirstID

func (rmq *RdMessageQuery) FirstID(ctx context.Context) (id int32, err error)

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

func (*RdMessageQuery) FirstIDX

func (rmq *RdMessageQuery) FirstIDX(ctx context.Context) int32

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

func (*RdMessageQuery) FirstX

func (rmq *RdMessageQuery) FirstX(ctx context.Context) *RdMessage

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

func (*RdMessageQuery) GroupBy

func (rmq *RdMessageQuery) GroupBy(field string, fields ...string) *RdMessageGroupBy

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 {
	SenderUID int32 `json:"sender_uid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RdMessage.Query().
	GroupBy(rdmessage.FieldSenderUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RdMessageQuery) IDs

func (rmq *RdMessageQuery) IDs(ctx context.Context) ([]int32, error)

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

func (*RdMessageQuery) IDsX

func (rmq *RdMessageQuery) IDsX(ctx context.Context) []int32

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

func (*RdMessageQuery) Limit

func (rmq *RdMessageQuery) Limit(limit int) *RdMessageQuery

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

func (*RdMessageQuery) Offset

func (rmq *RdMessageQuery) Offset(offset int) *RdMessageQuery

Offset to start from.

func (*RdMessageQuery) Only

func (rmq *RdMessageQuery) Only(ctx context.Context) (*RdMessage, error)

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

func (*RdMessageQuery) OnlyID

func (rmq *RdMessageQuery) OnlyID(ctx context.Context) (id int32, err error)

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

func (*RdMessageQuery) OnlyIDX

func (rmq *RdMessageQuery) OnlyIDX(ctx context.Context) int32

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

func (*RdMessageQuery) OnlyX

func (rmq *RdMessageQuery) OnlyX(ctx context.Context) *RdMessage

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

func (*RdMessageQuery) Order

func (rmq *RdMessageQuery) Order(o ...OrderFunc) *RdMessageQuery

Order specifies how the records should be ordered.

func (*RdMessageQuery) Select

func (rmq *RdMessageQuery) Select(fields ...string) *RdMessageSelect

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 {
	SenderUID int32 `json:"sender_uid,omitempty"`
}

client.RdMessage.Query().
	Select(rdmessage.FieldSenderUID).
	Scan(ctx, &v)

func (*RdMessageQuery) Unique

func (rmq *RdMessageQuery) Unique(unique bool) *RdMessageQuery

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

func (rmq *RdMessageQuery) Where(ps ...predicate.RdMessage) *RdMessageQuery

Where adds a new predicate for the RdMessageQuery builder.

type RdMessageSelect

type RdMessageSelect struct {
	*RdMessageQuery
	// contains filtered or unexported fields
}

RdMessageSelect is the builder for selecting fields of RdMessage entities.

func (*RdMessageSelect) Aggregate

func (rms *RdMessageSelect) Aggregate(fns ...AggregateFunc) *RdMessageSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RdMessageSelect) Bool

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

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

func (*RdMessageSelect) BoolX

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

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

func (*RdMessageSelect) Bools

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

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

func (*RdMessageSelect) BoolsX

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

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

func (*RdMessageSelect) Float64

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

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

func (*RdMessageSelect) Float64X

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

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

func (*RdMessageSelect) Float64s

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

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

func (*RdMessageSelect) Float64sX

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

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

func (*RdMessageSelect) Int

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

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

func (*RdMessageSelect) IntX

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

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

func (*RdMessageSelect) Ints

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

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

func (*RdMessageSelect) IntsX

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

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

func (*RdMessageSelect) Scan

func (rms *RdMessageSelect) Scan(ctx context.Context, v any) error

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

func (*RdMessageSelect) ScanX

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

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

func (*RdMessageSelect) String

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

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

func (*RdMessageSelect) StringX

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

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

func (*RdMessageSelect) Strings

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

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

func (*RdMessageSelect) StringsX

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

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

type RdMessageUpdate

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

RdMessageUpdate is the builder for updating RdMessage entities.

func (*RdMessageUpdate) AddRecverUID

func (rmu *RdMessageUpdate) AddRecverUID(i int32) *RdMessageUpdate

AddRecverUID adds i to the "recver_uid" field.

func (*RdMessageUpdate) AddSenderUID

func (rmu *RdMessageUpdate) AddSenderUID(i int32) *RdMessageUpdate

AddSenderUID adds i to the "sender_uid" field.

func (*RdMessageUpdate) ClearRecverUID

func (rmu *RdMessageUpdate) ClearRecverUID() *RdMessageUpdate

ClearRecverUID clears the value of the "recver_uid" field.

func (*RdMessageUpdate) ClearSenderUID

func (rmu *RdMessageUpdate) ClearSenderUID() *RdMessageUpdate

ClearSenderUID clears the value of the "sender_uid" field.

func (*RdMessageUpdate) Exec

func (rmu *RdMessageUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RdMessageUpdate) ExecX

func (rmu *RdMessageUpdate) ExecX(ctx context.Context)

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

func (*RdMessageUpdate) Mutation

func (rmu *RdMessageUpdate) Mutation() *RdMessageMutation

Mutation returns the RdMessageMutation object of the builder.

func (*RdMessageUpdate) Save

func (rmu *RdMessageUpdate) Save(ctx context.Context) (int, error)

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

func (*RdMessageUpdate) SaveX

func (rmu *RdMessageUpdate) SaveX(ctx context.Context) int

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

func (*RdMessageUpdate) SetContent

func (rmu *RdMessageUpdate) SetContent(b *biz.Content) *RdMessageUpdate

SetContent sets the "content" field.

func (*RdMessageUpdate) SetCreateTime

func (rmu *RdMessageUpdate) SetCreateTime(t time.Time) *RdMessageUpdate

SetCreateTime sets the "create_time" field.

func (*RdMessageUpdate) SetNillableCreateTime

func (rmu *RdMessageUpdate) SetNillableCreateTime(t *time.Time) *RdMessageUpdate

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

func (*RdMessageUpdate) SetNillableRecverUID

func (rmu *RdMessageUpdate) SetNillableRecverUID(i *int32) *RdMessageUpdate

SetNillableRecverUID sets the "recver_uid" field if the given value is not nil.

func (*RdMessageUpdate) SetNillableSenderUID

func (rmu *RdMessageUpdate) SetNillableSenderUID(i *int32) *RdMessageUpdate

SetNillableSenderUID sets the "sender_uid" field if the given value is not nil.

func (*RdMessageUpdate) SetRecverUID

func (rmu *RdMessageUpdate) SetRecverUID(i int32) *RdMessageUpdate

SetRecverUID sets the "recver_uid" field.

func (*RdMessageUpdate) SetSenderUID

func (rmu *RdMessageUpdate) SetSenderUID(i int32) *RdMessageUpdate

SetSenderUID sets the "sender_uid" field.

func (*RdMessageUpdate) Where

Where appends a list predicates to the RdMessageUpdate builder.

type RdMessageUpdateOne

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

RdMessageUpdateOne is the builder for updating a single RdMessage entity.

func (*RdMessageUpdateOne) AddRecverUID

func (rmuo *RdMessageUpdateOne) AddRecverUID(i int32) *RdMessageUpdateOne

AddRecverUID adds i to the "recver_uid" field.

func (*RdMessageUpdateOne) AddSenderUID

func (rmuo *RdMessageUpdateOne) AddSenderUID(i int32) *RdMessageUpdateOne

AddSenderUID adds i to the "sender_uid" field.

func (*RdMessageUpdateOne) ClearRecverUID

func (rmuo *RdMessageUpdateOne) ClearRecverUID() *RdMessageUpdateOne

ClearRecverUID clears the value of the "recver_uid" field.

func (*RdMessageUpdateOne) ClearSenderUID

func (rmuo *RdMessageUpdateOne) ClearSenderUID() *RdMessageUpdateOne

ClearSenderUID clears the value of the "sender_uid" field.

func (*RdMessageUpdateOne) Exec

func (rmuo *RdMessageUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RdMessageUpdateOne) ExecX

func (rmuo *RdMessageUpdateOne) ExecX(ctx context.Context)

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

func (*RdMessageUpdateOne) Mutation

func (rmuo *RdMessageUpdateOne) Mutation() *RdMessageMutation

Mutation returns the RdMessageMutation object of the builder.

func (*RdMessageUpdateOne) Save

func (rmuo *RdMessageUpdateOne) Save(ctx context.Context) (*RdMessage, error)

Save executes the query and returns the updated RdMessage entity.

func (*RdMessageUpdateOne) SaveX

func (rmuo *RdMessageUpdateOne) SaveX(ctx context.Context) *RdMessage

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

func (*RdMessageUpdateOne) Select

func (rmuo *RdMessageUpdateOne) Select(field string, fields ...string) *RdMessageUpdateOne

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

func (*RdMessageUpdateOne) SetContent

func (rmuo *RdMessageUpdateOne) SetContent(b *biz.Content) *RdMessageUpdateOne

SetContent sets the "content" field.

func (*RdMessageUpdateOne) SetCreateTime

func (rmuo *RdMessageUpdateOne) SetCreateTime(t time.Time) *RdMessageUpdateOne

SetCreateTime sets the "create_time" field.

func (*RdMessageUpdateOne) SetNillableCreateTime

func (rmuo *RdMessageUpdateOne) SetNillableCreateTime(t *time.Time) *RdMessageUpdateOne

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

func (*RdMessageUpdateOne) SetNillableRecverUID

func (rmuo *RdMessageUpdateOne) SetNillableRecverUID(i *int32) *RdMessageUpdateOne

SetNillableRecverUID sets the "recver_uid" field if the given value is not nil.

func (*RdMessageUpdateOne) SetNillableSenderUID

func (rmuo *RdMessageUpdateOne) SetNillableSenderUID(i *int32) *RdMessageUpdateOne

SetNillableSenderUID sets the "sender_uid" field if the given value is not nil.

func (*RdMessageUpdateOne) SetRecverUID

func (rmuo *RdMessageUpdateOne) SetRecverUID(i int32) *RdMessageUpdateOne

SetRecverUID sets the "recver_uid" field.

func (*RdMessageUpdateOne) SetSenderUID

func (rmuo *RdMessageUpdateOne) SetSenderUID(i int32) *RdMessageUpdateOne

SetSenderUID sets the "sender_uid" field.

type RdMessages

type RdMessages []*RdMessage

RdMessages is a parsable slice of RdMessage.

type RdMoment

type RdMoment struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// 动态类型 1图文 2视频 3专栏
	Type int32 `json:"type,omitempty"`
	// 谁发布的动态
	ByUID int32 `json:"by_uid,omitempty"`
	// 文字
	Txt string `json:"txt,omitempty"`
	// 动态的图片数组
	Imgs []string `json:"imgs,omitempty"`
	// 关注的人uid
	Status int32 `json:"status,omitempty"`
	// PublishTime holds the value of the "publish_time" field.
	PublishTime time.Time `json:"publish_time,omitempty"`
	// contains filtered or unexported fields
}

RdMoment is the model entity for the RdMoment schema.

func (*RdMoment) String

func (rm *RdMoment) String() string

String implements the fmt.Stringer.

func (*RdMoment) Unwrap

func (rm *RdMoment) Unwrap() *RdMoment

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

func (rm *RdMoment) Update() *RdMomentUpdateOne

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

type RdMomentClient

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

RdMomentClient is a client for the RdMoment schema.

func NewRdMomentClient

func NewRdMomentClient(c config) *RdMomentClient

NewRdMomentClient returns a client for the RdMoment from the given config.

func (*RdMomentClient) Create

func (c *RdMomentClient) Create() *RdMomentCreate

Create returns a builder for creating a RdMoment entity.

func (*RdMomentClient) CreateBulk

func (c *RdMomentClient) CreateBulk(builders ...*RdMomentCreate) *RdMomentCreateBulk

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

func (*RdMomentClient) Delete

func (c *RdMomentClient) Delete() *RdMomentDelete

Delete returns a delete builder for RdMoment.

func (*RdMomentClient) DeleteOne

func (c *RdMomentClient) DeleteOne(rm *RdMoment) *RdMomentDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RdMomentClient) DeleteOneID

func (c *RdMomentClient) DeleteOneID(id int64) *RdMomentDeleteOne

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

func (*RdMomentClient) Get

func (c *RdMomentClient) Get(ctx context.Context, id int64) (*RdMoment, error)

Get returns a RdMoment entity by its id.

func (*RdMomentClient) GetX

func (c *RdMomentClient) GetX(ctx context.Context, id int64) *RdMoment

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

func (*RdMomentClient) Hooks

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

Hooks returns the client hooks.

func (*RdMomentClient) Intercept

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

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

func (*RdMomentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RdMomentClient) Query

func (c *RdMomentClient) Query() *RdMomentQuery

Query returns a query builder for RdMoment.

func (*RdMomentClient) Update

func (c *RdMomentClient) Update() *RdMomentUpdate

Update returns an update builder for RdMoment.

func (*RdMomentClient) UpdateOne

func (c *RdMomentClient) UpdateOne(rm *RdMoment) *RdMomentUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RdMomentClient) UpdateOneID

func (c *RdMomentClient) UpdateOneID(id int64) *RdMomentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RdMomentClient) Use

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

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

type RdMomentCreate

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

RdMomentCreate is the builder for creating a RdMoment entity.

func (*RdMomentCreate) Exec

func (rmc *RdMomentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RdMomentCreate) ExecX

func (rmc *RdMomentCreate) ExecX(ctx context.Context)

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

func (*RdMomentCreate) Mutation

func (rmc *RdMomentCreate) Mutation() *RdMomentMutation

Mutation returns the RdMomentMutation object of the builder.

func (*RdMomentCreate) Save

func (rmc *RdMomentCreate) Save(ctx context.Context) (*RdMoment, error)

Save creates the RdMoment in the database.

func (*RdMomentCreate) SaveX

func (rmc *RdMomentCreate) SaveX(ctx context.Context) *RdMoment

SaveX calls Save and panics if Save returns an error.

func (*RdMomentCreate) SetByUID

func (rmc *RdMomentCreate) SetByUID(i int32) *RdMomentCreate

SetByUID sets the "by_uid" field.

func (*RdMomentCreate) SetID

func (rmc *RdMomentCreate) SetID(i int64) *RdMomentCreate

SetID sets the "id" field.

func (*RdMomentCreate) SetImgs

func (rmc *RdMomentCreate) SetImgs(s []string) *RdMomentCreate

SetImgs sets the "imgs" field.

func (*RdMomentCreate) SetNillableByUID

func (rmc *RdMomentCreate) SetNillableByUID(i *int32) *RdMomentCreate

SetNillableByUID sets the "by_uid" field if the given value is not nil.

func (*RdMomentCreate) SetNillablePublishTime

func (rmc *RdMomentCreate) SetNillablePublishTime(t *time.Time) *RdMomentCreate

SetNillablePublishTime sets the "publish_time" field if the given value is not nil.

func (*RdMomentCreate) SetNillableStatus

func (rmc *RdMomentCreate) SetNillableStatus(i *int32) *RdMomentCreate

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

func (*RdMomentCreate) SetNillableType

func (rmc *RdMomentCreate) SetNillableType(i *int32) *RdMomentCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*RdMomentCreate) SetPublishTime

func (rmc *RdMomentCreate) SetPublishTime(t time.Time) *RdMomentCreate

SetPublishTime sets the "publish_time" field.

func (*RdMomentCreate) SetStatus

func (rmc *RdMomentCreate) SetStatus(i int32) *RdMomentCreate

SetStatus sets the "status" field.

func (*RdMomentCreate) SetTxt

func (rmc *RdMomentCreate) SetTxt(s string) *RdMomentCreate

SetTxt sets the "txt" field.

func (*RdMomentCreate) SetType

func (rmc *RdMomentCreate) SetType(i int32) *RdMomentCreate

SetType sets the "type" field.

type RdMomentCreateBulk

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

RdMomentCreateBulk is the builder for creating many RdMoment entities in bulk.

func (*RdMomentCreateBulk) Exec

func (rmcb *RdMomentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RdMomentCreateBulk) ExecX

func (rmcb *RdMomentCreateBulk) ExecX(ctx context.Context)

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

func (*RdMomentCreateBulk) Save

func (rmcb *RdMomentCreateBulk) Save(ctx context.Context) ([]*RdMoment, error)

Save creates the RdMoment entities in the database.

func (*RdMomentCreateBulk) SaveX

func (rmcb *RdMomentCreateBulk) SaveX(ctx context.Context) []*RdMoment

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

type RdMomentDelete

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

RdMomentDelete is the builder for deleting a RdMoment entity.

func (*RdMomentDelete) Exec

func (rmd *RdMomentDelete) Exec(ctx context.Context) (int, error)

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

func (*RdMomentDelete) ExecX

func (rmd *RdMomentDelete) ExecX(ctx context.Context) int

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

func (*RdMomentDelete) Where

func (rmd *RdMomentDelete) Where(ps ...predicate.RdMoment) *RdMomentDelete

Where appends a list predicates to the RdMomentDelete builder.

type RdMomentDeleteOne

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

RdMomentDeleteOne is the builder for deleting a single RdMoment entity.

func (*RdMomentDeleteOne) Exec

func (rmdo *RdMomentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RdMomentDeleteOne) ExecX

func (rmdo *RdMomentDeleteOne) ExecX(ctx context.Context)

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

type RdMomentGroupBy

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

RdMomentGroupBy is the group-by builder for RdMoment entities.

func (*RdMomentGroupBy) Aggregate

func (rmgb *RdMomentGroupBy) Aggregate(fns ...AggregateFunc) *RdMomentGroupBy

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

func (*RdMomentGroupBy) Bool

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

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

func (*RdMomentGroupBy) BoolX

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

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

func (*RdMomentGroupBy) Bools

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

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

func (*RdMomentGroupBy) BoolsX

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

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

func (*RdMomentGroupBy) Float64

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

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

func (*RdMomentGroupBy) Float64X

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

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

func (*RdMomentGroupBy) Float64s

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

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

func (*RdMomentGroupBy) Float64sX

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

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

func (*RdMomentGroupBy) Int

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

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

func (*RdMomentGroupBy) IntX

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

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

func (*RdMomentGroupBy) Ints

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

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

func (*RdMomentGroupBy) IntsX

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

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

func (*RdMomentGroupBy) Scan

func (rmgb *RdMomentGroupBy) Scan(ctx context.Context, v any) error

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

func (*RdMomentGroupBy) ScanX

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

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

func (*RdMomentGroupBy) String

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

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

func (*RdMomentGroupBy) StringX

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

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

func (*RdMomentGroupBy) Strings

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

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

func (*RdMomentGroupBy) StringsX

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

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

type RdMomentMutation

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

RdMomentMutation represents an operation that mutates the RdMoment nodes in the graph.

func (*RdMomentMutation) AddByUID

func (m *RdMomentMutation) AddByUID(i int32)

AddByUID adds i to the "by_uid" field.

func (*RdMomentMutation) AddField

func (m *RdMomentMutation) 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 (*RdMomentMutation) AddStatus

func (m *RdMomentMutation) AddStatus(i int32)

AddStatus adds i to the "status" field.

func (*RdMomentMutation) AddType

func (m *RdMomentMutation) AddType(i int32)

AddType adds i to the "type" field.

func (*RdMomentMutation) AddedByUID

func (m *RdMomentMutation) AddedByUID() (r int32, exists bool)

AddedByUID returns the value that was added to the "by_uid" field in this mutation.

func (*RdMomentMutation) AddedEdges

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

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

func (*RdMomentMutation) AddedField

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

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

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

func (*RdMomentMutation) AddedIDs

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

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

func (*RdMomentMutation) AddedStatus

func (m *RdMomentMutation) AddedStatus() (r int32, exists bool)

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

func (*RdMomentMutation) AddedType

func (m *RdMomentMutation) AddedType() (r int32, exists bool)

AddedType returns the value that was added to the "type" field in this mutation.

func (*RdMomentMutation) AppendImgs

func (m *RdMomentMutation) AppendImgs(s []string)

AppendImgs adds s to the "imgs" field.

func (*RdMomentMutation) AppendedImgs

func (m *RdMomentMutation) AppendedImgs() ([]string, bool)

AppendedImgs returns the list of values that were appended to the "imgs" field in this mutation.

func (*RdMomentMutation) ByUID

func (m *RdMomentMutation) ByUID() (r int32, exists bool)

ByUID returns the value of the "by_uid" field in the mutation.

func (*RdMomentMutation) ByUIDCleared

func (m *RdMomentMutation) ByUIDCleared() bool

ByUIDCleared returns if the "by_uid" field was cleared in this mutation.

func (*RdMomentMutation) ClearByUID

func (m *RdMomentMutation) ClearByUID()

ClearByUID clears the value of the "by_uid" field.

func (*RdMomentMutation) ClearEdge

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

func (m *RdMomentMutation) 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 (*RdMomentMutation) ClearStatus

func (m *RdMomentMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*RdMomentMutation) ClearType

func (m *RdMomentMutation) ClearType()

ClearType clears the value of the "type" field.

func (*RdMomentMutation) ClearedEdges

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

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

func (*RdMomentMutation) ClearedFields

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

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

func (RdMomentMutation) Client

func (m RdMomentMutation) 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 (*RdMomentMutation) EdgeCleared

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

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

func (*RdMomentMutation) Field

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

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

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

func (*RdMomentMutation) Fields

func (m *RdMomentMutation) 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 (*RdMomentMutation) GetType

func (m *RdMomentMutation) GetType() (r int32, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*RdMomentMutation) ID

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

func (m *RdMomentMutation) IDs(ctx context.Context) ([]int64, 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 (*RdMomentMutation) Imgs

func (m *RdMomentMutation) Imgs() (r []string, exists bool)

Imgs returns the value of the "imgs" field in the mutation.

func (*RdMomentMutation) OldByUID

func (m *RdMomentMutation) OldByUID(ctx context.Context) (v int32, err error)

OldByUID returns the old "by_uid" field's value of the RdMoment entity. If the RdMoment 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 (*RdMomentMutation) OldField

func (m *RdMomentMutation) 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 (*RdMomentMutation) OldImgs

func (m *RdMomentMutation) OldImgs(ctx context.Context) (v []string, err error)

OldImgs returns the old "imgs" field's value of the RdMoment entity. If the RdMoment 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 (*RdMomentMutation) OldPublishTime

func (m *RdMomentMutation) OldPublishTime(ctx context.Context) (v time.Time, err error)

OldPublishTime returns the old "publish_time" field's value of the RdMoment entity. If the RdMoment 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 (*RdMomentMutation) OldStatus

func (m *RdMomentMutation) OldStatus(ctx context.Context) (v int32, err error)

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

func (m *RdMomentMutation) OldTxt(ctx context.Context) (v string, err error)

OldTxt returns the old "txt" field's value of the RdMoment entity. If the RdMoment 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 (*RdMomentMutation) OldType

func (m *RdMomentMutation) OldType(ctx context.Context) (v int32, err error)

OldType returns the old "type" field's value of the RdMoment entity. If the RdMoment 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 (*RdMomentMutation) Op

func (m *RdMomentMutation) Op() Op

Op returns the operation name.

func (*RdMomentMutation) PublishTime

func (m *RdMomentMutation) PublishTime() (r time.Time, exists bool)

PublishTime returns the value of the "publish_time" field in the mutation.

func (*RdMomentMutation) RemovedEdges

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

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

func (*RdMomentMutation) RemovedIDs

func (m *RdMomentMutation) 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 (*RdMomentMutation) ResetByUID

func (m *RdMomentMutation) ResetByUID()

ResetByUID resets all changes to the "by_uid" field.

func (*RdMomentMutation) ResetEdge

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

func (m *RdMomentMutation) 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 (*RdMomentMutation) ResetImgs

func (m *RdMomentMutation) ResetImgs()

ResetImgs resets all changes to the "imgs" field.

func (*RdMomentMutation) ResetPublishTime

func (m *RdMomentMutation) ResetPublishTime()

ResetPublishTime resets all changes to the "publish_time" field.

func (*RdMomentMutation) ResetStatus

func (m *RdMomentMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*RdMomentMutation) ResetTxt

func (m *RdMomentMutation) ResetTxt()

ResetTxt resets all changes to the "txt" field.

func (*RdMomentMutation) ResetType

func (m *RdMomentMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*RdMomentMutation) SetByUID

func (m *RdMomentMutation) SetByUID(i int32)

SetByUID sets the "by_uid" field.

func (*RdMomentMutation) SetField

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

func (m *RdMomentMutation) SetID(id int64)

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

func (*RdMomentMutation) SetImgs

func (m *RdMomentMutation) SetImgs(s []string)

SetImgs sets the "imgs" field.

func (*RdMomentMutation) SetOp

func (m *RdMomentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RdMomentMutation) SetPublishTime

func (m *RdMomentMutation) SetPublishTime(t time.Time)

SetPublishTime sets the "publish_time" field.

func (*RdMomentMutation) SetStatus

func (m *RdMomentMutation) SetStatus(i int32)

SetStatus sets the "status" field.

func (*RdMomentMutation) SetTxt

func (m *RdMomentMutation) SetTxt(s string)

SetTxt sets the "txt" field.

func (*RdMomentMutation) SetType

func (m *RdMomentMutation) SetType(i int32)

SetType sets the "type" field.

func (*RdMomentMutation) Status

func (m *RdMomentMutation) Status() (r int32, exists bool)

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

func (*RdMomentMutation) StatusCleared

func (m *RdMomentMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (RdMomentMutation) Tx

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

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

func (*RdMomentMutation) Txt

func (m *RdMomentMutation) Txt() (r string, exists bool)

Txt returns the value of the "txt" field in the mutation.

func (*RdMomentMutation) Type

func (m *RdMomentMutation) Type() string

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

func (*RdMomentMutation) TypeCleared

func (m *RdMomentMutation) TypeCleared() bool

TypeCleared returns if the "type" field was cleared in this mutation.

func (*RdMomentMutation) Where

func (m *RdMomentMutation) Where(ps ...predicate.RdMoment)

Where appends a list predicates to the RdMomentMutation builder.

func (*RdMomentMutation) WhereP

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

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

type RdMomentQuery

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

RdMomentQuery is the builder for querying RdMoment entities.

func (*RdMomentQuery) Aggregate

func (rmq *RdMomentQuery) Aggregate(fns ...AggregateFunc) *RdMomentSelect

Aggregate returns a RdMomentSelect configured with the given aggregations.

func (*RdMomentQuery) All

func (rmq *RdMomentQuery) All(ctx context.Context) ([]*RdMoment, error)

All executes the query and returns a list of RdMoments.

func (*RdMomentQuery) AllX

func (rmq *RdMomentQuery) AllX(ctx context.Context) []*RdMoment

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

func (*RdMomentQuery) Clone

func (rmq *RdMomentQuery) Clone() *RdMomentQuery

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

func (*RdMomentQuery) Count

func (rmq *RdMomentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RdMomentQuery) CountX

func (rmq *RdMomentQuery) CountX(ctx context.Context) int

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

func (*RdMomentQuery) Exist

func (rmq *RdMomentQuery) Exist(ctx context.Context) (bool, error)

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

func (*RdMomentQuery) ExistX

func (rmq *RdMomentQuery) ExistX(ctx context.Context) bool

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

func (*RdMomentQuery) First

func (rmq *RdMomentQuery) First(ctx context.Context) (*RdMoment, error)

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

func (*RdMomentQuery) FirstID

func (rmq *RdMomentQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*RdMomentQuery) FirstIDX

func (rmq *RdMomentQuery) FirstIDX(ctx context.Context) int64

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

func (*RdMomentQuery) FirstX

func (rmq *RdMomentQuery) FirstX(ctx context.Context) *RdMoment

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

func (*RdMomentQuery) GroupBy

func (rmq *RdMomentQuery) GroupBy(field string, fields ...string) *RdMomentGroupBy

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 {
	Type int32 `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RdMoment.Query().
	GroupBy(rdmoment.FieldType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RdMomentQuery) IDs

func (rmq *RdMomentQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*RdMomentQuery) IDsX

func (rmq *RdMomentQuery) IDsX(ctx context.Context) []int64

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

func (*RdMomentQuery) Limit

func (rmq *RdMomentQuery) Limit(limit int) *RdMomentQuery

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

func (*RdMomentQuery) Offset

func (rmq *RdMomentQuery) Offset(offset int) *RdMomentQuery

Offset to start from.

func (*RdMomentQuery) Only

func (rmq *RdMomentQuery) Only(ctx context.Context) (*RdMoment, error)

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

func (*RdMomentQuery) OnlyID

func (rmq *RdMomentQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*RdMomentQuery) OnlyIDX

func (rmq *RdMomentQuery) OnlyIDX(ctx context.Context) int64

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

func (*RdMomentQuery) OnlyX

func (rmq *RdMomentQuery) OnlyX(ctx context.Context) *RdMoment

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

func (*RdMomentQuery) Order

func (rmq *RdMomentQuery) Order(o ...OrderFunc) *RdMomentQuery

Order specifies how the records should be ordered.

func (*RdMomentQuery) Select

func (rmq *RdMomentQuery) Select(fields ...string) *RdMomentSelect

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 {
	Type int32 `json:"type,omitempty"`
}

client.RdMoment.Query().
	Select(rdmoment.FieldType).
	Scan(ctx, &v)

func (*RdMomentQuery) Unique

func (rmq *RdMomentQuery) Unique(unique bool) *RdMomentQuery

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

func (rmq *RdMomentQuery) Where(ps ...predicate.RdMoment) *RdMomentQuery

Where adds a new predicate for the RdMomentQuery builder.

type RdMomentSelect

type RdMomentSelect struct {
	*RdMomentQuery
	// contains filtered or unexported fields
}

RdMomentSelect is the builder for selecting fields of RdMoment entities.

func (*RdMomentSelect) Aggregate

func (rms *RdMomentSelect) Aggregate(fns ...AggregateFunc) *RdMomentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RdMomentSelect) Bool

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

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

func (*RdMomentSelect) BoolX

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

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

func (*RdMomentSelect) Bools

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

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

func (*RdMomentSelect) BoolsX

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

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

func (*RdMomentSelect) Float64

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

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

func (*RdMomentSelect) Float64X

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

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

func (*RdMomentSelect) Float64s

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

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

func (*RdMomentSelect) Float64sX

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

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

func (*RdMomentSelect) Int

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

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

func (*RdMomentSelect) IntX

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

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

func (*RdMomentSelect) Ints

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

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

func (*RdMomentSelect) IntsX

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

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

func (*RdMomentSelect) Scan

func (rms *RdMomentSelect) Scan(ctx context.Context, v any) error

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

func (*RdMomentSelect) ScanX

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

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

func (*RdMomentSelect) String

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

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

func (*RdMomentSelect) StringX

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

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

func (*RdMomentSelect) Strings

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

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

func (*RdMomentSelect) StringsX

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

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

type RdMomentUpdate

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

RdMomentUpdate is the builder for updating RdMoment entities.

func (*RdMomentUpdate) AddByUID

func (rmu *RdMomentUpdate) AddByUID(i int32) *RdMomentUpdate

AddByUID adds i to the "by_uid" field.

func (*RdMomentUpdate) AddStatus

func (rmu *RdMomentUpdate) AddStatus(i int32) *RdMomentUpdate

AddStatus adds i to the "status" field.

func (*RdMomentUpdate) AddType

func (rmu *RdMomentUpdate) AddType(i int32) *RdMomentUpdate

AddType adds i to the "type" field.

func (*RdMomentUpdate) AppendImgs

func (rmu *RdMomentUpdate) AppendImgs(s []string) *RdMomentUpdate

AppendImgs appends s to the "imgs" field.

func (*RdMomentUpdate) ClearByUID

func (rmu *RdMomentUpdate) ClearByUID() *RdMomentUpdate

ClearByUID clears the value of the "by_uid" field.

func (*RdMomentUpdate) ClearStatus

func (rmu *RdMomentUpdate) ClearStatus() *RdMomentUpdate

ClearStatus clears the value of the "status" field.

func (*RdMomentUpdate) ClearType

func (rmu *RdMomentUpdate) ClearType() *RdMomentUpdate

ClearType clears the value of the "type" field.

func (*RdMomentUpdate) Exec

func (rmu *RdMomentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RdMomentUpdate) ExecX

func (rmu *RdMomentUpdate) ExecX(ctx context.Context)

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

func (*RdMomentUpdate) Mutation

func (rmu *RdMomentUpdate) Mutation() *RdMomentMutation

Mutation returns the RdMomentMutation object of the builder.

func (*RdMomentUpdate) Save

func (rmu *RdMomentUpdate) Save(ctx context.Context) (int, error)

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

func (*RdMomentUpdate) SaveX

func (rmu *RdMomentUpdate) SaveX(ctx context.Context) int

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

func (*RdMomentUpdate) SetByUID

func (rmu *RdMomentUpdate) SetByUID(i int32) *RdMomentUpdate

SetByUID sets the "by_uid" field.

func (*RdMomentUpdate) SetImgs

func (rmu *RdMomentUpdate) SetImgs(s []string) *RdMomentUpdate

SetImgs sets the "imgs" field.

func (*RdMomentUpdate) SetNillableByUID

func (rmu *RdMomentUpdate) SetNillableByUID(i *int32) *RdMomentUpdate

SetNillableByUID sets the "by_uid" field if the given value is not nil.

func (*RdMomentUpdate) SetNillablePublishTime

func (rmu *RdMomentUpdate) SetNillablePublishTime(t *time.Time) *RdMomentUpdate

SetNillablePublishTime sets the "publish_time" field if the given value is not nil.

func (*RdMomentUpdate) SetNillableStatus

func (rmu *RdMomentUpdate) SetNillableStatus(i *int32) *RdMomentUpdate

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

func (*RdMomentUpdate) SetNillableType

func (rmu *RdMomentUpdate) SetNillableType(i *int32) *RdMomentUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*RdMomentUpdate) SetPublishTime

func (rmu *RdMomentUpdate) SetPublishTime(t time.Time) *RdMomentUpdate

SetPublishTime sets the "publish_time" field.

func (*RdMomentUpdate) SetStatus

func (rmu *RdMomentUpdate) SetStatus(i int32) *RdMomentUpdate

SetStatus sets the "status" field.

func (*RdMomentUpdate) SetTxt

func (rmu *RdMomentUpdate) SetTxt(s string) *RdMomentUpdate

SetTxt sets the "txt" field.

func (*RdMomentUpdate) SetType

func (rmu *RdMomentUpdate) SetType(i int32) *RdMomentUpdate

SetType sets the "type" field.

func (*RdMomentUpdate) Where

func (rmu *RdMomentUpdate) Where(ps ...predicate.RdMoment) *RdMomentUpdate

Where appends a list predicates to the RdMomentUpdate builder.

type RdMomentUpdateOne

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

RdMomentUpdateOne is the builder for updating a single RdMoment entity.

func (*RdMomentUpdateOne) AddByUID

func (rmuo *RdMomentUpdateOne) AddByUID(i int32) *RdMomentUpdateOne

AddByUID adds i to the "by_uid" field.

func (*RdMomentUpdateOne) AddStatus

func (rmuo *RdMomentUpdateOne) AddStatus(i int32) *RdMomentUpdateOne

AddStatus adds i to the "status" field.

func (*RdMomentUpdateOne) AddType

func (rmuo *RdMomentUpdateOne) AddType(i int32) *RdMomentUpdateOne

AddType adds i to the "type" field.

func (*RdMomentUpdateOne) AppendImgs

func (rmuo *RdMomentUpdateOne) AppendImgs(s []string) *RdMomentUpdateOne

AppendImgs appends s to the "imgs" field.

func (*RdMomentUpdateOne) ClearByUID

func (rmuo *RdMomentUpdateOne) ClearByUID() *RdMomentUpdateOne

ClearByUID clears the value of the "by_uid" field.

func (*RdMomentUpdateOne) ClearStatus

func (rmuo *RdMomentUpdateOne) ClearStatus() *RdMomentUpdateOne

ClearStatus clears the value of the "status" field.

func (*RdMomentUpdateOne) ClearType

func (rmuo *RdMomentUpdateOne) ClearType() *RdMomentUpdateOne

ClearType clears the value of the "type" field.

func (*RdMomentUpdateOne) Exec

func (rmuo *RdMomentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RdMomentUpdateOne) ExecX

func (rmuo *RdMomentUpdateOne) ExecX(ctx context.Context)

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

func (*RdMomentUpdateOne) Mutation

func (rmuo *RdMomentUpdateOne) Mutation() *RdMomentMutation

Mutation returns the RdMomentMutation object of the builder.

func (*RdMomentUpdateOne) Save

func (rmuo *RdMomentUpdateOne) Save(ctx context.Context) (*RdMoment, error)

Save executes the query and returns the updated RdMoment entity.

func (*RdMomentUpdateOne) SaveX

func (rmuo *RdMomentUpdateOne) SaveX(ctx context.Context) *RdMoment

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

func (*RdMomentUpdateOne) Select

func (rmuo *RdMomentUpdateOne) Select(field string, fields ...string) *RdMomentUpdateOne

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

func (*RdMomentUpdateOne) SetByUID

func (rmuo *RdMomentUpdateOne) SetByUID(i int32) *RdMomentUpdateOne

SetByUID sets the "by_uid" field.

func (*RdMomentUpdateOne) SetImgs

func (rmuo *RdMomentUpdateOne) SetImgs(s []string) *RdMomentUpdateOne

SetImgs sets the "imgs" field.

func (*RdMomentUpdateOne) SetNillableByUID

func (rmuo *RdMomentUpdateOne) SetNillableByUID(i *int32) *RdMomentUpdateOne

SetNillableByUID sets the "by_uid" field if the given value is not nil.

func (*RdMomentUpdateOne) SetNillablePublishTime

func (rmuo *RdMomentUpdateOne) SetNillablePublishTime(t *time.Time) *RdMomentUpdateOne

SetNillablePublishTime sets the "publish_time" field if the given value is not nil.

func (*RdMomentUpdateOne) SetNillableStatus

func (rmuo *RdMomentUpdateOne) SetNillableStatus(i *int32) *RdMomentUpdateOne

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

func (*RdMomentUpdateOne) SetNillableType

func (rmuo *RdMomentUpdateOne) SetNillableType(i *int32) *RdMomentUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*RdMomentUpdateOne) SetPublishTime

func (rmuo *RdMomentUpdateOne) SetPublishTime(t time.Time) *RdMomentUpdateOne

SetPublishTime sets the "publish_time" field.

func (*RdMomentUpdateOne) SetStatus

func (rmuo *RdMomentUpdateOne) SetStatus(i int32) *RdMomentUpdateOne

SetStatus sets the "status" field.

func (*RdMomentUpdateOne) SetTxt

func (rmuo *RdMomentUpdateOne) SetTxt(s string) *RdMomentUpdateOne

SetTxt sets the "txt" field.

func (*RdMomentUpdateOne) SetType

func (rmuo *RdMomentUpdateOne) SetType(i int32) *RdMomentUpdateOne

SetType sets the "type" field.

type RdMoments

type RdMoments []*RdMoment

RdMoments is a parsable slice of RdMoment.

type RdRMomentsFollowing

type RdRMomentsFollowing struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// 动态类型 1图文 2视频 3专栏
	MomentID int64 `json:"moment_id,omitempty"`
	// 谁发布的动态
	MomentType int32 `json:"moment_type,omitempty"`
	// 谁发布的动态
	ByUID int32 `json:"by_uid,omitempty"`
	// 谁关注的动态
	ForUID int32 `json:"for_uid,omitempty"`
	// 文字
	Txt string `json:"txt,omitempty"`
	// 动态的图片数组
	Imgs []string `json:"imgs,omitempty"`
	// 关注的人uid
	Status int32 `json:"status,omitempty"`
	// PublishTime holds the value of the "publish_time" field.
	PublishTime time.Time `json:"publish_time,omitempty"`
	// contains filtered or unexported fields
}

RdRMomentsFollowing is the model entity for the RdRMomentsFollowing schema.

func (*RdRMomentsFollowing) String

func (rrf *RdRMomentsFollowing) String() string

String implements the fmt.Stringer.

func (*RdRMomentsFollowing) Unwrap

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

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

type RdRMomentsFollowingClient

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

RdRMomentsFollowingClient is a client for the RdRMomentsFollowing schema.

func NewRdRMomentsFollowingClient

func NewRdRMomentsFollowingClient(c config) *RdRMomentsFollowingClient

NewRdRMomentsFollowingClient returns a client for the RdRMomentsFollowing from the given config.

func (*RdRMomentsFollowingClient) Create

Create returns a builder for creating a RdRMomentsFollowing entity.

func (*RdRMomentsFollowingClient) CreateBulk

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

func (*RdRMomentsFollowingClient) Delete

Delete returns a delete builder for RdRMomentsFollowing.

func (*RdRMomentsFollowingClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RdRMomentsFollowingClient) DeleteOneID

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

func (*RdRMomentsFollowingClient) Get

Get returns a RdRMomentsFollowing entity by its id.

func (*RdRMomentsFollowingClient) GetX

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

func (*RdRMomentsFollowingClient) Hooks

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

Hooks returns the client hooks.

func (*RdRMomentsFollowingClient) Intercept

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

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

func (*RdRMomentsFollowingClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RdRMomentsFollowingClient) Query

Query returns a query builder for RdRMomentsFollowing.

func (*RdRMomentsFollowingClient) Update

Update returns an update builder for RdRMomentsFollowing.

func (*RdRMomentsFollowingClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RdRMomentsFollowingClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*RdRMomentsFollowingClient) Use

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

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

type RdRMomentsFollowingCreate

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

RdRMomentsFollowingCreate is the builder for creating a RdRMomentsFollowing entity.

func (*RdRMomentsFollowingCreate) Exec

Exec executes the query.

func (*RdRMomentsFollowingCreate) ExecX

func (rrfc *RdRMomentsFollowingCreate) ExecX(ctx context.Context)

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

func (*RdRMomentsFollowingCreate) Mutation

Mutation returns the RdRMomentsFollowingMutation object of the builder.

func (*RdRMomentsFollowingCreate) Save

Save creates the RdRMomentsFollowing in the database.

func (*RdRMomentsFollowingCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*RdRMomentsFollowingCreate) SetByUID

SetByUID sets the "by_uid" field.

func (*RdRMomentsFollowingCreate) SetForUID

SetForUID sets the "for_uid" field.

func (*RdRMomentsFollowingCreate) SetID

SetID sets the "id" field.

func (*RdRMomentsFollowingCreate) SetImgs

SetImgs sets the "imgs" field.

func (*RdRMomentsFollowingCreate) SetMomentID

SetMomentID sets the "moment_id" field.

func (*RdRMomentsFollowingCreate) SetMomentType

SetMomentType sets the "moment_type" field.

func (*RdRMomentsFollowingCreate) SetNillableByUID

func (rrfc *RdRMomentsFollowingCreate) SetNillableByUID(i *int32) *RdRMomentsFollowingCreate

SetNillableByUID sets the "by_uid" field if the given value is not nil.

func (*RdRMomentsFollowingCreate) SetNillableForUID

func (rrfc *RdRMomentsFollowingCreate) SetNillableForUID(i *int32) *RdRMomentsFollowingCreate

SetNillableForUID sets the "for_uid" field if the given value is not nil.

func (*RdRMomentsFollowingCreate) SetNillableMomentID

func (rrfc *RdRMomentsFollowingCreate) SetNillableMomentID(i *int64) *RdRMomentsFollowingCreate

SetNillableMomentID sets the "moment_id" field if the given value is not nil.

func (*RdRMomentsFollowingCreate) SetNillableMomentType

func (rrfc *RdRMomentsFollowingCreate) SetNillableMomentType(i *int32) *RdRMomentsFollowingCreate

SetNillableMomentType sets the "moment_type" field if the given value is not nil.

func (*RdRMomentsFollowingCreate) SetNillablePublishTime

func (rrfc *RdRMomentsFollowingCreate) SetNillablePublishTime(t *time.Time) *RdRMomentsFollowingCreate

SetNillablePublishTime sets the "publish_time" field if the given value is not nil.

func (*RdRMomentsFollowingCreate) SetNillableStatus

func (rrfc *RdRMomentsFollowingCreate) SetNillableStatus(i *int32) *RdRMomentsFollowingCreate

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

func (*RdRMomentsFollowingCreate) SetPublishTime

SetPublishTime sets the "publish_time" field.

func (*RdRMomentsFollowingCreate) SetStatus

SetStatus sets the "status" field.

func (*RdRMomentsFollowingCreate) SetTxt

SetTxt sets the "txt" field.

type RdRMomentsFollowingCreateBulk

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

RdRMomentsFollowingCreateBulk is the builder for creating many RdRMomentsFollowing entities in bulk.

func (*RdRMomentsFollowingCreateBulk) Exec

Exec executes the query.

func (*RdRMomentsFollowingCreateBulk) ExecX

func (rrfcb *RdRMomentsFollowingCreateBulk) ExecX(ctx context.Context)

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

func (*RdRMomentsFollowingCreateBulk) Save

Save creates the RdRMomentsFollowing entities in the database.

func (*RdRMomentsFollowingCreateBulk) SaveX

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

type RdRMomentsFollowingDelete

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

RdRMomentsFollowingDelete is the builder for deleting a RdRMomentsFollowing entity.

func (*RdRMomentsFollowingDelete) Exec

func (rrfd *RdRMomentsFollowingDelete) Exec(ctx context.Context) (int, error)

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

func (*RdRMomentsFollowingDelete) ExecX

func (rrfd *RdRMomentsFollowingDelete) ExecX(ctx context.Context) int

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

func (*RdRMomentsFollowingDelete) Where

Where appends a list predicates to the RdRMomentsFollowingDelete builder.

type RdRMomentsFollowingDeleteOne

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

RdRMomentsFollowingDeleteOne is the builder for deleting a single RdRMomentsFollowing entity.

func (*RdRMomentsFollowingDeleteOne) Exec

Exec executes the deletion query.

func (*RdRMomentsFollowingDeleteOne) ExecX

func (rrfdo *RdRMomentsFollowingDeleteOne) ExecX(ctx context.Context)

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

type RdRMomentsFollowingGroupBy

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

RdRMomentsFollowingGroupBy is the group-by builder for RdRMomentsFollowing entities.

func (*RdRMomentsFollowingGroupBy) Aggregate

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

func (*RdRMomentsFollowingGroupBy) Bool

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

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

func (*RdRMomentsFollowingGroupBy) BoolX

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

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

func (*RdRMomentsFollowingGroupBy) Bools

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

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

func (*RdRMomentsFollowingGroupBy) BoolsX

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

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

func (*RdRMomentsFollowingGroupBy) Float64

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

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

func (*RdRMomentsFollowingGroupBy) Float64X

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

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

func (*RdRMomentsFollowingGroupBy) Float64s

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

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

func (*RdRMomentsFollowingGroupBy) Float64sX

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

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

func (*RdRMomentsFollowingGroupBy) Int

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

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

func (*RdRMomentsFollowingGroupBy) IntX

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

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

func (*RdRMomentsFollowingGroupBy) Ints

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

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

func (*RdRMomentsFollowingGroupBy) IntsX

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

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

func (*RdRMomentsFollowingGroupBy) Scan

func (rrfgb *RdRMomentsFollowingGroupBy) Scan(ctx context.Context, v any) error

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

func (*RdRMomentsFollowingGroupBy) ScanX

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

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

func (*RdRMomentsFollowingGroupBy) String

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

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

func (*RdRMomentsFollowingGroupBy) StringX

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

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

func (*RdRMomentsFollowingGroupBy) Strings

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

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

func (*RdRMomentsFollowingGroupBy) StringsX

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

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

type RdRMomentsFollowingMutation

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

RdRMomentsFollowingMutation represents an operation that mutates the RdRMomentsFollowing nodes in the graph.

func (*RdRMomentsFollowingMutation) AddByUID

func (m *RdRMomentsFollowingMutation) AddByUID(i int32)

AddByUID adds i to the "by_uid" field.

func (*RdRMomentsFollowingMutation) AddField

func (m *RdRMomentsFollowingMutation) 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 (*RdRMomentsFollowingMutation) AddForUID

func (m *RdRMomentsFollowingMutation) AddForUID(i int32)

AddForUID adds i to the "for_uid" field.

func (*RdRMomentsFollowingMutation) AddMomentID

func (m *RdRMomentsFollowingMutation) AddMomentID(i int64)

AddMomentID adds i to the "moment_id" field.

func (*RdRMomentsFollowingMutation) AddMomentType

func (m *RdRMomentsFollowingMutation) AddMomentType(i int32)

AddMomentType adds i to the "moment_type" field.

func (*RdRMomentsFollowingMutation) AddStatus

func (m *RdRMomentsFollowingMutation) AddStatus(i int32)

AddStatus adds i to the "status" field.

func (*RdRMomentsFollowingMutation) AddedByUID

func (m *RdRMomentsFollowingMutation) AddedByUID() (r int32, exists bool)

AddedByUID returns the value that was added to the "by_uid" field in this mutation.

func (*RdRMomentsFollowingMutation) AddedEdges

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

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

func (*RdRMomentsFollowingMutation) AddedField

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

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

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

func (*RdRMomentsFollowingMutation) AddedForUID

func (m *RdRMomentsFollowingMutation) AddedForUID() (r int32, exists bool)

AddedForUID returns the value that was added to the "for_uid" field in this mutation.

func (*RdRMomentsFollowingMutation) AddedIDs

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

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

func (*RdRMomentsFollowingMutation) AddedMomentID

func (m *RdRMomentsFollowingMutation) AddedMomentID() (r int64, exists bool)

AddedMomentID returns the value that was added to the "moment_id" field in this mutation.

func (*RdRMomentsFollowingMutation) AddedMomentType

func (m *RdRMomentsFollowingMutation) AddedMomentType() (r int32, exists bool)

AddedMomentType returns the value that was added to the "moment_type" field in this mutation.

func (*RdRMomentsFollowingMutation) AddedStatus

func (m *RdRMomentsFollowingMutation) AddedStatus() (r int32, exists bool)

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

func (*RdRMomentsFollowingMutation) AppendImgs

func (m *RdRMomentsFollowingMutation) AppendImgs(s []string)

AppendImgs adds s to the "imgs" field.

func (*RdRMomentsFollowingMutation) AppendedImgs

func (m *RdRMomentsFollowingMutation) AppendedImgs() ([]string, bool)

AppendedImgs returns the list of values that were appended to the "imgs" field in this mutation.

func (*RdRMomentsFollowingMutation) ByUID

func (m *RdRMomentsFollowingMutation) ByUID() (r int32, exists bool)

ByUID returns the value of the "by_uid" field in the mutation.

func (*RdRMomentsFollowingMutation) ByUIDCleared

func (m *RdRMomentsFollowingMutation) ByUIDCleared() bool

ByUIDCleared returns if the "by_uid" field was cleared in this mutation.

func (*RdRMomentsFollowingMutation) ClearByUID

func (m *RdRMomentsFollowingMutation) ClearByUID()

ClearByUID clears the value of the "by_uid" field.

func (*RdRMomentsFollowingMutation) ClearEdge

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

func (m *RdRMomentsFollowingMutation) 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 (*RdRMomentsFollowingMutation) ClearForUID

func (m *RdRMomentsFollowingMutation) ClearForUID()

ClearForUID clears the value of the "for_uid" field.

func (*RdRMomentsFollowingMutation) ClearMomentID

func (m *RdRMomentsFollowingMutation) ClearMomentID()

ClearMomentID clears the value of the "moment_id" field.

func (*RdRMomentsFollowingMutation) ClearMomentType

func (m *RdRMomentsFollowingMutation) ClearMomentType()

ClearMomentType clears the value of the "moment_type" field.

func (*RdRMomentsFollowingMutation) ClearStatus

func (m *RdRMomentsFollowingMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*RdRMomentsFollowingMutation) ClearedEdges

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

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

func (*RdRMomentsFollowingMutation) ClearedFields

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

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

func (RdRMomentsFollowingMutation) Client

func (m RdRMomentsFollowingMutation) 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 (*RdRMomentsFollowingMutation) EdgeCleared

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

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

func (*RdRMomentsFollowingMutation) Field

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

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

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

func (*RdRMomentsFollowingMutation) Fields

func (m *RdRMomentsFollowingMutation) 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 (*RdRMomentsFollowingMutation) ForUID

func (m *RdRMomentsFollowingMutation) ForUID() (r int32, exists bool)

ForUID returns the value of the "for_uid" field in the mutation.

func (*RdRMomentsFollowingMutation) ForUIDCleared

func (m *RdRMomentsFollowingMutation) ForUIDCleared() bool

ForUIDCleared returns if the "for_uid" field was cleared in this mutation.

func (*RdRMomentsFollowingMutation) ID

func (m *RdRMomentsFollowingMutation) ID() (id int64, 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 (*RdRMomentsFollowingMutation) 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 (*RdRMomentsFollowingMutation) Imgs

func (m *RdRMomentsFollowingMutation) Imgs() (r []string, exists bool)

Imgs returns the value of the "imgs" field in the mutation.

func (*RdRMomentsFollowingMutation) MomentID

func (m *RdRMomentsFollowingMutation) MomentID() (r int64, exists bool)

MomentID returns the value of the "moment_id" field in the mutation.

func (*RdRMomentsFollowingMutation) MomentIDCleared

func (m *RdRMomentsFollowingMutation) MomentIDCleared() bool

MomentIDCleared returns if the "moment_id" field was cleared in this mutation.

func (*RdRMomentsFollowingMutation) MomentType

func (m *RdRMomentsFollowingMutation) MomentType() (r int32, exists bool)

MomentType returns the value of the "moment_type" field in the mutation.

func (*RdRMomentsFollowingMutation) MomentTypeCleared

func (m *RdRMomentsFollowingMutation) MomentTypeCleared() bool

MomentTypeCleared returns if the "moment_type" field was cleared in this mutation.

func (*RdRMomentsFollowingMutation) OldByUID

func (m *RdRMomentsFollowingMutation) OldByUID(ctx context.Context) (v int32, err error)

OldByUID returns the old "by_uid" field's value of the RdRMomentsFollowing entity. If the RdRMomentsFollowing 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 (*RdRMomentsFollowingMutation) OldField

func (m *RdRMomentsFollowingMutation) 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 (*RdRMomentsFollowingMutation) OldForUID

func (m *RdRMomentsFollowingMutation) OldForUID(ctx context.Context) (v int32, err error)

OldForUID returns the old "for_uid" field's value of the RdRMomentsFollowing entity. If the RdRMomentsFollowing 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 (*RdRMomentsFollowingMutation) OldImgs

func (m *RdRMomentsFollowingMutation) OldImgs(ctx context.Context) (v []string, err error)

OldImgs returns the old "imgs" field's value of the RdRMomentsFollowing entity. If the RdRMomentsFollowing 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 (*RdRMomentsFollowingMutation) OldMomentID

func (m *RdRMomentsFollowingMutation) OldMomentID(ctx context.Context) (v int64, err error)

OldMomentID returns the old "moment_id" field's value of the RdRMomentsFollowing entity. If the RdRMomentsFollowing 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 (*RdRMomentsFollowingMutation) OldMomentType

func (m *RdRMomentsFollowingMutation) OldMomentType(ctx context.Context) (v int32, err error)

OldMomentType returns the old "moment_type" field's value of the RdRMomentsFollowing entity. If the RdRMomentsFollowing 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 (*RdRMomentsFollowingMutation) OldPublishTime

func (m *RdRMomentsFollowingMutation) OldPublishTime(ctx context.Context) (v time.Time, err error)

OldPublishTime returns the old "publish_time" field's value of the RdRMomentsFollowing entity. If the RdRMomentsFollowing 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 (*RdRMomentsFollowingMutation) OldStatus

func (m *RdRMomentsFollowingMutation) OldStatus(ctx context.Context) (v int32, err error)

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

func (m *RdRMomentsFollowingMutation) OldTxt(ctx context.Context) (v string, err error)

OldTxt returns the old "txt" field's value of the RdRMomentsFollowing entity. If the RdRMomentsFollowing 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 (*RdRMomentsFollowingMutation) Op

Op returns the operation name.

func (*RdRMomentsFollowingMutation) PublishTime

func (m *RdRMomentsFollowingMutation) PublishTime() (r time.Time, exists bool)

PublishTime returns the value of the "publish_time" field in the mutation.

func (*RdRMomentsFollowingMutation) RemovedEdges

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

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

func (*RdRMomentsFollowingMutation) RemovedIDs

func (m *RdRMomentsFollowingMutation) 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 (*RdRMomentsFollowingMutation) ResetByUID

func (m *RdRMomentsFollowingMutation) ResetByUID()

ResetByUID resets all changes to the "by_uid" field.

func (*RdRMomentsFollowingMutation) ResetEdge

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

func (m *RdRMomentsFollowingMutation) 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 (*RdRMomentsFollowingMutation) ResetForUID

func (m *RdRMomentsFollowingMutation) ResetForUID()

ResetForUID resets all changes to the "for_uid" field.

func (*RdRMomentsFollowingMutation) ResetImgs

func (m *RdRMomentsFollowingMutation) ResetImgs()

ResetImgs resets all changes to the "imgs" field.

func (*RdRMomentsFollowingMutation) ResetMomentID

func (m *RdRMomentsFollowingMutation) ResetMomentID()

ResetMomentID resets all changes to the "moment_id" field.

func (*RdRMomentsFollowingMutation) ResetMomentType

func (m *RdRMomentsFollowingMutation) ResetMomentType()

ResetMomentType resets all changes to the "moment_type" field.

func (*RdRMomentsFollowingMutation) ResetPublishTime

func (m *RdRMomentsFollowingMutation) ResetPublishTime()

ResetPublishTime resets all changes to the "publish_time" field.

func (*RdRMomentsFollowingMutation) ResetStatus

func (m *RdRMomentsFollowingMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*RdRMomentsFollowingMutation) ResetTxt

func (m *RdRMomentsFollowingMutation) ResetTxt()

ResetTxt resets all changes to the "txt" field.

func (*RdRMomentsFollowingMutation) SetByUID

func (m *RdRMomentsFollowingMutation) SetByUID(i int32)

SetByUID sets the "by_uid" field.

func (*RdRMomentsFollowingMutation) SetField

func (m *RdRMomentsFollowingMutation) 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 (*RdRMomentsFollowingMutation) SetForUID

func (m *RdRMomentsFollowingMutation) SetForUID(i int32)

SetForUID sets the "for_uid" field.

func (*RdRMomentsFollowingMutation) SetID

func (m *RdRMomentsFollowingMutation) SetID(id int64)

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

func (*RdRMomentsFollowingMutation) SetImgs

func (m *RdRMomentsFollowingMutation) SetImgs(s []string)

SetImgs sets the "imgs" field.

func (*RdRMomentsFollowingMutation) SetMomentID

func (m *RdRMomentsFollowingMutation) SetMomentID(i int64)

SetMomentID sets the "moment_id" field.

func (*RdRMomentsFollowingMutation) SetMomentType

func (m *RdRMomentsFollowingMutation) SetMomentType(i int32)

SetMomentType sets the "moment_type" field.

func (*RdRMomentsFollowingMutation) SetOp

func (m *RdRMomentsFollowingMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RdRMomentsFollowingMutation) SetPublishTime

func (m *RdRMomentsFollowingMutation) SetPublishTime(t time.Time)

SetPublishTime sets the "publish_time" field.

func (*RdRMomentsFollowingMutation) SetStatus

func (m *RdRMomentsFollowingMutation) SetStatus(i int32)

SetStatus sets the "status" field.

func (*RdRMomentsFollowingMutation) SetTxt

func (m *RdRMomentsFollowingMutation) SetTxt(s string)

SetTxt sets the "txt" field.

func (*RdRMomentsFollowingMutation) Status

func (m *RdRMomentsFollowingMutation) Status() (r int32, exists bool)

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

func (*RdRMomentsFollowingMutation) StatusCleared

func (m *RdRMomentsFollowingMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (RdRMomentsFollowingMutation) Tx

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

func (*RdRMomentsFollowingMutation) Txt

func (m *RdRMomentsFollowingMutation) Txt() (r string, exists bool)

Txt returns the value of the "txt" field in the mutation.

func (*RdRMomentsFollowingMutation) Type

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

func (*RdRMomentsFollowingMutation) Where

Where appends a list predicates to the RdRMomentsFollowingMutation builder.

func (*RdRMomentsFollowingMutation) WhereP

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

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

type RdRMomentsFollowingQuery

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

RdRMomentsFollowingQuery is the builder for querying RdRMomentsFollowing entities.

func (*RdRMomentsFollowingQuery) Aggregate

Aggregate returns a RdRMomentsFollowingSelect configured with the given aggregations.

func (*RdRMomentsFollowingQuery) All

All executes the query and returns a list of RdRMomentsFollowings.

func (*RdRMomentsFollowingQuery) AllX

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

func (*RdRMomentsFollowingQuery) Clone

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

func (*RdRMomentsFollowingQuery) Count

func (rrfq *RdRMomentsFollowingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RdRMomentsFollowingQuery) CountX

func (rrfq *RdRMomentsFollowingQuery) CountX(ctx context.Context) int

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

func (*RdRMomentsFollowingQuery) Exist

func (rrfq *RdRMomentsFollowingQuery) Exist(ctx context.Context) (bool, error)

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

func (*RdRMomentsFollowingQuery) ExistX

func (rrfq *RdRMomentsFollowingQuery) ExistX(ctx context.Context) bool

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

func (*RdRMomentsFollowingQuery) First

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

func (*RdRMomentsFollowingQuery) FirstID

func (rrfq *RdRMomentsFollowingQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*RdRMomentsFollowingQuery) FirstIDX

func (rrfq *RdRMomentsFollowingQuery) FirstIDX(ctx context.Context) int64

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

func (*RdRMomentsFollowingQuery) FirstX

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

func (*RdRMomentsFollowingQuery) GroupBy

func (rrfq *RdRMomentsFollowingQuery) GroupBy(field string, fields ...string) *RdRMomentsFollowingGroupBy

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 {
	MomentID int64 `json:"moment_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RdRMomentsFollowing.Query().
	GroupBy(rdrmomentsfollowing.FieldMomentID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RdRMomentsFollowingQuery) IDs

func (rrfq *RdRMomentsFollowingQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*RdRMomentsFollowingQuery) IDsX

func (rrfq *RdRMomentsFollowingQuery) IDsX(ctx context.Context) []int64

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

func (*RdRMomentsFollowingQuery) Limit

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

func (*RdRMomentsFollowingQuery) Offset

Offset to start from.

func (*RdRMomentsFollowingQuery) Only

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

func (*RdRMomentsFollowingQuery) OnlyID

func (rrfq *RdRMomentsFollowingQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*RdRMomentsFollowingQuery) OnlyIDX

func (rrfq *RdRMomentsFollowingQuery) OnlyIDX(ctx context.Context) int64

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

func (*RdRMomentsFollowingQuery) OnlyX

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

func (*RdRMomentsFollowingQuery) Order

Order specifies how the records should be ordered.

func (*RdRMomentsFollowingQuery) Select

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 {
	MomentID int64 `json:"moment_id,omitempty"`
}

client.RdRMomentsFollowing.Query().
	Select(rdrmomentsfollowing.FieldMomentID).
	Scan(ctx, &v)

func (*RdRMomentsFollowingQuery) Unique

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

Where adds a new predicate for the RdRMomentsFollowingQuery builder.

type RdRMomentsFollowingSelect

type RdRMomentsFollowingSelect struct {
	*RdRMomentsFollowingQuery
	// contains filtered or unexported fields
}

RdRMomentsFollowingSelect is the builder for selecting fields of RdRMomentsFollowing entities.

func (*RdRMomentsFollowingSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*RdRMomentsFollowingSelect) Bool

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

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

func (*RdRMomentsFollowingSelect) BoolX

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

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

func (*RdRMomentsFollowingSelect) Bools

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

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

func (*RdRMomentsFollowingSelect) BoolsX

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

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

func (*RdRMomentsFollowingSelect) Float64

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

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

func (*RdRMomentsFollowingSelect) Float64X

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

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

func (*RdRMomentsFollowingSelect) Float64s

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

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

func (*RdRMomentsFollowingSelect) Float64sX

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

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

func (*RdRMomentsFollowingSelect) Int

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

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

func (*RdRMomentsFollowingSelect) IntX

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

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

func (*RdRMomentsFollowingSelect) Ints

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

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

func (*RdRMomentsFollowingSelect) IntsX

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

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

func (*RdRMomentsFollowingSelect) Scan

func (rrfs *RdRMomentsFollowingSelect) Scan(ctx context.Context, v any) error

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

func (*RdRMomentsFollowingSelect) ScanX

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

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

func (*RdRMomentsFollowingSelect) String

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

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

func (*RdRMomentsFollowingSelect) StringX

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

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

func (*RdRMomentsFollowingSelect) Strings

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

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

func (*RdRMomentsFollowingSelect) StringsX

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

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

type RdRMomentsFollowingUpdate

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

RdRMomentsFollowingUpdate is the builder for updating RdRMomentsFollowing entities.

func (*RdRMomentsFollowingUpdate) AddByUID

AddByUID adds i to the "by_uid" field.

func (*RdRMomentsFollowingUpdate) AddForUID

AddForUID adds i to the "for_uid" field.

func (*RdRMomentsFollowingUpdate) AddMomentID

AddMomentID adds i to the "moment_id" field.

func (*RdRMomentsFollowingUpdate) AddMomentType

AddMomentType adds i to the "moment_type" field.

func (*RdRMomentsFollowingUpdate) AddStatus

AddStatus adds i to the "status" field.

func (*RdRMomentsFollowingUpdate) AppendImgs

AppendImgs appends s to the "imgs" field.

func (*RdRMomentsFollowingUpdate) ClearByUID

ClearByUID clears the value of the "by_uid" field.

func (*RdRMomentsFollowingUpdate) ClearForUID

ClearForUID clears the value of the "for_uid" field.

func (*RdRMomentsFollowingUpdate) ClearMomentID

ClearMomentID clears the value of the "moment_id" field.

func (*RdRMomentsFollowingUpdate) ClearMomentType

func (rrfu *RdRMomentsFollowingUpdate) ClearMomentType() *RdRMomentsFollowingUpdate

ClearMomentType clears the value of the "moment_type" field.

func (*RdRMomentsFollowingUpdate) ClearStatus

ClearStatus clears the value of the "status" field.

func (*RdRMomentsFollowingUpdate) Exec

Exec executes the query.

func (*RdRMomentsFollowingUpdate) ExecX

func (rrfu *RdRMomentsFollowingUpdate) ExecX(ctx context.Context)

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

func (*RdRMomentsFollowingUpdate) Mutation

Mutation returns the RdRMomentsFollowingMutation object of the builder.

func (*RdRMomentsFollowingUpdate) Save

func (rrfu *RdRMomentsFollowingUpdate) Save(ctx context.Context) (int, error)

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

func (*RdRMomentsFollowingUpdate) SaveX

func (rrfu *RdRMomentsFollowingUpdate) SaveX(ctx context.Context) int

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

func (*RdRMomentsFollowingUpdate) SetByUID

SetByUID sets the "by_uid" field.

func (*RdRMomentsFollowingUpdate) SetForUID

SetForUID sets the "for_uid" field.

func (*RdRMomentsFollowingUpdate) SetImgs

SetImgs sets the "imgs" field.

func (*RdRMomentsFollowingUpdate) SetMomentID

SetMomentID sets the "moment_id" field.

func (*RdRMomentsFollowingUpdate) SetMomentType

SetMomentType sets the "moment_type" field.

func (*RdRMomentsFollowingUpdate) SetNillableByUID

func (rrfu *RdRMomentsFollowingUpdate) SetNillableByUID(i *int32) *RdRMomentsFollowingUpdate

SetNillableByUID sets the "by_uid" field if the given value is not nil.

func (*RdRMomentsFollowingUpdate) SetNillableForUID

func (rrfu *RdRMomentsFollowingUpdate) SetNillableForUID(i *int32) *RdRMomentsFollowingUpdate

SetNillableForUID sets the "for_uid" field if the given value is not nil.

func (*RdRMomentsFollowingUpdate) SetNillableMomentID

func (rrfu *RdRMomentsFollowingUpdate) SetNillableMomentID(i *int64) *RdRMomentsFollowingUpdate

SetNillableMomentID sets the "moment_id" field if the given value is not nil.

func (*RdRMomentsFollowingUpdate) SetNillableMomentType

func (rrfu *RdRMomentsFollowingUpdate) SetNillableMomentType(i *int32) *RdRMomentsFollowingUpdate

SetNillableMomentType sets the "moment_type" field if the given value is not nil.

func (*RdRMomentsFollowingUpdate) SetNillablePublishTime

func (rrfu *RdRMomentsFollowingUpdate) SetNillablePublishTime(t *time.Time) *RdRMomentsFollowingUpdate

SetNillablePublishTime sets the "publish_time" field if the given value is not nil.

func (*RdRMomentsFollowingUpdate) SetNillableStatus

func (rrfu *RdRMomentsFollowingUpdate) SetNillableStatus(i *int32) *RdRMomentsFollowingUpdate

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

func (*RdRMomentsFollowingUpdate) SetPublishTime

SetPublishTime sets the "publish_time" field.

func (*RdRMomentsFollowingUpdate) SetStatus

SetStatus sets the "status" field.

func (*RdRMomentsFollowingUpdate) SetTxt

SetTxt sets the "txt" field.

func (*RdRMomentsFollowingUpdate) Where

Where appends a list predicates to the RdRMomentsFollowingUpdate builder.

type RdRMomentsFollowingUpdateOne

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

RdRMomentsFollowingUpdateOne is the builder for updating a single RdRMomentsFollowing entity.

func (*RdRMomentsFollowingUpdateOne) AddByUID

AddByUID adds i to the "by_uid" field.

func (*RdRMomentsFollowingUpdateOne) AddForUID

AddForUID adds i to the "for_uid" field.

func (*RdRMomentsFollowingUpdateOne) AddMomentID

AddMomentID adds i to the "moment_id" field.

func (*RdRMomentsFollowingUpdateOne) AddMomentType

AddMomentType adds i to the "moment_type" field.

func (*RdRMomentsFollowingUpdateOne) AddStatus

AddStatus adds i to the "status" field.

func (*RdRMomentsFollowingUpdateOne) AppendImgs

AppendImgs appends s to the "imgs" field.

func (*RdRMomentsFollowingUpdateOne) ClearByUID

ClearByUID clears the value of the "by_uid" field.

func (*RdRMomentsFollowingUpdateOne) ClearForUID

ClearForUID clears the value of the "for_uid" field.

func (*RdRMomentsFollowingUpdateOne) ClearMomentID

ClearMomentID clears the value of the "moment_id" field.

func (*RdRMomentsFollowingUpdateOne) ClearMomentType

ClearMomentType clears the value of the "moment_type" field.

func (*RdRMomentsFollowingUpdateOne) ClearStatus

ClearStatus clears the value of the "status" field.

func (*RdRMomentsFollowingUpdateOne) Exec

Exec executes the query on the entity.

func (*RdRMomentsFollowingUpdateOne) ExecX

func (rrfuo *RdRMomentsFollowingUpdateOne) ExecX(ctx context.Context)

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

func (*RdRMomentsFollowingUpdateOne) Mutation

Mutation returns the RdRMomentsFollowingMutation object of the builder.

func (*RdRMomentsFollowingUpdateOne) Save

Save executes the query and returns the updated RdRMomentsFollowing entity.

func (*RdRMomentsFollowingUpdateOne) SaveX

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

func (*RdRMomentsFollowingUpdateOne) Select

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

func (*RdRMomentsFollowingUpdateOne) SetByUID

SetByUID sets the "by_uid" field.

func (*RdRMomentsFollowingUpdateOne) SetForUID

SetForUID sets the "for_uid" field.

func (*RdRMomentsFollowingUpdateOne) SetImgs

SetImgs sets the "imgs" field.

func (*RdRMomentsFollowingUpdateOne) SetMomentID

SetMomentID sets the "moment_id" field.

func (*RdRMomentsFollowingUpdateOne) SetMomentType

SetMomentType sets the "moment_type" field.

func (*RdRMomentsFollowingUpdateOne) SetNillableByUID

SetNillableByUID sets the "by_uid" field if the given value is not nil.

func (*RdRMomentsFollowingUpdateOne) SetNillableForUID

func (rrfuo *RdRMomentsFollowingUpdateOne) SetNillableForUID(i *int32) *RdRMomentsFollowingUpdateOne

SetNillableForUID sets the "for_uid" field if the given value is not nil.

func (*RdRMomentsFollowingUpdateOne) SetNillableMomentID

func (rrfuo *RdRMomentsFollowingUpdateOne) SetNillableMomentID(i *int64) *RdRMomentsFollowingUpdateOne

SetNillableMomentID sets the "moment_id" field if the given value is not nil.

func (*RdRMomentsFollowingUpdateOne) SetNillableMomentType

func (rrfuo *RdRMomentsFollowingUpdateOne) SetNillableMomentType(i *int32) *RdRMomentsFollowingUpdateOne

SetNillableMomentType sets the "moment_type" field if the given value is not nil.

func (*RdRMomentsFollowingUpdateOne) SetNillablePublishTime

func (rrfuo *RdRMomentsFollowingUpdateOne) SetNillablePublishTime(t *time.Time) *RdRMomentsFollowingUpdateOne

SetNillablePublishTime sets the "publish_time" field if the given value is not nil.

func (*RdRMomentsFollowingUpdateOne) SetNillableStatus

func (rrfuo *RdRMomentsFollowingUpdateOne) SetNillableStatus(i *int32) *RdRMomentsFollowingUpdateOne

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

func (*RdRMomentsFollowingUpdateOne) SetPublishTime

SetPublishTime sets the "publish_time" field.

func (*RdRMomentsFollowingUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*RdRMomentsFollowingUpdateOne) SetTxt

SetTxt sets the "txt" field.

type RdRMomentsFollowings

type RdRMomentsFollowings []*RdRMomentsFollowing

RdRMomentsFollowings is a parsable slice of RdRMomentsFollowing.

type RdRUserFollowers

type RdRUserFollowers struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// uid
	UID int32 `json:"uid,omitempty"`
	// 粉丝uid
	FollowersUID int32 `json:"followers_uid,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

RdRUserFollowers is the model entity for the RdRUserFollowers schema.

func (*RdRUserFollowers) String

func (rrf *RdRUserFollowers) String() string

String implements the fmt.Stringer.

func (*RdRUserFollowers) Unwrap

func (rrf *RdRUserFollowers) Unwrap() *RdRUserFollowers

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

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

type RdRUserFollowersClient

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

RdRUserFollowersClient is a client for the RdRUserFollowers schema.

func NewRdRUserFollowersClient

func NewRdRUserFollowersClient(c config) *RdRUserFollowersClient

NewRdRUserFollowersClient returns a client for the RdRUserFollowers from the given config.

func (*RdRUserFollowersClient) Create

Create returns a builder for creating a RdRUserFollowers entity.

func (*RdRUserFollowersClient) CreateBulk

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

func (*RdRUserFollowersClient) Delete

Delete returns a delete builder for RdRUserFollowers.

func (*RdRUserFollowersClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RdRUserFollowersClient) DeleteOneID

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

func (*RdRUserFollowersClient) Get

Get returns a RdRUserFollowers entity by its id.

func (*RdRUserFollowersClient) GetX

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

func (*RdRUserFollowersClient) Hooks

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

Hooks returns the client hooks.

func (*RdRUserFollowersClient) Intercept

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

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

func (*RdRUserFollowersClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RdRUserFollowersClient) Query

Query returns a query builder for RdRUserFollowers.

func (*RdRUserFollowersClient) Update

Update returns an update builder for RdRUserFollowers.

func (*RdRUserFollowersClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RdRUserFollowersClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*RdRUserFollowersClient) Use

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

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

type RdRUserFollowersCreate

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

RdRUserFollowersCreate is the builder for creating a RdRUserFollowers entity.

func (*RdRUserFollowersCreate) Exec

func (rrfc *RdRUserFollowersCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RdRUserFollowersCreate) ExecX

func (rrfc *RdRUserFollowersCreate) ExecX(ctx context.Context)

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

func (*RdRUserFollowersCreate) Mutation

Mutation returns the RdRUserFollowersMutation object of the builder.

func (*RdRUserFollowersCreate) Save

Save creates the RdRUserFollowers in the database.

func (*RdRUserFollowersCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*RdRUserFollowersCreate) SetCreateTime

func (rrfc *RdRUserFollowersCreate) SetCreateTime(t time.Time) *RdRUserFollowersCreate

SetCreateTime sets the "create_time" field.

func (*RdRUserFollowersCreate) SetFollowersUID

func (rrfc *RdRUserFollowersCreate) SetFollowersUID(i int32) *RdRUserFollowersCreate

SetFollowersUID sets the "followers_uid" field.

func (*RdRUserFollowersCreate) SetID

SetID sets the "id" field.

func (*RdRUserFollowersCreate) SetNillableCreateTime

func (rrfc *RdRUserFollowersCreate) SetNillableCreateTime(t *time.Time) *RdRUserFollowersCreate

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

func (*RdRUserFollowersCreate) SetNillableFollowersUID

func (rrfc *RdRUserFollowersCreate) SetNillableFollowersUID(i *int32) *RdRUserFollowersCreate

SetNillableFollowersUID sets the "followers_uid" field if the given value is not nil.

func (*RdRUserFollowersCreate) SetNillableUID

func (rrfc *RdRUserFollowersCreate) SetNillableUID(i *int32) *RdRUserFollowersCreate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*RdRUserFollowersCreate) SetUID

SetUID sets the "uid" field.

type RdRUserFollowersCreateBulk

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

RdRUserFollowersCreateBulk is the builder for creating many RdRUserFollowers entities in bulk.

func (*RdRUserFollowersCreateBulk) Exec

Exec executes the query.

func (*RdRUserFollowersCreateBulk) ExecX

func (rrfcb *RdRUserFollowersCreateBulk) ExecX(ctx context.Context)

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

func (*RdRUserFollowersCreateBulk) Save

Save creates the RdRUserFollowers entities in the database.

func (*RdRUserFollowersCreateBulk) SaveX

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

type RdRUserFollowersDelete

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

RdRUserFollowersDelete is the builder for deleting a RdRUserFollowers entity.

func (*RdRUserFollowersDelete) Exec

func (rrfd *RdRUserFollowersDelete) Exec(ctx context.Context) (int, error)

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

func (*RdRUserFollowersDelete) ExecX

func (rrfd *RdRUserFollowersDelete) ExecX(ctx context.Context) int

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

func (*RdRUserFollowersDelete) Where

Where appends a list predicates to the RdRUserFollowersDelete builder.

type RdRUserFollowersDeleteOne

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

RdRUserFollowersDeleteOne is the builder for deleting a single RdRUserFollowers entity.

func (*RdRUserFollowersDeleteOne) Exec

Exec executes the deletion query.

func (*RdRUserFollowersDeleteOne) ExecX

func (rrfdo *RdRUserFollowersDeleteOne) ExecX(ctx context.Context)

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

type RdRUserFollowersGroupBy

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

RdRUserFollowersGroupBy is the group-by builder for RdRUserFollowers entities.

func (*RdRUserFollowersGroupBy) Aggregate

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

func (*RdRUserFollowersGroupBy) Bool

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

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

func (*RdRUserFollowersGroupBy) BoolX

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

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

func (*RdRUserFollowersGroupBy) Bools

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

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

func (*RdRUserFollowersGroupBy) BoolsX

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

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

func (*RdRUserFollowersGroupBy) Float64

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

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

func (*RdRUserFollowersGroupBy) Float64X

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

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

func (*RdRUserFollowersGroupBy) Float64s

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

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

func (*RdRUserFollowersGroupBy) Float64sX

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

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

func (*RdRUserFollowersGroupBy) Int

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

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

func (*RdRUserFollowersGroupBy) IntX

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

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

func (*RdRUserFollowersGroupBy) Ints

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

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

func (*RdRUserFollowersGroupBy) IntsX

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

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

func (*RdRUserFollowersGroupBy) Scan

func (rrfgb *RdRUserFollowersGroupBy) Scan(ctx context.Context, v any) error

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

func (*RdRUserFollowersGroupBy) ScanX

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

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

func (*RdRUserFollowersGroupBy) String

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

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

func (*RdRUserFollowersGroupBy) StringX

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

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

func (*RdRUserFollowersGroupBy) Strings

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

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

func (*RdRUserFollowersGroupBy) StringsX

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

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

type RdRUserFollowersMutation

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

RdRUserFollowersMutation represents an operation that mutates the RdRUserFollowers nodes in the graph.

func (*RdRUserFollowersMutation) AddField

func (m *RdRUserFollowersMutation) 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 (*RdRUserFollowersMutation) AddFollowersUID

func (m *RdRUserFollowersMutation) AddFollowersUID(i int32)

AddFollowersUID adds i to the "followers_uid" field.

func (*RdRUserFollowersMutation) AddUID

func (m *RdRUserFollowersMutation) AddUID(i int32)

AddUID adds i to the "uid" field.

func (*RdRUserFollowersMutation) AddedEdges

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

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

func (*RdRUserFollowersMutation) AddedField

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

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

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

func (*RdRUserFollowersMutation) AddedFollowersUID

func (m *RdRUserFollowersMutation) AddedFollowersUID() (r int32, exists bool)

AddedFollowersUID returns the value that was added to the "followers_uid" field in this mutation.

func (*RdRUserFollowersMutation) AddedIDs

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

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

func (*RdRUserFollowersMutation) AddedUID

func (m *RdRUserFollowersMutation) AddedUID() (r int32, exists bool)

AddedUID returns the value that was added to the "uid" field in this mutation.

func (*RdRUserFollowersMutation) ClearEdge

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

func (m *RdRUserFollowersMutation) 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 (*RdRUserFollowersMutation) ClearFollowersUID

func (m *RdRUserFollowersMutation) ClearFollowersUID()

ClearFollowersUID clears the value of the "followers_uid" field.

func (*RdRUserFollowersMutation) ClearUID

func (m *RdRUserFollowersMutation) ClearUID()

ClearUID clears the value of the "uid" field.

func (*RdRUserFollowersMutation) ClearedEdges

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

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

func (*RdRUserFollowersMutation) ClearedFields

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

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

func (RdRUserFollowersMutation) Client

func (m RdRUserFollowersMutation) 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 (*RdRUserFollowersMutation) CreateTime

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

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

func (*RdRUserFollowersMutation) EdgeCleared

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

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

func (*RdRUserFollowersMutation) Field

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

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

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

func (*RdRUserFollowersMutation) Fields

func (m *RdRUserFollowersMutation) 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 (*RdRUserFollowersMutation) FollowersUID

func (m *RdRUserFollowersMutation) FollowersUID() (r int32, exists bool)

FollowersUID returns the value of the "followers_uid" field in the mutation.

func (*RdRUserFollowersMutation) FollowersUIDCleared

func (m *RdRUserFollowersMutation) FollowersUIDCleared() bool

FollowersUIDCleared returns if the "followers_uid" field was cleared in this mutation.

func (*RdRUserFollowersMutation) ID

func (m *RdRUserFollowersMutation) ID() (id int64, 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 (*RdRUserFollowersMutation) 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 (*RdRUserFollowersMutation) OldCreateTime

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

OldCreateTime returns the old "create_time" field's value of the RdRUserFollowers entity. If the RdRUserFollowers 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 (*RdRUserFollowersMutation) OldField

func (m *RdRUserFollowersMutation) 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 (*RdRUserFollowersMutation) OldFollowersUID

func (m *RdRUserFollowersMutation) OldFollowersUID(ctx context.Context) (v int32, err error)

OldFollowersUID returns the old "followers_uid" field's value of the RdRUserFollowers entity. If the RdRUserFollowers 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 (*RdRUserFollowersMutation) OldUID

func (m *RdRUserFollowersMutation) OldUID(ctx context.Context) (v int32, err error)

OldUID returns the old "uid" field's value of the RdRUserFollowers entity. If the RdRUserFollowers 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 (*RdRUserFollowersMutation) Op

func (m *RdRUserFollowersMutation) Op() Op

Op returns the operation name.

func (*RdRUserFollowersMutation) RemovedEdges

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

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

func (*RdRUserFollowersMutation) RemovedIDs

func (m *RdRUserFollowersMutation) 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 (*RdRUserFollowersMutation) ResetCreateTime

func (m *RdRUserFollowersMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*RdRUserFollowersMutation) ResetEdge

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

func (m *RdRUserFollowersMutation) 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 (*RdRUserFollowersMutation) ResetFollowersUID

func (m *RdRUserFollowersMutation) ResetFollowersUID()

ResetFollowersUID resets all changes to the "followers_uid" field.

func (*RdRUserFollowersMutation) ResetUID

func (m *RdRUserFollowersMutation) ResetUID()

ResetUID resets all changes to the "uid" field.

func (*RdRUserFollowersMutation) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*RdRUserFollowersMutation) SetField

func (m *RdRUserFollowersMutation) 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 (*RdRUserFollowersMutation) SetFollowersUID

func (m *RdRUserFollowersMutation) SetFollowersUID(i int32)

SetFollowersUID sets the "followers_uid" field.

func (*RdRUserFollowersMutation) SetID

func (m *RdRUserFollowersMutation) SetID(id int64)

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

func (*RdRUserFollowersMutation) SetOp

func (m *RdRUserFollowersMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RdRUserFollowersMutation) SetUID

func (m *RdRUserFollowersMutation) SetUID(i int32)

SetUID sets the "uid" field.

func (RdRUserFollowersMutation) Tx

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

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

func (*RdRUserFollowersMutation) Type

func (m *RdRUserFollowersMutation) Type() string

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

func (*RdRUserFollowersMutation) UID

func (m *RdRUserFollowersMutation) UID() (r int32, exists bool)

UID returns the value of the "uid" field in the mutation.

func (*RdRUserFollowersMutation) UIDCleared

func (m *RdRUserFollowersMutation) UIDCleared() bool

UIDCleared returns if the "uid" field was cleared in this mutation.

func (*RdRUserFollowersMutation) Where

Where appends a list predicates to the RdRUserFollowersMutation builder.

func (*RdRUserFollowersMutation) WhereP

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

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

type RdRUserFollowersQuery

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

RdRUserFollowersQuery is the builder for querying RdRUserFollowers entities.

func (*RdRUserFollowersQuery) Aggregate

Aggregate returns a RdRUserFollowersSelect configured with the given aggregations.

func (*RdRUserFollowersQuery) All

All executes the query and returns a list of RdRUserFollowersSlice.

func (*RdRUserFollowersQuery) AllX

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

func (*RdRUserFollowersQuery) Clone

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

func (*RdRUserFollowersQuery) Count

func (rrfq *RdRUserFollowersQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RdRUserFollowersQuery) CountX

func (rrfq *RdRUserFollowersQuery) CountX(ctx context.Context) int

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

func (*RdRUserFollowersQuery) Exist

func (rrfq *RdRUserFollowersQuery) Exist(ctx context.Context) (bool, error)

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

func (*RdRUserFollowersQuery) ExistX

func (rrfq *RdRUserFollowersQuery) ExistX(ctx context.Context) bool

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

func (*RdRUserFollowersQuery) First

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

func (*RdRUserFollowersQuery) FirstID

func (rrfq *RdRUserFollowersQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*RdRUserFollowersQuery) FirstIDX

func (rrfq *RdRUserFollowersQuery) FirstIDX(ctx context.Context) int64

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

func (*RdRUserFollowersQuery) FirstX

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

func (*RdRUserFollowersQuery) GroupBy

func (rrfq *RdRUserFollowersQuery) GroupBy(field string, fields ...string) *RdRUserFollowersGroupBy

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 {
	UID int32 `json:"uid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RdRUserFollowers.Query().
	GroupBy(rdruserfollowers.FieldUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RdRUserFollowersQuery) IDs

func (rrfq *RdRUserFollowersQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*RdRUserFollowersQuery) IDsX

func (rrfq *RdRUserFollowersQuery) IDsX(ctx context.Context) []int64

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

func (*RdRUserFollowersQuery) Limit

func (rrfq *RdRUserFollowersQuery) Limit(limit int) *RdRUserFollowersQuery

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

func (*RdRUserFollowersQuery) Offset

func (rrfq *RdRUserFollowersQuery) Offset(offset int) *RdRUserFollowersQuery

Offset to start from.

func (*RdRUserFollowersQuery) Only

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

func (*RdRUserFollowersQuery) OnlyID

func (rrfq *RdRUserFollowersQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*RdRUserFollowersQuery) OnlyIDX

func (rrfq *RdRUserFollowersQuery) OnlyIDX(ctx context.Context) int64

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

func (*RdRUserFollowersQuery) OnlyX

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

func (*RdRUserFollowersQuery) Order

Order specifies how the records should be ordered.

func (*RdRUserFollowersQuery) Select

func (rrfq *RdRUserFollowersQuery) Select(fields ...string) *RdRUserFollowersSelect

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 {
	UID int32 `json:"uid,omitempty"`
}

client.RdRUserFollowers.Query().
	Select(rdruserfollowers.FieldUID).
	Scan(ctx, &v)

func (*RdRUserFollowersQuery) Unique

func (rrfq *RdRUserFollowersQuery) Unique(unique bool) *RdRUserFollowersQuery

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

Where adds a new predicate for the RdRUserFollowersQuery builder.

type RdRUserFollowersSelect

type RdRUserFollowersSelect struct {
	*RdRUserFollowersQuery
	// contains filtered or unexported fields
}

RdRUserFollowersSelect is the builder for selecting fields of RdRUserFollowers entities.

func (*RdRUserFollowersSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*RdRUserFollowersSelect) Bool

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

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

func (*RdRUserFollowersSelect) BoolX

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

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

func (*RdRUserFollowersSelect) Bools

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

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

func (*RdRUserFollowersSelect) BoolsX

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

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

func (*RdRUserFollowersSelect) Float64

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

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

func (*RdRUserFollowersSelect) Float64X

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

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

func (*RdRUserFollowersSelect) Float64s

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

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

func (*RdRUserFollowersSelect) Float64sX

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

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

func (*RdRUserFollowersSelect) Int

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

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

func (*RdRUserFollowersSelect) IntX

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

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

func (*RdRUserFollowersSelect) Ints

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

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

func (*RdRUserFollowersSelect) IntsX

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

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

func (*RdRUserFollowersSelect) Scan

func (rrfs *RdRUserFollowersSelect) Scan(ctx context.Context, v any) error

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

func (*RdRUserFollowersSelect) ScanX

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

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

func (*RdRUserFollowersSelect) String

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

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

func (*RdRUserFollowersSelect) StringX

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

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

func (*RdRUserFollowersSelect) Strings

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

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

func (*RdRUserFollowersSelect) StringsX

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

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

type RdRUserFollowersSlice

type RdRUserFollowersSlice []*RdRUserFollowers

RdRUserFollowersSlice is a parsable slice of RdRUserFollowers.

type RdRUserFollowersUpdate

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

RdRUserFollowersUpdate is the builder for updating RdRUserFollowers entities.

func (*RdRUserFollowersUpdate) AddFollowersUID

func (rrfu *RdRUserFollowersUpdate) AddFollowersUID(i int32) *RdRUserFollowersUpdate

AddFollowersUID adds i to the "followers_uid" field.

func (*RdRUserFollowersUpdate) AddUID

AddUID adds i to the "uid" field.

func (*RdRUserFollowersUpdate) ClearFollowersUID

func (rrfu *RdRUserFollowersUpdate) ClearFollowersUID() *RdRUserFollowersUpdate

ClearFollowersUID clears the value of the "followers_uid" field.

func (*RdRUserFollowersUpdate) ClearUID

ClearUID clears the value of the "uid" field.

func (*RdRUserFollowersUpdate) Exec

func (rrfu *RdRUserFollowersUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RdRUserFollowersUpdate) ExecX

func (rrfu *RdRUserFollowersUpdate) ExecX(ctx context.Context)

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

func (*RdRUserFollowersUpdate) Mutation

Mutation returns the RdRUserFollowersMutation object of the builder.

func (*RdRUserFollowersUpdate) Save

func (rrfu *RdRUserFollowersUpdate) Save(ctx context.Context) (int, error)

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

func (*RdRUserFollowersUpdate) SaveX

func (rrfu *RdRUserFollowersUpdate) SaveX(ctx context.Context) int

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

func (*RdRUserFollowersUpdate) SetCreateTime

func (rrfu *RdRUserFollowersUpdate) SetCreateTime(t time.Time) *RdRUserFollowersUpdate

SetCreateTime sets the "create_time" field.

func (*RdRUserFollowersUpdate) SetFollowersUID

func (rrfu *RdRUserFollowersUpdate) SetFollowersUID(i int32) *RdRUserFollowersUpdate

SetFollowersUID sets the "followers_uid" field.

func (*RdRUserFollowersUpdate) SetNillableCreateTime

func (rrfu *RdRUserFollowersUpdate) SetNillableCreateTime(t *time.Time) *RdRUserFollowersUpdate

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

func (*RdRUserFollowersUpdate) SetNillableFollowersUID

func (rrfu *RdRUserFollowersUpdate) SetNillableFollowersUID(i *int32) *RdRUserFollowersUpdate

SetNillableFollowersUID sets the "followers_uid" field if the given value is not nil.

func (*RdRUserFollowersUpdate) SetNillableUID

func (rrfu *RdRUserFollowersUpdate) SetNillableUID(i *int32) *RdRUserFollowersUpdate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*RdRUserFollowersUpdate) SetUID

SetUID sets the "uid" field.

func (*RdRUserFollowersUpdate) Where

Where appends a list predicates to the RdRUserFollowersUpdate builder.

type RdRUserFollowersUpdateOne

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

RdRUserFollowersUpdateOne is the builder for updating a single RdRUserFollowers entity.

func (*RdRUserFollowersUpdateOne) AddFollowersUID

func (rrfuo *RdRUserFollowersUpdateOne) AddFollowersUID(i int32) *RdRUserFollowersUpdateOne

AddFollowersUID adds i to the "followers_uid" field.

func (*RdRUserFollowersUpdateOne) AddUID

AddUID adds i to the "uid" field.

func (*RdRUserFollowersUpdateOne) ClearFollowersUID

func (rrfuo *RdRUserFollowersUpdateOne) ClearFollowersUID() *RdRUserFollowersUpdateOne

ClearFollowersUID clears the value of the "followers_uid" field.

func (*RdRUserFollowersUpdateOne) ClearUID

ClearUID clears the value of the "uid" field.

func (*RdRUserFollowersUpdateOne) Exec

Exec executes the query on the entity.

func (*RdRUserFollowersUpdateOne) ExecX

func (rrfuo *RdRUserFollowersUpdateOne) ExecX(ctx context.Context)

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

func (*RdRUserFollowersUpdateOne) Mutation

Mutation returns the RdRUserFollowersMutation object of the builder.

func (*RdRUserFollowersUpdateOne) Save

Save executes the query and returns the updated RdRUserFollowers entity.

func (*RdRUserFollowersUpdateOne) SaveX

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

func (*RdRUserFollowersUpdateOne) Select

func (rrfuo *RdRUserFollowersUpdateOne) Select(field string, fields ...string) *RdRUserFollowersUpdateOne

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

func (*RdRUserFollowersUpdateOne) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*RdRUserFollowersUpdateOne) SetFollowersUID

func (rrfuo *RdRUserFollowersUpdateOne) SetFollowersUID(i int32) *RdRUserFollowersUpdateOne

SetFollowersUID sets the "followers_uid" field.

func (*RdRUserFollowersUpdateOne) SetNillableCreateTime

func (rrfuo *RdRUserFollowersUpdateOne) SetNillableCreateTime(t *time.Time) *RdRUserFollowersUpdateOne

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

func (*RdRUserFollowersUpdateOne) SetNillableFollowersUID

func (rrfuo *RdRUserFollowersUpdateOne) SetNillableFollowersUID(i *int32) *RdRUserFollowersUpdateOne

SetNillableFollowersUID sets the "followers_uid" field if the given value is not nil.

func (*RdRUserFollowersUpdateOne) SetNillableUID

func (rrfuo *RdRUserFollowersUpdateOne) SetNillableUID(i *int32) *RdRUserFollowersUpdateOne

SetNillableUID sets the "uid" field if the given value is not nil.

func (*RdRUserFollowersUpdateOne) SetUID

SetUID sets the "uid" field.

type RdRUserFollowing

type RdRUserFollowing struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// uid
	UID int32 `json:"uid,omitempty"`
	// 关注的人uid
	FollowingUID int32 `json:"following_uid,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

RdRUserFollowing is the model entity for the RdRUserFollowing schema.

func (*RdRUserFollowing) String

func (rrf *RdRUserFollowing) String() string

String implements the fmt.Stringer.

func (*RdRUserFollowing) Unwrap

func (rrf *RdRUserFollowing) Unwrap() *RdRUserFollowing

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

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

type RdRUserFollowingClient

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

RdRUserFollowingClient is a client for the RdRUserFollowing schema.

func NewRdRUserFollowingClient

func NewRdRUserFollowingClient(c config) *RdRUserFollowingClient

NewRdRUserFollowingClient returns a client for the RdRUserFollowing from the given config.

func (*RdRUserFollowingClient) Create

Create returns a builder for creating a RdRUserFollowing entity.

func (*RdRUserFollowingClient) CreateBulk

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

func (*RdRUserFollowingClient) Delete

Delete returns a delete builder for RdRUserFollowing.

func (*RdRUserFollowingClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RdRUserFollowingClient) DeleteOneID

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

func (*RdRUserFollowingClient) Get

Get returns a RdRUserFollowing entity by its id.

func (*RdRUserFollowingClient) GetX

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

func (*RdRUserFollowingClient) Hooks

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

Hooks returns the client hooks.

func (*RdRUserFollowingClient) Intercept

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

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

func (*RdRUserFollowingClient) Interceptors

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

Interceptors returns the client interceptors.

func (*RdRUserFollowingClient) Query

Query returns a query builder for RdRUserFollowing.

func (*RdRUserFollowingClient) Update

Update returns an update builder for RdRUserFollowing.

func (*RdRUserFollowingClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*RdRUserFollowingClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*RdRUserFollowingClient) Use

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

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

type RdRUserFollowingCreate

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

RdRUserFollowingCreate is the builder for creating a RdRUserFollowing entity.

func (*RdRUserFollowingCreate) Exec

func (rrfc *RdRUserFollowingCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RdRUserFollowingCreate) ExecX

func (rrfc *RdRUserFollowingCreate) ExecX(ctx context.Context)

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

func (*RdRUserFollowingCreate) Mutation

Mutation returns the RdRUserFollowingMutation object of the builder.

func (*RdRUserFollowingCreate) Save

Save creates the RdRUserFollowing in the database.

func (*RdRUserFollowingCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*RdRUserFollowingCreate) SetCreateTime

func (rrfc *RdRUserFollowingCreate) SetCreateTime(t time.Time) *RdRUserFollowingCreate

SetCreateTime sets the "create_time" field.

func (*RdRUserFollowingCreate) SetFollowingUID

func (rrfc *RdRUserFollowingCreate) SetFollowingUID(i int32) *RdRUserFollowingCreate

SetFollowingUID sets the "following_uid" field.

func (*RdRUserFollowingCreate) SetID

SetID sets the "id" field.

func (*RdRUserFollowingCreate) SetNillableCreateTime

func (rrfc *RdRUserFollowingCreate) SetNillableCreateTime(t *time.Time) *RdRUserFollowingCreate

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

func (*RdRUserFollowingCreate) SetNillableFollowingUID

func (rrfc *RdRUserFollowingCreate) SetNillableFollowingUID(i *int32) *RdRUserFollowingCreate

SetNillableFollowingUID sets the "following_uid" field if the given value is not nil.

func (*RdRUserFollowingCreate) SetNillableUID

func (rrfc *RdRUserFollowingCreate) SetNillableUID(i *int32) *RdRUserFollowingCreate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*RdRUserFollowingCreate) SetUID

SetUID sets the "uid" field.

type RdRUserFollowingCreateBulk

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

RdRUserFollowingCreateBulk is the builder for creating many RdRUserFollowing entities in bulk.

func (*RdRUserFollowingCreateBulk) Exec

Exec executes the query.

func (*RdRUserFollowingCreateBulk) ExecX

func (rrfcb *RdRUserFollowingCreateBulk) ExecX(ctx context.Context)

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

func (*RdRUserFollowingCreateBulk) Save

Save creates the RdRUserFollowing entities in the database.

func (*RdRUserFollowingCreateBulk) SaveX

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

type RdRUserFollowingDelete

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

RdRUserFollowingDelete is the builder for deleting a RdRUserFollowing entity.

func (*RdRUserFollowingDelete) Exec

func (rrfd *RdRUserFollowingDelete) Exec(ctx context.Context) (int, error)

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

func (*RdRUserFollowingDelete) ExecX

func (rrfd *RdRUserFollowingDelete) ExecX(ctx context.Context) int

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

func (*RdRUserFollowingDelete) Where

Where appends a list predicates to the RdRUserFollowingDelete builder.

type RdRUserFollowingDeleteOne

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

RdRUserFollowingDeleteOne is the builder for deleting a single RdRUserFollowing entity.

func (*RdRUserFollowingDeleteOne) Exec

Exec executes the deletion query.

func (*RdRUserFollowingDeleteOne) ExecX

func (rrfdo *RdRUserFollowingDeleteOne) ExecX(ctx context.Context)

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

type RdRUserFollowingGroupBy

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

RdRUserFollowingGroupBy is the group-by builder for RdRUserFollowing entities.

func (*RdRUserFollowingGroupBy) Aggregate

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

func (*RdRUserFollowingGroupBy) Bool

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

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

func (*RdRUserFollowingGroupBy) BoolX

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

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

func (*RdRUserFollowingGroupBy) Bools

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

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

func (*RdRUserFollowingGroupBy) BoolsX

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

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

func (*RdRUserFollowingGroupBy) Float64

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

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

func (*RdRUserFollowingGroupBy) Float64X

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

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

func (*RdRUserFollowingGroupBy) Float64s

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

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

func (*RdRUserFollowingGroupBy) Float64sX

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

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

func (*RdRUserFollowingGroupBy) Int

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

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

func (*RdRUserFollowingGroupBy) IntX

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

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

func (*RdRUserFollowingGroupBy) Ints

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

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

func (*RdRUserFollowingGroupBy) IntsX

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

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

func (*RdRUserFollowingGroupBy) Scan

func (rrfgb *RdRUserFollowingGroupBy) Scan(ctx context.Context, v any) error

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

func (*RdRUserFollowingGroupBy) ScanX

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

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

func (*RdRUserFollowingGroupBy) String

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

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

func (*RdRUserFollowingGroupBy) StringX

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

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

func (*RdRUserFollowingGroupBy) Strings

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

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

func (*RdRUserFollowingGroupBy) StringsX

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

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

type RdRUserFollowingMutation

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

RdRUserFollowingMutation represents an operation that mutates the RdRUserFollowing nodes in the graph.

func (*RdRUserFollowingMutation) AddField

func (m *RdRUserFollowingMutation) 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 (*RdRUserFollowingMutation) AddFollowingUID

func (m *RdRUserFollowingMutation) AddFollowingUID(i int32)

AddFollowingUID adds i to the "following_uid" field.

func (*RdRUserFollowingMutation) AddUID

func (m *RdRUserFollowingMutation) AddUID(i int32)

AddUID adds i to the "uid" field.

func (*RdRUserFollowingMutation) AddedEdges

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

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

func (*RdRUserFollowingMutation) AddedField

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

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

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

func (*RdRUserFollowingMutation) AddedFollowingUID

func (m *RdRUserFollowingMutation) AddedFollowingUID() (r int32, exists bool)

AddedFollowingUID returns the value that was added to the "following_uid" field in this mutation.

func (*RdRUserFollowingMutation) AddedIDs

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

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

func (*RdRUserFollowingMutation) AddedUID

func (m *RdRUserFollowingMutation) AddedUID() (r int32, exists bool)

AddedUID returns the value that was added to the "uid" field in this mutation.

func (*RdRUserFollowingMutation) ClearEdge

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

func (m *RdRUserFollowingMutation) 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 (*RdRUserFollowingMutation) ClearFollowingUID

func (m *RdRUserFollowingMutation) ClearFollowingUID()

ClearFollowingUID clears the value of the "following_uid" field.

func (*RdRUserFollowingMutation) ClearUID

func (m *RdRUserFollowingMutation) ClearUID()

ClearUID clears the value of the "uid" field.

func (*RdRUserFollowingMutation) ClearedEdges

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

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

func (*RdRUserFollowingMutation) ClearedFields

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

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

func (RdRUserFollowingMutation) Client

func (m RdRUserFollowingMutation) 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 (*RdRUserFollowingMutation) CreateTime

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

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

func (*RdRUserFollowingMutation) EdgeCleared

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

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

func (*RdRUserFollowingMutation) Field

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

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

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

func (*RdRUserFollowingMutation) Fields

func (m *RdRUserFollowingMutation) 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 (*RdRUserFollowingMutation) FollowingUID

func (m *RdRUserFollowingMutation) FollowingUID() (r int32, exists bool)

FollowingUID returns the value of the "following_uid" field in the mutation.

func (*RdRUserFollowingMutation) FollowingUIDCleared

func (m *RdRUserFollowingMutation) FollowingUIDCleared() bool

FollowingUIDCleared returns if the "following_uid" field was cleared in this mutation.

func (*RdRUserFollowingMutation) ID

func (m *RdRUserFollowingMutation) ID() (id int64, 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 (*RdRUserFollowingMutation) 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 (*RdRUserFollowingMutation) OldCreateTime

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

OldCreateTime returns the old "create_time" field's value of the RdRUserFollowing entity. If the RdRUserFollowing 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 (*RdRUserFollowingMutation) OldField

func (m *RdRUserFollowingMutation) 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 (*RdRUserFollowingMutation) OldFollowingUID

func (m *RdRUserFollowingMutation) OldFollowingUID(ctx context.Context) (v int32, err error)

OldFollowingUID returns the old "following_uid" field's value of the RdRUserFollowing entity. If the RdRUserFollowing 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 (*RdRUserFollowingMutation) OldUID

func (m *RdRUserFollowingMutation) OldUID(ctx context.Context) (v int32, err error)

OldUID returns the old "uid" field's value of the RdRUserFollowing entity. If the RdRUserFollowing 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 (*RdRUserFollowingMutation) Op

func (m *RdRUserFollowingMutation) Op() Op

Op returns the operation name.

func (*RdRUserFollowingMutation) RemovedEdges

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

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

func (*RdRUserFollowingMutation) RemovedIDs

func (m *RdRUserFollowingMutation) 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 (*RdRUserFollowingMutation) ResetCreateTime

func (m *RdRUserFollowingMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*RdRUserFollowingMutation) ResetEdge

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

func (m *RdRUserFollowingMutation) 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 (*RdRUserFollowingMutation) ResetFollowingUID

func (m *RdRUserFollowingMutation) ResetFollowingUID()

ResetFollowingUID resets all changes to the "following_uid" field.

func (*RdRUserFollowingMutation) ResetUID

func (m *RdRUserFollowingMutation) ResetUID()

ResetUID resets all changes to the "uid" field.

func (*RdRUserFollowingMutation) SetCreateTime

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

SetCreateTime sets the "create_time" field.

func (*RdRUserFollowingMutation) SetField

func (m *RdRUserFollowingMutation) 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 (*RdRUserFollowingMutation) SetFollowingUID

func (m *RdRUserFollowingMutation) SetFollowingUID(i int32)

SetFollowingUID sets the "following_uid" field.

func (*RdRUserFollowingMutation) SetID

func (m *RdRUserFollowingMutation) SetID(id int64)

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

func (*RdRUserFollowingMutation) SetOp

func (m *RdRUserFollowingMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RdRUserFollowingMutation) SetUID

func (m *RdRUserFollowingMutation) SetUID(i int32)

SetUID sets the "uid" field.

func (RdRUserFollowingMutation) Tx

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

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

func (*RdRUserFollowingMutation) Type

func (m *RdRUserFollowingMutation) Type() string

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

func (*RdRUserFollowingMutation) UID

func (m *RdRUserFollowingMutation) UID() (r int32, exists bool)

UID returns the value of the "uid" field in the mutation.

func (*RdRUserFollowingMutation) UIDCleared

func (m *RdRUserFollowingMutation) UIDCleared() bool

UIDCleared returns if the "uid" field was cleared in this mutation.

func (*RdRUserFollowingMutation) Where

Where appends a list predicates to the RdRUserFollowingMutation builder.

func (*RdRUserFollowingMutation) WhereP

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

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

type RdRUserFollowingQuery

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

RdRUserFollowingQuery is the builder for querying RdRUserFollowing entities.

func (*RdRUserFollowingQuery) Aggregate

Aggregate returns a RdRUserFollowingSelect configured with the given aggregations.

func (*RdRUserFollowingQuery) All

All executes the query and returns a list of RdRUserFollowings.

func (*RdRUserFollowingQuery) AllX

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

func (*RdRUserFollowingQuery) Clone

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

func (*RdRUserFollowingQuery) Count

func (rrfq *RdRUserFollowingQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RdRUserFollowingQuery) CountX

func (rrfq *RdRUserFollowingQuery) CountX(ctx context.Context) int

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

func (*RdRUserFollowingQuery) Exist

func (rrfq *RdRUserFollowingQuery) Exist(ctx context.Context) (bool, error)

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

func (*RdRUserFollowingQuery) ExistX

func (rrfq *RdRUserFollowingQuery) ExistX(ctx context.Context) bool

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

func (*RdRUserFollowingQuery) First

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

func (*RdRUserFollowingQuery) FirstID

func (rrfq *RdRUserFollowingQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*RdRUserFollowingQuery) FirstIDX

func (rrfq *RdRUserFollowingQuery) FirstIDX(ctx context.Context) int64

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

func (*RdRUserFollowingQuery) FirstX

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

func (*RdRUserFollowingQuery) GroupBy

func (rrfq *RdRUserFollowingQuery) GroupBy(field string, fields ...string) *RdRUserFollowingGroupBy

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 {
	UID int32 `json:"uid,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RdRUserFollowing.Query().
	GroupBy(rdruserfollowing.FieldUID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RdRUserFollowingQuery) IDs

func (rrfq *RdRUserFollowingQuery) IDs(ctx context.Context) ([]int64, error)

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

func (*RdRUserFollowingQuery) IDsX

func (rrfq *RdRUserFollowingQuery) IDsX(ctx context.Context) []int64

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

func (*RdRUserFollowingQuery) Limit

func (rrfq *RdRUserFollowingQuery) Limit(limit int) *RdRUserFollowingQuery

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

func (*RdRUserFollowingQuery) Offset

func (rrfq *RdRUserFollowingQuery) Offset(offset int) *RdRUserFollowingQuery

Offset to start from.

func (*RdRUserFollowingQuery) Only

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

func (*RdRUserFollowingQuery) OnlyID

func (rrfq *RdRUserFollowingQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*RdRUserFollowingQuery) OnlyIDX

func (rrfq *RdRUserFollowingQuery) OnlyIDX(ctx context.Context) int64

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

func (*RdRUserFollowingQuery) OnlyX

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

func (*RdRUserFollowingQuery) Order

Order specifies how the records should be ordered.

func (*RdRUserFollowingQuery) Select

func (rrfq *RdRUserFollowingQuery) Select(fields ...string) *RdRUserFollowingSelect

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 {
	UID int32 `json:"uid,omitempty"`
}

client.RdRUserFollowing.Query().
	Select(rdruserfollowing.FieldUID).
	Scan(ctx, &v)

func (*RdRUserFollowingQuery) Unique

func (rrfq *RdRUserFollowingQuery) Unique(unique bool) *RdRUserFollowingQuery

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

Where adds a new predicate for the RdRUserFollowingQuery builder.

type RdRUserFollowingSelect

type RdRUserFollowingSelect struct {
	*RdRUserFollowingQuery
	// contains filtered or unexported fields
}

RdRUserFollowingSelect is the builder for selecting fields of RdRUserFollowing entities.

func (*RdRUserFollowingSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*RdRUserFollowingSelect) Bool

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

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

func (*RdRUserFollowingSelect) BoolX

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

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

func (*RdRUserFollowingSelect) Bools

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

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

func (*RdRUserFollowingSelect) BoolsX

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

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

func (*RdRUserFollowingSelect) Float64

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

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

func (*RdRUserFollowingSelect) Float64X

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

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

func (*RdRUserFollowingSelect) Float64s

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

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

func (*RdRUserFollowingSelect) Float64sX

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

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

func (*RdRUserFollowingSelect) Int

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

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

func (*RdRUserFollowingSelect) IntX

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

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

func (*RdRUserFollowingSelect) Ints

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

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

func (*RdRUserFollowingSelect) IntsX

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

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

func (*RdRUserFollowingSelect) Scan

func (rrfs *RdRUserFollowingSelect) Scan(ctx context.Context, v any) error

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

func (*RdRUserFollowingSelect) ScanX

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

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

func (*RdRUserFollowingSelect) String

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

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

func (*RdRUserFollowingSelect) StringX

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

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

func (*RdRUserFollowingSelect) Strings

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

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

func (*RdRUserFollowingSelect) StringsX

func (s *RdRUserFollowingSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RdRUserFollowingUpdate

type RdRUserFollowingUpdate struct {
	// contains filtered or unexported fields
}

RdRUserFollowingUpdate is the builder for updating RdRUserFollowing entities.

func (*RdRUserFollowingUpdate) AddFollowingUID

func (rrfu *RdRUserFollowingUpdate) AddFollowingUID(i int32) *RdRUserFollowingUpdate

AddFollowingUID adds i to the "following_uid" field.

func (*RdRUserFollowingUpdate) AddUID

AddUID adds i to the "uid" field.

func (*RdRUserFollowingUpdate) ClearFollowingUID

func (rrfu *RdRUserFollowingUpdate) ClearFollowingUID() *RdRUserFollowingUpdate

ClearFollowingUID clears the value of the "following_uid" field.

func (*RdRUserFollowingUpdate) ClearUID

ClearUID clears the value of the "uid" field.

func (*RdRUserFollowingUpdate) Exec

func (rrfu *RdRUserFollowingUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RdRUserFollowingUpdate) ExecX

func (rrfu *RdRUserFollowingUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RdRUserFollowingUpdate) Mutation

Mutation returns the RdRUserFollowingMutation object of the builder.

func (*RdRUserFollowingUpdate) Save

func (rrfu *RdRUserFollowingUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RdRUserFollowingUpdate) SaveX

func (rrfu *RdRUserFollowingUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RdRUserFollowingUpdate) SetCreateTime

func (rrfu *RdRUserFollowingUpdate) SetCreateTime(t time.Time) *RdRUserFollowingUpdate

SetCreateTime sets the "create_time" field.

func (*RdRUserFollowingUpdate) SetFollowingUID

func (rrfu *RdRUserFollowingUpdate) SetFollowingUID(i int32) *RdRUserFollowingUpdate

SetFollowingUID sets the "following_uid" field.

func (*RdRUserFollowingUpdate) SetNillableCreateTime

func (rrfu *RdRUserFollowingUpdate) SetNillableCreateTime(t *time.Time) *RdRUserFollowingUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*RdRUserFollowingUpdate) SetNillableFollowingUID

func (rrfu *RdRUserFollowingUpdate) SetNillableFollowingUID(i *int32) *RdRUserFollowingUpdate

SetNillableFollowingUID sets the "following_uid" field if the given value is not nil.

func (*RdRUserFollowingUpdate) SetNillableUID

func (rrfu *RdRUserFollowingUpdate) SetNillableUID(i *int32) *RdRUserFollowingUpdate

SetNillableUID sets the "uid" field if the given value is not nil.

func (*RdRUserFollowingUpdate) SetUID

SetUID sets the "uid" field.

func (*RdRUserFollowingUpdate) Where

Where appends a list predicates to the RdRUserFollowingUpdate builder.

type RdRUserFollowingUpdateOne

type RdRUserFollowingUpdateOne struct {
	// contains filtered or unexported fields
}

RdRUserFollowingUpdateOne is the builder for updating a single RdRUserFollowing entity.

func (*RdRUserFollowingUpdateOne) AddFollowingUID

func (rrfuo *RdRUserFollowingUpdateOne) AddFollowingUID(i int32) *RdRUserFollowingUpdateOne

AddFollowingUID adds i to the "following_uid" field.

func (*RdRUserFollowingUpdateOne) AddUID

AddUID adds i to the "uid" field.

func (*RdRUserFollowingUpdateOne) ClearFollowingUID

func (rrfuo *RdRUserFollowingUpdateOne) ClearFollowingUID() *RdRUserFollowingUpdateOne

ClearFollowingUID clears the value of the "following_uid" field.

func (*RdRUserFollowingUpdateOne) ClearUID

ClearUID clears the value of the "uid" field.

func (*RdRUserFollowingUpdateOne) Exec

Exec executes the query on the entity.

func (*RdRUserFollowingUpdateOne) ExecX

func (rrfuo *RdRUserFollowingUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RdRUserFollowingUpdateOne) Mutation

Mutation returns the RdRUserFollowingMutation object of the builder.

func (*RdRUserFollowingUpdateOne) Save

Save executes the query and returns the updated RdRUserFollowing entity.

func (*RdRUserFollowingUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*RdRUserFollowingUpdateOne) Select

func (rrfuo *RdRUserFollowingUpdateOne) Select(field string, fields ...string) *RdRUserFollowingUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RdRUserFollowingUpdateOne) SetCreateTime

SetCreateTime sets the "create_time" field.

func (*RdRUserFollowingUpdateOne) SetFollowingUID

func (rrfuo *RdRUserFollowingUpdateOne) SetFollowingUID(i int32) *RdRUserFollowingUpdateOne

SetFollowingUID sets the "following_uid" field.

func (*RdRUserFollowingUpdateOne) SetNillableCreateTime

func (rrfuo *RdRUserFollowingUpdateOne) SetNillableCreateTime(t *time.Time) *RdRUserFollowingUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*RdRUserFollowingUpdateOne) SetNillableFollowingUID

func (rrfuo *RdRUserFollowingUpdateOne) SetNillableFollowingUID(i *int32) *RdRUserFollowingUpdateOne

SetNillableFollowingUID sets the "following_uid" field if the given value is not nil.

func (*RdRUserFollowingUpdateOne) SetNillableUID

func (rrfuo *RdRUserFollowingUpdateOne) SetNillableUID(i *int32) *RdRUserFollowingUpdateOne

SetNillableUID sets the "uid" field if the given value is not nil.

func (*RdRUserFollowingUpdateOne) SetUID

SetUID sets the "uid" field.

type RdRUserFollowings

type RdRUserFollowings []*RdRUserFollowing

RdRUserFollowings is a parsable slice of RdRUserFollowing.

type RdUser

type RdUser struct {

	// ID of the ent.
	// 用户ID
	ID int32 `json:"id,omitempty"`
	// 昵称
	Nick string `json:"nick,omitempty"`
	// 状态 1可用 2不可用
	Status int32 `json:"status,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// contains filtered or unexported fields
}

RdUser is the model entity for the RdUser schema.

func (*RdUser) String

func (ru *RdUser) String() string

String implements the fmt.Stringer.

func (*RdUser) Unwrap

func (ru *RdUser) Unwrap() *RdUser

Unwrap unwraps the RdUser 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 (*RdUser) Update

func (ru *RdUser) Update() *RdUserUpdateOne

Update returns a builder for updating this RdUser. Note that you need to call RdUser.Unwrap() before calling this method if this RdUser was returned from a transaction, and the transaction was committed or rolled back.

type RdUserClient

type RdUserClient struct {
	// contains filtered or unexported fields
}

RdUserClient is a client for the RdUser schema.

func NewRdUserClient

func NewRdUserClient(c config) *RdUserClient

NewRdUserClient returns a client for the RdUser from the given config.

func (*RdUserClient) Create

func (c *RdUserClient) Create() *RdUserCreate

Create returns a builder for creating a RdUser entity.

func (*RdUserClient) CreateBulk

func (c *RdUserClient) CreateBulk(builders ...*RdUserCreate) *RdUserCreateBulk

CreateBulk returns a builder for creating a bulk of RdUser entities.

func (*RdUserClient) Delete

func (c *RdUserClient) Delete() *RdUserDelete

Delete returns a delete builder for RdUser.

func (*RdUserClient) DeleteOne

func (c *RdUserClient) DeleteOne(ru *RdUser) *RdUserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*RdUserClient) DeleteOneID

func (c *RdUserClient) DeleteOneID(id int32) *RdUserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*RdUserClient) Get

func (c *RdUserClient) Get(ctx context.Context, id int32) (*RdUser, error)

Get returns a RdUser entity by its id.

func (*RdUserClient) GetX

func (c *RdUserClient) GetX(ctx context.Context, id int32) *RdUser

GetX is like Get, but panics if an error occurs.

func (*RdUserClient) Hooks

func (c *RdUserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*RdUserClient) Intercept

func (c *RdUserClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `rduser.Intercept(f(g(h())))`.

func (*RdUserClient) Interceptors

func (c *RdUserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*RdUserClient) Query

func (c *RdUserClient) Query() *RdUserQuery

Query returns a query builder for RdUser.

func (*RdUserClient) Update

func (c *RdUserClient) Update() *RdUserUpdate

Update returns an update builder for RdUser.

func (*RdUserClient) UpdateOne

func (c *RdUserClient) UpdateOne(ru *RdUser) *RdUserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*RdUserClient) UpdateOneID

func (c *RdUserClient) UpdateOneID(id int32) *RdUserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*RdUserClient) Use

func (c *RdUserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `rduser.Hooks(f(g(h())))`.

type RdUserCreate

type RdUserCreate struct {
	// contains filtered or unexported fields
}

RdUserCreate is the builder for creating a RdUser entity.

func (*RdUserCreate) Exec

func (ruc *RdUserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*RdUserCreate) ExecX

func (ruc *RdUserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RdUserCreate) Mutation

func (ruc *RdUserCreate) Mutation() *RdUserMutation

Mutation returns the RdUserMutation object of the builder.

func (*RdUserCreate) Save

func (ruc *RdUserCreate) Save(ctx context.Context) (*RdUser, error)

Save creates the RdUser in the database.

func (*RdUserCreate) SaveX

func (ruc *RdUserCreate) SaveX(ctx context.Context) *RdUser

SaveX calls Save and panics if Save returns an error.

func (*RdUserCreate) SetCreateTime

func (ruc *RdUserCreate) SetCreateTime(t time.Time) *RdUserCreate

SetCreateTime sets the "create_time" field.

func (*RdUserCreate) SetID

func (ruc *RdUserCreate) SetID(i int32) *RdUserCreate

SetID sets the "id" field.

func (*RdUserCreate) SetNick

func (ruc *RdUserCreate) SetNick(s string) *RdUserCreate

SetNick sets the "nick" field.

func (*RdUserCreate) SetNillableCreateTime

func (ruc *RdUserCreate) SetNillableCreateTime(t *time.Time) *RdUserCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*RdUserCreate) SetNillableStatus

func (ruc *RdUserCreate) SetNillableStatus(i *int32) *RdUserCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*RdUserCreate) SetStatus

func (ruc *RdUserCreate) SetStatus(i int32) *RdUserCreate

SetStatus sets the "status" field.

type RdUserCreateBulk

type RdUserCreateBulk struct {
	// contains filtered or unexported fields
}

RdUserCreateBulk is the builder for creating many RdUser entities in bulk.

func (*RdUserCreateBulk) Exec

func (rucb *RdUserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*RdUserCreateBulk) ExecX

func (rucb *RdUserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RdUserCreateBulk) Save

func (rucb *RdUserCreateBulk) Save(ctx context.Context) ([]*RdUser, error)

Save creates the RdUser entities in the database.

func (*RdUserCreateBulk) SaveX

func (rucb *RdUserCreateBulk) SaveX(ctx context.Context) []*RdUser

SaveX is like Save, but panics if an error occurs.

type RdUserDelete

type RdUserDelete struct {
	// contains filtered or unexported fields
}

RdUserDelete is the builder for deleting a RdUser entity.

func (*RdUserDelete) Exec

func (rud *RdUserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*RdUserDelete) ExecX

func (rud *RdUserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*RdUserDelete) Where

func (rud *RdUserDelete) Where(ps ...predicate.RdUser) *RdUserDelete

Where appends a list predicates to the RdUserDelete builder.

type RdUserDeleteOne

type RdUserDeleteOne struct {
	// contains filtered or unexported fields
}

RdUserDeleteOne is the builder for deleting a single RdUser entity.

func (*RdUserDeleteOne) Exec

func (rudo *RdUserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*RdUserDeleteOne) ExecX

func (rudo *RdUserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type RdUserGroupBy

type RdUserGroupBy struct {
	// contains filtered or unexported fields
}

RdUserGroupBy is the group-by builder for RdUser entities.

func (*RdUserGroupBy) Aggregate

func (rugb *RdUserGroupBy) Aggregate(fns ...AggregateFunc) *RdUserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*RdUserGroupBy) Bool

func (s *RdUserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RdUserGroupBy) BoolX

func (s *RdUserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RdUserGroupBy) Bools

func (s *RdUserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RdUserGroupBy) BoolsX

func (s *RdUserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RdUserGroupBy) Float64

func (s *RdUserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RdUserGroupBy) Float64X

func (s *RdUserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RdUserGroupBy) Float64s

func (s *RdUserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RdUserGroupBy) Float64sX

func (s *RdUserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RdUserGroupBy) Int

func (s *RdUserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RdUserGroupBy) IntX

func (s *RdUserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RdUserGroupBy) Ints

func (s *RdUserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RdUserGroupBy) IntsX

func (s *RdUserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RdUserGroupBy) Scan

func (rugb *RdUserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RdUserGroupBy) ScanX

func (s *RdUserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RdUserGroupBy) String

func (s *RdUserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RdUserGroupBy) StringX

func (s *RdUserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RdUserGroupBy) Strings

func (s *RdUserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RdUserGroupBy) StringsX

func (s *RdUserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RdUserMutation

type RdUserMutation struct {
	// contains filtered or unexported fields
}

RdUserMutation represents an operation that mutates the RdUser nodes in the graph.

func (*RdUserMutation) AddField

func (m *RdUserMutation) 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 (*RdUserMutation) AddStatus

func (m *RdUserMutation) AddStatus(i int32)

AddStatus adds i to the "status" field.

func (*RdUserMutation) AddedEdges

func (m *RdUserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*RdUserMutation) AddedField

func (m *RdUserMutation) 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 (*RdUserMutation) AddedFields

func (m *RdUserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*RdUserMutation) AddedIDs

func (m *RdUserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*RdUserMutation) AddedStatus

func (m *RdUserMutation) AddedStatus() (r int32, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*RdUserMutation) ClearEdge

func (m *RdUserMutation) 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 (*RdUserMutation) ClearField

func (m *RdUserMutation) 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 (*RdUserMutation) ClearedEdges

func (m *RdUserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*RdUserMutation) ClearedFields

func (m *RdUserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (RdUserMutation) Client

func (m RdUserMutation) 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 (*RdUserMutation) CreateTime

func (m *RdUserMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*RdUserMutation) EdgeCleared

func (m *RdUserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*RdUserMutation) Field

func (m *RdUserMutation) 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 (*RdUserMutation) FieldCleared

func (m *RdUserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*RdUserMutation) Fields

func (m *RdUserMutation) 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 (*RdUserMutation) ID

func (m *RdUserMutation) ID() (id int32, 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 (*RdUserMutation) IDs

func (m *RdUserMutation) IDs(ctx context.Context) ([]int32, 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 (*RdUserMutation) Nick

func (m *RdUserMutation) Nick() (r string, exists bool)

Nick returns the value of the "nick" field in the mutation.

func (*RdUserMutation) OldCreateTime

func (m *RdUserMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the RdUser entity. If the RdUser 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 (*RdUserMutation) OldField

func (m *RdUserMutation) 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 (*RdUserMutation) OldNick

func (m *RdUserMutation) OldNick(ctx context.Context) (v string, err error)

OldNick returns the old "nick" field's value of the RdUser entity. If the RdUser 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 (*RdUserMutation) OldStatus

func (m *RdUserMutation) OldStatus(ctx context.Context) (v int32, err error)

OldStatus returns the old "status" field's value of the RdUser entity. If the RdUser 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 (*RdUserMutation) Op

func (m *RdUserMutation) Op() Op

Op returns the operation name.

func (*RdUserMutation) RemovedEdges

func (m *RdUserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*RdUserMutation) RemovedIDs

func (m *RdUserMutation) 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 (*RdUserMutation) ResetCreateTime

func (m *RdUserMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*RdUserMutation) ResetEdge

func (m *RdUserMutation) 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 (*RdUserMutation) ResetField

func (m *RdUserMutation) 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 (*RdUserMutation) ResetNick

func (m *RdUserMutation) ResetNick()

ResetNick resets all changes to the "nick" field.

func (*RdUserMutation) ResetStatus

func (m *RdUserMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*RdUserMutation) SetCreateTime

func (m *RdUserMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*RdUserMutation) SetField

func (m *RdUserMutation) 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 (*RdUserMutation) SetID

func (m *RdUserMutation) SetID(id int32)

SetID sets the value of the id field. Note that this operation is only accepted on creation of RdUser entities.

func (*RdUserMutation) SetNick

func (m *RdUserMutation) SetNick(s string)

SetNick sets the "nick" field.

func (*RdUserMutation) SetOp

func (m *RdUserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*RdUserMutation) SetStatus

func (m *RdUserMutation) SetStatus(i int32)

SetStatus sets the "status" field.

func (*RdUserMutation) Status

func (m *RdUserMutation) Status() (r int32, exists bool)

Status returns the value of the "status" field in the mutation.

func (RdUserMutation) Tx

func (m RdUserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*RdUserMutation) Type

func (m *RdUserMutation) Type() string

Type returns the node type of this mutation (RdUser).

func (*RdUserMutation) Where

func (m *RdUserMutation) Where(ps ...predicate.RdUser)

Where appends a list predicates to the RdUserMutation builder.

func (*RdUserMutation) WhereP

func (m *RdUserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the RdUserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type RdUserQuery

type RdUserQuery struct {
	// contains filtered or unexported fields
}

RdUserQuery is the builder for querying RdUser entities.

func (*RdUserQuery) Aggregate

func (ruq *RdUserQuery) Aggregate(fns ...AggregateFunc) *RdUserSelect

Aggregate returns a RdUserSelect configured with the given aggregations.

func (*RdUserQuery) All

func (ruq *RdUserQuery) All(ctx context.Context) ([]*RdUser, error)

All executes the query and returns a list of RdUsers.

func (*RdUserQuery) AllX

func (ruq *RdUserQuery) AllX(ctx context.Context) []*RdUser

AllX is like All, but panics if an error occurs.

func (*RdUserQuery) Clone

func (ruq *RdUserQuery) Clone() *RdUserQuery

Clone returns a duplicate of the RdUserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*RdUserQuery) Count

func (ruq *RdUserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*RdUserQuery) CountX

func (ruq *RdUserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*RdUserQuery) Exist

func (ruq *RdUserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*RdUserQuery) ExistX

func (ruq *RdUserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*RdUserQuery) First

func (ruq *RdUserQuery) First(ctx context.Context) (*RdUser, error)

First returns the first RdUser entity from the query. Returns a *NotFoundError when no RdUser was found.

func (*RdUserQuery) FirstID

func (ruq *RdUserQuery) FirstID(ctx context.Context) (id int32, err error)

FirstID returns the first RdUser ID from the query. Returns a *NotFoundError when no RdUser ID was found.

func (*RdUserQuery) FirstIDX

func (ruq *RdUserQuery) FirstIDX(ctx context.Context) int32

FirstIDX is like FirstID, but panics if an error occurs.

func (*RdUserQuery) FirstX

func (ruq *RdUserQuery) FirstX(ctx context.Context) *RdUser

FirstX is like First, but panics if an error occurs.

func (*RdUserQuery) GroupBy

func (ruq *RdUserQuery) GroupBy(field string, fields ...string) *RdUserGroupBy

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 {
	Nick string `json:"nick,omitempty"`
	Count int `json:"count,omitempty"`
}

client.RdUser.Query().
	GroupBy(rduser.FieldNick).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*RdUserQuery) IDs

func (ruq *RdUserQuery) IDs(ctx context.Context) ([]int32, error)

IDs executes the query and returns a list of RdUser IDs.

func (*RdUserQuery) IDsX

func (ruq *RdUserQuery) IDsX(ctx context.Context) []int32

IDsX is like IDs, but panics if an error occurs.

func (*RdUserQuery) Limit

func (ruq *RdUserQuery) Limit(limit int) *RdUserQuery

Limit the number of records to be returned by this query.

func (*RdUserQuery) Offset

func (ruq *RdUserQuery) Offset(offset int) *RdUserQuery

Offset to start from.

func (*RdUserQuery) Only

func (ruq *RdUserQuery) Only(ctx context.Context) (*RdUser, error)

Only returns a single RdUser entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one RdUser entity is found. Returns a *NotFoundError when no RdUser entities are found.

func (*RdUserQuery) OnlyID

func (ruq *RdUserQuery) OnlyID(ctx context.Context) (id int32, err error)

OnlyID is like Only, but returns the only RdUser ID in the query. Returns a *NotSingularError when more than one RdUser ID is found. Returns a *NotFoundError when no entities are found.

func (*RdUserQuery) OnlyIDX

func (ruq *RdUserQuery) OnlyIDX(ctx context.Context) int32

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*RdUserQuery) OnlyX

func (ruq *RdUserQuery) OnlyX(ctx context.Context) *RdUser

OnlyX is like Only, but panics if an error occurs.

func (*RdUserQuery) Order

func (ruq *RdUserQuery) Order(o ...OrderFunc) *RdUserQuery

Order specifies how the records should be ordered.

func (*RdUserQuery) Select

func (ruq *RdUserQuery) Select(fields ...string) *RdUserSelect

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 {
	Nick string `json:"nick,omitempty"`
}

client.RdUser.Query().
	Select(rduser.FieldNick).
	Scan(ctx, &v)

func (*RdUserQuery) Unique

func (ruq *RdUserQuery) Unique(unique bool) *RdUserQuery

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 (*RdUserQuery) Where

func (ruq *RdUserQuery) Where(ps ...predicate.RdUser) *RdUserQuery

Where adds a new predicate for the RdUserQuery builder.

type RdUserSelect

type RdUserSelect struct {
	*RdUserQuery
	// contains filtered or unexported fields
}

RdUserSelect is the builder for selecting fields of RdUser entities.

func (*RdUserSelect) Aggregate

func (rus *RdUserSelect) Aggregate(fns ...AggregateFunc) *RdUserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*RdUserSelect) Bool

func (s *RdUserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*RdUserSelect) BoolX

func (s *RdUserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*RdUserSelect) Bools

func (s *RdUserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*RdUserSelect) BoolsX

func (s *RdUserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*RdUserSelect) Float64

func (s *RdUserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*RdUserSelect) Float64X

func (s *RdUserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*RdUserSelect) Float64s

func (s *RdUserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*RdUserSelect) Float64sX

func (s *RdUserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*RdUserSelect) Int

func (s *RdUserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*RdUserSelect) IntX

func (s *RdUserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*RdUserSelect) Ints

func (s *RdUserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*RdUserSelect) IntsX

func (s *RdUserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*RdUserSelect) Scan

func (rus *RdUserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*RdUserSelect) ScanX

func (s *RdUserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*RdUserSelect) String

func (s *RdUserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*RdUserSelect) StringX

func (s *RdUserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*RdUserSelect) Strings

func (s *RdUserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*RdUserSelect) StringsX

func (s *RdUserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type RdUserUpdate

type RdUserUpdate struct {
	// contains filtered or unexported fields
}

RdUserUpdate is the builder for updating RdUser entities.

func (*RdUserUpdate) AddStatus

func (ruu *RdUserUpdate) AddStatus(i int32) *RdUserUpdate

AddStatus adds i to the "status" field.

func (*RdUserUpdate) Exec

func (ruu *RdUserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*RdUserUpdate) ExecX

func (ruu *RdUserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RdUserUpdate) Mutation

func (ruu *RdUserUpdate) Mutation() *RdUserMutation

Mutation returns the RdUserMutation object of the builder.

func (*RdUserUpdate) Save

func (ruu *RdUserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*RdUserUpdate) SaveX

func (ruu *RdUserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*RdUserUpdate) SetCreateTime

func (ruu *RdUserUpdate) SetCreateTime(t time.Time) *RdUserUpdate

SetCreateTime sets the "create_time" field.

func (*RdUserUpdate) SetNick

func (ruu *RdUserUpdate) SetNick(s string) *RdUserUpdate

SetNick sets the "nick" field.

func (*RdUserUpdate) SetNillableCreateTime

func (ruu *RdUserUpdate) SetNillableCreateTime(t *time.Time) *RdUserUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*RdUserUpdate) SetNillableStatus

func (ruu *RdUserUpdate) SetNillableStatus(i *int32) *RdUserUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*RdUserUpdate) SetStatus

func (ruu *RdUserUpdate) SetStatus(i int32) *RdUserUpdate

SetStatus sets the "status" field.

func (*RdUserUpdate) Where

func (ruu *RdUserUpdate) Where(ps ...predicate.RdUser) *RdUserUpdate

Where appends a list predicates to the RdUserUpdate builder.

type RdUserUpdateOne

type RdUserUpdateOne struct {
	// contains filtered or unexported fields
}

RdUserUpdateOne is the builder for updating a single RdUser entity.

func (*RdUserUpdateOne) AddStatus

func (ruuo *RdUserUpdateOne) AddStatus(i int32) *RdUserUpdateOne

AddStatus adds i to the "status" field.

func (*RdUserUpdateOne) Exec

func (ruuo *RdUserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*RdUserUpdateOne) ExecX

func (ruuo *RdUserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*RdUserUpdateOne) Mutation

func (ruuo *RdUserUpdateOne) Mutation() *RdUserMutation

Mutation returns the RdUserMutation object of the builder.

func (*RdUserUpdateOne) Save

func (ruuo *RdUserUpdateOne) Save(ctx context.Context) (*RdUser, error)

Save executes the query and returns the updated RdUser entity.

func (*RdUserUpdateOne) SaveX

func (ruuo *RdUserUpdateOne) SaveX(ctx context.Context) *RdUser

SaveX is like Save, but panics if an error occurs.

func (*RdUserUpdateOne) Select

func (ruuo *RdUserUpdateOne) Select(field string, fields ...string) *RdUserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*RdUserUpdateOne) SetCreateTime

func (ruuo *RdUserUpdateOne) SetCreateTime(t time.Time) *RdUserUpdateOne

SetCreateTime sets the "create_time" field.

func (*RdUserUpdateOne) SetNick

func (ruuo *RdUserUpdateOne) SetNick(s string) *RdUserUpdateOne

SetNick sets the "nick" field.

func (*RdUserUpdateOne) SetNillableCreateTime

func (ruuo *RdUserUpdateOne) SetNillableCreateTime(t *time.Time) *RdUserUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*RdUserUpdateOne) SetNillableStatus

func (ruuo *RdUserUpdateOne) SetNillableStatus(i *int32) *RdUserUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*RdUserUpdateOne) SetStatus

func (ruuo *RdUserUpdateOne) SetStatus(i int32) *RdUserUpdateOne

SetStatus sets the "status" field.

type RdUsers

type RdUsers []*RdUser

RdUsers is a parsable slice of RdUser.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// RdMessage is the client for interacting with the RdMessage builders.
	RdMessage *RdMessageClient
	// RdMoment is the client for interacting with the RdMoment builders.
	RdMoment *RdMomentClient
	// RdRMomentsFollowing is the client for interacting with the RdRMomentsFollowing builders.
	RdRMomentsFollowing *RdRMomentsFollowingClient
	// RdRUserFollowers is the client for interacting with the RdRUserFollowers builders.
	RdRUserFollowers *RdRUserFollowersClient
	// RdRUserFollowing is the client for interacting with the RdRUserFollowing builders.
	RdRUserFollowing *RdRUserFollowingClient
	// RdUser is the client for interacting with the RdUser builders.
	RdUser *RdUserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL