entity

package
v0.0.0-...-a037928 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeChat              = "Chat"
	TypeChatOption        = "ChatOption"
	TypeGameAccount       = "GameAccount"
	TypeGameRole          = "GameRole"
	TypeGameRoleAttribute = "GameRoleAttribute"
	TypeUser              = "User"
)

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(entity.As(entity.Sum(field1), "sum_field1"), (entity.As(entity.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 Chat

type Chat struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// ChatID holds the value of the "chat_id" field.
	ChatID int64 `json:"chat_id,omitempty"`
	// Type holds the value of the "type" field.
	Type string `json:"type,omitempty"`
	// IsForum holds the value of the "is_forum" field.
	IsForum bool `json:"is_forum,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// UserName holds the value of the "user_name" field.
	UserName string `json:"user_name,omitempty"`
	// FirstName holds the value of the "first_name" field.
	FirstName string `json:"first_name,omitempty"`
	// LastName holds the value of the "last_name" field.
	LastName string `json:"last_name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// CreateAt holds the value of the "create_at" field.
	CreateAt time.Time `json:"create_at,omitempty"`
	// UpdateAt holds the value of the "update_at" field.
	UpdateAt time.Time `json:"update_at,omitempty"`
	// contains filtered or unexported fields
}

Chat is the model entity for the Chat schema.

func (*Chat) ExecContext

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

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

func (*Chat) QueryContext

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

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

func (*Chat) String

func (c *Chat) String() string

String implements the fmt.Stringer.

func (*Chat) Unwrap

func (c *Chat) Unwrap() *Chat

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

func (c *Chat) Update() *ChatUpdateOne

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

type ChatClient

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

ChatClient is a client for the Chat schema.

func NewChatClient

func NewChatClient(c config) *ChatClient

NewChatClient returns a client for the Chat from the given config.

func (*ChatClient) Create

func (c *ChatClient) Create() *ChatCreate

Create returns a builder for creating a Chat entity.

func (*ChatClient) CreateBulk

func (c *ChatClient) CreateBulk(builders ...*ChatCreate) *ChatCreateBulk

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

func (*ChatClient) Delete

func (c *ChatClient) Delete() *ChatDelete

Delete returns a delete builder for Chat.

func (*ChatClient) DeleteOne

func (c *ChatClient) DeleteOne(ch *Chat) *ChatDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChatClient) DeleteOneID

func (c *ChatClient) DeleteOneID(id int64) *ChatDeleteOne

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

func (*ChatClient) ExecContext

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

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

func (*ChatClient) Get

func (c *ChatClient) Get(ctx context.Context, id int64) (*Chat, error)

Get returns a Chat entity by its id.

func (*ChatClient) GetX

func (c *ChatClient) GetX(ctx context.Context, id int64) *Chat

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

func (*ChatClient) Hooks

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

Hooks returns the client hooks.

func (*ChatClient) Intercept

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

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

func (*ChatClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ChatClient) Query

func (c *ChatClient) Query() *ChatQuery

Query returns a query builder for Chat.

func (*ChatClient) QueryContext

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

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

func (*ChatClient) Update

func (c *ChatClient) Update() *ChatUpdate

Update returns an update builder for Chat.

func (*ChatClient) UpdateOne

func (c *ChatClient) UpdateOne(ch *Chat) *ChatUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChatClient) UpdateOneID

func (c *ChatClient) UpdateOneID(id int64) *ChatUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChatClient) Use

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

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

type ChatCreate

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

ChatCreate is the builder for creating a Chat entity.

func (*ChatCreate) Exec

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

Exec executes the query.

func (*ChatCreate) ExecContext

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

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

func (*ChatCreate) ExecX

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

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

func (*ChatCreate) Mutation

func (cc *ChatCreate) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatCreate) OnConflict

func (cc *ChatCreate) OnConflict(opts ...sql.ConflictOption) *ChatUpsertOne

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

client.Chat.Create().
	SetChatID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ChatUpsert) {
		SetChatID(v+v).
	}).
	Exec(ctx)

func (*ChatCreate) OnConflictColumns

func (cc *ChatCreate) OnConflictColumns(columns ...string) *ChatUpsertOne

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

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

func (*ChatCreate) QueryContext

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

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

func (*ChatCreate) Save

func (cc *ChatCreate) Save(ctx context.Context) (*Chat, error)

Save creates the Chat in the database.

func (*ChatCreate) SaveX

func (cc *ChatCreate) SaveX(ctx context.Context) *Chat

SaveX calls Save and panics if Save returns an error.

func (*ChatCreate) SetChatID

func (cc *ChatCreate) SetChatID(i int64) *ChatCreate

SetChatID sets the "chat_id" field.

func (*ChatCreate) SetCreateAt

func (cc *ChatCreate) SetCreateAt(t time.Time) *ChatCreate

SetCreateAt sets the "create_at" field.

func (*ChatCreate) SetDescription

func (cc *ChatCreate) SetDescription(s string) *ChatCreate

SetDescription sets the "description" field.

func (*ChatCreate) SetFirstName

func (cc *ChatCreate) SetFirstName(s string) *ChatCreate

SetFirstName sets the "first_name" field.

func (*ChatCreate) SetID

func (cc *ChatCreate) SetID(i int64) *ChatCreate

SetID sets the "id" field.

func (*ChatCreate) SetIsForum

func (cc *ChatCreate) SetIsForum(b bool) *ChatCreate

SetIsForum sets the "is_forum" field.

func (*ChatCreate) SetLastName

func (cc *ChatCreate) SetLastName(s string) *ChatCreate

SetLastName sets the "last_name" field.

func (*ChatCreate) SetNillableCreateAt

func (cc *ChatCreate) SetNillableCreateAt(t *time.Time) *ChatCreate

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

func (*ChatCreate) SetNillableDescription

func (cc *ChatCreate) SetNillableDescription(s *string) *ChatCreate

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

func (*ChatCreate) SetNillableFirstName

func (cc *ChatCreate) SetNillableFirstName(s *string) *ChatCreate

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*ChatCreate) SetNillableIsForum

func (cc *ChatCreate) SetNillableIsForum(b *bool) *ChatCreate

SetNillableIsForum sets the "is_forum" field if the given value is not nil.

func (*ChatCreate) SetNillableLastName

func (cc *ChatCreate) SetNillableLastName(s *string) *ChatCreate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*ChatCreate) SetNillableTitle

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

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

func (*ChatCreate) SetNillableType

func (cc *ChatCreate) SetNillableType(s *string) *ChatCreate

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

func (*ChatCreate) SetNillableUpdateAt

func (cc *ChatCreate) SetNillableUpdateAt(t *time.Time) *ChatCreate

SetNillableUpdateAt sets the "update_at" field if the given value is not nil.

func (*ChatCreate) SetNillableUserName

func (cc *ChatCreate) SetNillableUserName(s *string) *ChatCreate

SetNillableUserName sets the "user_name" field if the given value is not nil.

func (*ChatCreate) SetTitle

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

SetTitle sets the "title" field.

func (*ChatCreate) SetType

func (cc *ChatCreate) SetType(s string) *ChatCreate

SetType sets the "type" field.

func (*ChatCreate) SetUpdateAt

func (cc *ChatCreate) SetUpdateAt(t time.Time) *ChatCreate

SetUpdateAt sets the "update_at" field.

func (*ChatCreate) SetUserName

func (cc *ChatCreate) SetUserName(s string) *ChatCreate

SetUserName sets the "user_name" field.

type ChatCreateBulk

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

ChatCreateBulk is the builder for creating many Chat entities in bulk.

func (*ChatCreateBulk) Exec

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

Exec executes the query.

func (*ChatCreateBulk) ExecContext

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

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

func (*ChatCreateBulk) ExecX

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

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

func (*ChatCreateBulk) OnConflict

func (ccb *ChatCreateBulk) OnConflict(opts ...sql.ConflictOption) *ChatUpsertBulk

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

client.Chat.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ChatUpsert) {
		SetChatID(v+v).
	}).
	Exec(ctx)

func (*ChatCreateBulk) OnConflictColumns

func (ccb *ChatCreateBulk) OnConflictColumns(columns ...string) *ChatUpsertBulk

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

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

func (*ChatCreateBulk) QueryContext

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

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

func (*ChatCreateBulk) Save

func (ccb *ChatCreateBulk) Save(ctx context.Context) ([]*Chat, error)

Save creates the Chat entities in the database.

func (*ChatCreateBulk) SaveX

func (ccb *ChatCreateBulk) SaveX(ctx context.Context) []*Chat

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

type ChatDelete

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

ChatDelete is the builder for deleting a Chat entity.

func (*ChatDelete) Exec

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

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

func (*ChatDelete) ExecContext

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

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

func (*ChatDelete) ExecX

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

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

func (*ChatDelete) QueryContext

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

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

func (*ChatDelete) Where

func (cd *ChatDelete) Where(ps ...predicate.Chat) *ChatDelete

Where appends a list predicates to the ChatDelete builder.

type ChatDeleteOne

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

ChatDeleteOne is the builder for deleting a single Chat entity.

func (*ChatDeleteOne) Exec

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

Exec executes the deletion query.

func (*ChatDeleteOne) ExecX

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

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

func (*ChatDeleteOne) Where

func (cdo *ChatDeleteOne) Where(ps ...predicate.Chat) *ChatDeleteOne

Where appends a list predicates to the ChatDelete builder.

type ChatGroupBy

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

ChatGroupBy is the group-by builder for Chat entities.

func (*ChatGroupBy) Aggregate

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

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

func (*ChatGroupBy) Bool

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

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

func (*ChatGroupBy) BoolX

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

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

func (*ChatGroupBy) Bools

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

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

func (*ChatGroupBy) BoolsX

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

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

func (*ChatGroupBy) Float64

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

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

func (*ChatGroupBy) Float64X

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

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

func (*ChatGroupBy) Float64s

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

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

func (*ChatGroupBy) Float64sX

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

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

func (*ChatGroupBy) Int

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

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

func (*ChatGroupBy) IntX

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

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

func (*ChatGroupBy) Ints

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

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

func (*ChatGroupBy) IntsX

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

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

func (*ChatGroupBy) Scan

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

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

func (*ChatGroupBy) ScanX

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

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

func (*ChatGroupBy) String

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

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

func (*ChatGroupBy) StringX

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

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

func (*ChatGroupBy) Strings

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

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

func (*ChatGroupBy) StringsX

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

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

type ChatMutation

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

ChatMutation represents an operation that mutates the Chat nodes in the graph.

func (*ChatMutation) AddChatID

func (m *ChatMutation) AddChatID(i int64)

AddChatID adds i to the "chat_id" field.

func (*ChatMutation) AddField

func (m *ChatMutation) 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 (*ChatMutation) AddedChatID

func (m *ChatMutation) AddedChatID() (r int64, exists bool)

AddedChatID returns the value that was added to the "chat_id" field in this mutation.

func (*ChatMutation) AddedEdges

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

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

func (*ChatMutation) AddedField

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

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

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

func (*ChatMutation) AddedIDs

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

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

func (*ChatMutation) ChatID

func (m *ChatMutation) ChatID() (r int64, exists bool)

ChatID returns the value of the "chat_id" field in the mutation.

func (*ChatMutation) ClearEdge

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

func (m *ChatMutation) 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 (*ChatMutation) ClearedEdges

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

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

func (*ChatMutation) ClearedFields

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

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

func (ChatMutation) Client

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

func (m *ChatMutation) CreateAt() (r time.Time, exists bool)

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

func (*ChatMutation) Description

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

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

func (*ChatMutation) EdgeCleared

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

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

func (*ChatMutation) ExecContext

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

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

func (*ChatMutation) Field

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

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

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

func (*ChatMutation) Fields

func (m *ChatMutation) 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 (*ChatMutation) FirstName

func (m *ChatMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "first_name" field in the mutation.

func (*ChatMutation) GetType

func (m *ChatMutation) GetType() (r string, exists bool)

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

func (*ChatMutation) ID

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

func (m *ChatMutation) 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 (*ChatMutation) IsForum

func (m *ChatMutation) IsForum() (r bool, exists bool)

IsForum returns the value of the "is_forum" field in the mutation.

func (*ChatMutation) LastName

func (m *ChatMutation) LastName() (r string, exists bool)

LastName returns the value of the "last_name" field in the mutation.

func (*ChatMutation) OldChatID

func (m *ChatMutation) OldChatID(ctx context.Context) (v int64, err error)

OldChatID returns the old "chat_id" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldCreateAt

func (m *ChatMutation) OldCreateAt(ctx context.Context) (v time.Time, err error)

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

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

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

func (m *ChatMutation) 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 (*ChatMutation) OldFirstName

func (m *ChatMutation) OldFirstName(ctx context.Context) (v string, err error)

OldFirstName returns the old "first_name" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldIsForum

func (m *ChatMutation) OldIsForum(ctx context.Context) (v bool, err error)

OldIsForum returns the old "is_forum" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldLastName

func (m *ChatMutation) OldLastName(ctx context.Context) (v string, err error)

OldLastName returns the old "last_name" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldTitle

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

OldTitle returns the old "title" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldType

func (m *ChatMutation) OldType(ctx context.Context) (v string, err error)

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

func (m *ChatMutation) OldUpdateAt(ctx context.Context) (v time.Time, err error)

OldUpdateAt returns the old "update_at" field's value of the Chat entity. If the Chat 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 (*ChatMutation) OldUserName

func (m *ChatMutation) OldUserName(ctx context.Context) (v string, err error)

OldUserName returns the old "user_name" field's value of the Chat entity. If the Chat 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 (*ChatMutation) Op

func (m *ChatMutation) Op() Op

Op returns the operation name.

func (*ChatMutation) QueryContext

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

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

func (*ChatMutation) RemovedEdges

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

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

func (*ChatMutation) RemovedIDs

func (m *ChatMutation) 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 (*ChatMutation) ResetChatID

func (m *ChatMutation) ResetChatID()

ResetChatID resets all changes to the "chat_id" field.

func (*ChatMutation) ResetCreateAt

func (m *ChatMutation) ResetCreateAt()

ResetCreateAt resets all changes to the "create_at" field.

func (*ChatMutation) ResetDescription

func (m *ChatMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ChatMutation) ResetEdge

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

func (m *ChatMutation) 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 (*ChatMutation) ResetFirstName

func (m *ChatMutation) ResetFirstName()

ResetFirstName resets all changes to the "first_name" field.

func (*ChatMutation) ResetIsForum

func (m *ChatMutation) ResetIsForum()

ResetIsForum resets all changes to the "is_forum" field.

func (*ChatMutation) ResetLastName

func (m *ChatMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*ChatMutation) ResetTitle

func (m *ChatMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*ChatMutation) ResetType

func (m *ChatMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ChatMutation) ResetUpdateAt

func (m *ChatMutation) ResetUpdateAt()

ResetUpdateAt resets all changes to the "update_at" field.

func (*ChatMutation) ResetUserName

func (m *ChatMutation) ResetUserName()

ResetUserName resets all changes to the "user_name" field.

func (*ChatMutation) SetChatID

func (m *ChatMutation) SetChatID(i int64)

SetChatID sets the "chat_id" field.

func (*ChatMutation) SetCreateAt

func (m *ChatMutation) SetCreateAt(t time.Time)

SetCreateAt sets the "create_at" field.

func (*ChatMutation) SetDescription

func (m *ChatMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ChatMutation) SetField

func (m *ChatMutation) 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 (*ChatMutation) SetFirstName

func (m *ChatMutation) SetFirstName(s string)

SetFirstName sets the "first_name" field.

func (*ChatMutation) SetID

func (m *ChatMutation) SetID(id int64)

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

func (*ChatMutation) SetIsForum

func (m *ChatMutation) SetIsForum(b bool)

SetIsForum sets the "is_forum" field.

func (*ChatMutation) SetLastName

func (m *ChatMutation) SetLastName(s string)

SetLastName sets the "last_name" field.

func (*ChatMutation) SetOp

func (m *ChatMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ChatMutation) SetTitle

func (m *ChatMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*ChatMutation) SetType

func (m *ChatMutation) SetType(s string)

SetType sets the "type" field.

func (*ChatMutation) SetUpdateAt

func (m *ChatMutation) SetUpdateAt(t time.Time)

SetUpdateAt sets the "update_at" field.

func (*ChatMutation) SetUserName

func (m *ChatMutation) SetUserName(s string)

SetUserName sets the "user_name" field.

func (*ChatMutation) Title

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

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

func (ChatMutation) Tx

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

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

func (*ChatMutation) Type

func (m *ChatMutation) Type() string

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

func (*ChatMutation) UpdateAt

func (m *ChatMutation) UpdateAt() (r time.Time, exists bool)

UpdateAt returns the value of the "update_at" field in the mutation.

func (*ChatMutation) UserName

func (m *ChatMutation) UserName() (r string, exists bool)

UserName returns the value of the "user_name" field in the mutation.

func (*ChatMutation) Where

func (m *ChatMutation) Where(ps ...predicate.Chat)

Where appends a list predicates to the ChatMutation builder.

func (*ChatMutation) WhereP

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

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

type ChatOption

type ChatOption struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// ChatID holds the value of the "chat_id" field.
	ChatID int64 `json:"chat_id,omitempty"`
	// Key holds the value of the "key" field.
	Key string `json:"key,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// CreateAt holds the value of the "create_at" field.
	CreateAt time.Time `json:"create_at,omitempty"`
	// UpdateAt holds the value of the "update_at" field.
	UpdateAt time.Time `json:"update_at,omitempty"`
	// contains filtered or unexported fields
}

ChatOption is the model entity for the ChatOption schema.

func (*ChatOption) ExecContext

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

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

func (*ChatOption) QueryContext

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

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

func (*ChatOption) String

func (co *ChatOption) String() string

String implements the fmt.Stringer.

func (*ChatOption) Unwrap

func (co *ChatOption) Unwrap() *ChatOption

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

func (co *ChatOption) Update() *ChatOptionUpdateOne

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

type ChatOptionClient

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

ChatOptionClient is a client for the ChatOption schema.

func NewChatOptionClient

func NewChatOptionClient(c config) *ChatOptionClient

NewChatOptionClient returns a client for the ChatOption from the given config.

func (*ChatOptionClient) Create

func (c *ChatOptionClient) Create() *ChatOptionCreate

Create returns a builder for creating a ChatOption entity.

func (*ChatOptionClient) CreateBulk

func (c *ChatOptionClient) CreateBulk(builders ...*ChatOptionCreate) *ChatOptionCreateBulk

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

func (*ChatOptionClient) Delete

func (c *ChatOptionClient) Delete() *ChatOptionDelete

Delete returns a delete builder for ChatOption.

func (*ChatOptionClient) DeleteOne

func (c *ChatOptionClient) DeleteOne(co *ChatOption) *ChatOptionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChatOptionClient) DeleteOneID

func (c *ChatOptionClient) DeleteOneID(id int64) *ChatOptionDeleteOne

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

func (*ChatOptionClient) ExecContext

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

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

func (*ChatOptionClient) Get

func (c *ChatOptionClient) Get(ctx context.Context, id int64) (*ChatOption, error)

Get returns a ChatOption entity by its id.

func (*ChatOptionClient) GetX

func (c *ChatOptionClient) GetX(ctx context.Context, id int64) *ChatOption

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

func (*ChatOptionClient) Hooks

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

Hooks returns the client hooks.

func (*ChatOptionClient) Intercept

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

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

func (*ChatOptionClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ChatOptionClient) Query

func (c *ChatOptionClient) Query() *ChatOptionQuery

Query returns a query builder for ChatOption.

func (*ChatOptionClient) QueryContext

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

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

func (*ChatOptionClient) Update

func (c *ChatOptionClient) Update() *ChatOptionUpdate

Update returns an update builder for ChatOption.

func (*ChatOptionClient) UpdateOne

func (c *ChatOptionClient) UpdateOne(co *ChatOption) *ChatOptionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChatOptionClient) UpdateOneID

func (c *ChatOptionClient) UpdateOneID(id int64) *ChatOptionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChatOptionClient) Use

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

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

type ChatOptionCreate

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

ChatOptionCreate is the builder for creating a ChatOption entity.

func (*ChatOptionCreate) Exec

func (coc *ChatOptionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatOptionCreate) ExecContext

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

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

func (*ChatOptionCreate) ExecX

func (coc *ChatOptionCreate) ExecX(ctx context.Context)

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

func (*ChatOptionCreate) Mutation

func (coc *ChatOptionCreate) Mutation() *ChatOptionMutation

Mutation returns the ChatOptionMutation object of the builder.

func (*ChatOptionCreate) OnConflict

func (coc *ChatOptionCreate) OnConflict(opts ...sql.ConflictOption) *ChatOptionUpsertOne

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

client.ChatOption.Create().
	SetChatID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ChatOptionUpsert) {
		SetChatID(v+v).
	}).
	Exec(ctx)

func (*ChatOptionCreate) OnConflictColumns

func (coc *ChatOptionCreate) OnConflictColumns(columns ...string) *ChatOptionUpsertOne

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

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

func (*ChatOptionCreate) QueryContext

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

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

func (*ChatOptionCreate) Save

func (coc *ChatOptionCreate) Save(ctx context.Context) (*ChatOption, error)

Save creates the ChatOption in the database.

func (*ChatOptionCreate) SaveX

func (coc *ChatOptionCreate) SaveX(ctx context.Context) *ChatOption

SaveX calls Save and panics if Save returns an error.

func (*ChatOptionCreate) SetChatID

func (coc *ChatOptionCreate) SetChatID(i int64) *ChatOptionCreate

SetChatID sets the "chat_id" field.

func (*ChatOptionCreate) SetCreateAt

func (coc *ChatOptionCreate) SetCreateAt(t time.Time) *ChatOptionCreate

SetCreateAt sets the "create_at" field.

func (*ChatOptionCreate) SetID

func (coc *ChatOptionCreate) SetID(i int64) *ChatOptionCreate

SetID sets the "id" field.

func (*ChatOptionCreate) SetKey

func (coc *ChatOptionCreate) SetKey(s string) *ChatOptionCreate

SetKey sets the "key" field.

func (*ChatOptionCreate) SetNillableCreateAt

func (coc *ChatOptionCreate) SetNillableCreateAt(t *time.Time) *ChatOptionCreate

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

func (*ChatOptionCreate) SetNillableUpdateAt

func (coc *ChatOptionCreate) SetNillableUpdateAt(t *time.Time) *ChatOptionCreate

SetNillableUpdateAt sets the "update_at" field if the given value is not nil.

func (*ChatOptionCreate) SetNillableValue

func (coc *ChatOptionCreate) SetNillableValue(s *string) *ChatOptionCreate

SetNillableValue sets the "value" field if the given value is not nil.

func (*ChatOptionCreate) SetUpdateAt

func (coc *ChatOptionCreate) SetUpdateAt(t time.Time) *ChatOptionCreate

SetUpdateAt sets the "update_at" field.

func (*ChatOptionCreate) SetValue

func (coc *ChatOptionCreate) SetValue(s string) *ChatOptionCreate

SetValue sets the "value" field.

type ChatOptionCreateBulk

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

ChatOptionCreateBulk is the builder for creating many ChatOption entities in bulk.

func (*ChatOptionCreateBulk) Exec

func (cocb *ChatOptionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatOptionCreateBulk) ExecContext

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

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

func (*ChatOptionCreateBulk) ExecX

func (cocb *ChatOptionCreateBulk) ExecX(ctx context.Context)

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

func (*ChatOptionCreateBulk) OnConflict

func (cocb *ChatOptionCreateBulk) OnConflict(opts ...sql.ConflictOption) *ChatOptionUpsertBulk

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

client.ChatOption.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ChatOptionUpsert) {
		SetChatID(v+v).
	}).
	Exec(ctx)

func (*ChatOptionCreateBulk) OnConflictColumns

func (cocb *ChatOptionCreateBulk) OnConflictColumns(columns ...string) *ChatOptionUpsertBulk

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

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

func (*ChatOptionCreateBulk) QueryContext

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

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

func (*ChatOptionCreateBulk) Save

func (cocb *ChatOptionCreateBulk) Save(ctx context.Context) ([]*ChatOption, error)

Save creates the ChatOption entities in the database.

func (*ChatOptionCreateBulk) SaveX

func (cocb *ChatOptionCreateBulk) SaveX(ctx context.Context) []*ChatOption

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

type ChatOptionDelete

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

ChatOptionDelete is the builder for deleting a ChatOption entity.

func (*ChatOptionDelete) Exec

func (cod *ChatOptionDelete) Exec(ctx context.Context) (int, error)

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

func (*ChatOptionDelete) ExecContext

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

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

func (*ChatOptionDelete) ExecX

func (cod *ChatOptionDelete) ExecX(ctx context.Context) int

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

func (*ChatOptionDelete) QueryContext

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

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

func (*ChatOptionDelete) Where

Where appends a list predicates to the ChatOptionDelete builder.

type ChatOptionDeleteOne

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

ChatOptionDeleteOne is the builder for deleting a single ChatOption entity.

func (*ChatOptionDeleteOne) Exec

func (codo *ChatOptionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ChatOptionDeleteOne) ExecX

func (codo *ChatOptionDeleteOne) ExecX(ctx context.Context)

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

func (*ChatOptionDeleteOne) Where

Where appends a list predicates to the ChatOptionDelete builder.

type ChatOptionGroupBy

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

ChatOptionGroupBy is the group-by builder for ChatOption entities.

func (*ChatOptionGroupBy) Aggregate

func (cogb *ChatOptionGroupBy) Aggregate(fns ...AggregateFunc) *ChatOptionGroupBy

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

func (*ChatOptionGroupBy) Bool

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

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

func (*ChatOptionGroupBy) BoolX

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

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

func (*ChatOptionGroupBy) Bools

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

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

func (*ChatOptionGroupBy) BoolsX

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

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

func (*ChatOptionGroupBy) Float64

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

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

func (*ChatOptionGroupBy) Float64X

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

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

func (*ChatOptionGroupBy) Float64s

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

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

func (*ChatOptionGroupBy) Float64sX

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

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

func (*ChatOptionGroupBy) Int

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

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

func (*ChatOptionGroupBy) IntX

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

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

func (*ChatOptionGroupBy) Ints

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

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

func (*ChatOptionGroupBy) IntsX

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

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

func (*ChatOptionGroupBy) Scan

func (cogb *ChatOptionGroupBy) Scan(ctx context.Context, v any) error

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

func (*ChatOptionGroupBy) ScanX

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

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

func (*ChatOptionGroupBy) String

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

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

func (*ChatOptionGroupBy) StringX

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

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

func (*ChatOptionGroupBy) Strings

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

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

func (*ChatOptionGroupBy) StringsX

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

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

type ChatOptionMutation

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

ChatOptionMutation represents an operation that mutates the ChatOption nodes in the graph.

func (*ChatOptionMutation) AddChatID

func (m *ChatOptionMutation) AddChatID(i int64)

AddChatID adds i to the "chat_id" field.

func (*ChatOptionMutation) AddField

func (m *ChatOptionMutation) 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 (*ChatOptionMutation) AddedChatID

func (m *ChatOptionMutation) AddedChatID() (r int64, exists bool)

AddedChatID returns the value that was added to the "chat_id" field in this mutation.

func (*ChatOptionMutation) AddedEdges

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

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

func (*ChatOptionMutation) AddedField

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

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

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

func (*ChatOptionMutation) AddedIDs

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

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

func (*ChatOptionMutation) ChatID

func (m *ChatOptionMutation) ChatID() (r int64, exists bool)

ChatID returns the value of the "chat_id" field in the mutation.

func (*ChatOptionMutation) ClearEdge

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

func (m *ChatOptionMutation) 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 (*ChatOptionMutation) ClearedEdges

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

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

func (*ChatOptionMutation) ClearedFields

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

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

func (ChatOptionMutation) Client

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

func (m *ChatOptionMutation) CreateAt() (r time.Time, exists bool)

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

func (*ChatOptionMutation) EdgeCleared

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

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

func (*ChatOptionMutation) ExecContext

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

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

func (*ChatOptionMutation) Field

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

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

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

func (*ChatOptionMutation) Fields

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

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

func (m *ChatOptionMutation) 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 (*ChatOptionMutation) Key

func (m *ChatOptionMutation) Key() (r string, exists bool)

Key returns the value of the "key" field in the mutation.

func (*ChatOptionMutation) OldChatID

func (m *ChatOptionMutation) OldChatID(ctx context.Context) (v int64, err error)

OldChatID returns the old "chat_id" field's value of the ChatOption entity. If the ChatOption 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 (*ChatOptionMutation) OldCreateAt

func (m *ChatOptionMutation) OldCreateAt(ctx context.Context) (v time.Time, err error)

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

func (m *ChatOptionMutation) 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 (*ChatOptionMutation) OldKey

func (m *ChatOptionMutation) OldKey(ctx context.Context) (v string, err error)

OldKey returns the old "key" field's value of the ChatOption entity. If the ChatOption 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 (*ChatOptionMutation) OldUpdateAt

func (m *ChatOptionMutation) OldUpdateAt(ctx context.Context) (v time.Time, err error)

OldUpdateAt returns the old "update_at" field's value of the ChatOption entity. If the ChatOption 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 (*ChatOptionMutation) OldValue

func (m *ChatOptionMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the ChatOption entity. If the ChatOption 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 (*ChatOptionMutation) Op

func (m *ChatOptionMutation) Op() Op

Op returns the operation name.

func (*ChatOptionMutation) QueryContext

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

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

func (*ChatOptionMutation) RemovedEdges

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

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

func (*ChatOptionMutation) RemovedIDs

func (m *ChatOptionMutation) 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 (*ChatOptionMutation) ResetChatID

func (m *ChatOptionMutation) ResetChatID()

ResetChatID resets all changes to the "chat_id" field.

func (*ChatOptionMutation) ResetCreateAt

func (m *ChatOptionMutation) ResetCreateAt()

ResetCreateAt resets all changes to the "create_at" field.

func (*ChatOptionMutation) ResetEdge

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

func (m *ChatOptionMutation) 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 (*ChatOptionMutation) ResetKey

func (m *ChatOptionMutation) ResetKey()

ResetKey resets all changes to the "key" field.

func (*ChatOptionMutation) ResetUpdateAt

func (m *ChatOptionMutation) ResetUpdateAt()

ResetUpdateAt resets all changes to the "update_at" field.

func (*ChatOptionMutation) ResetValue

func (m *ChatOptionMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*ChatOptionMutation) SetChatID

func (m *ChatOptionMutation) SetChatID(i int64)

SetChatID sets the "chat_id" field.

func (*ChatOptionMutation) SetCreateAt

func (m *ChatOptionMutation) SetCreateAt(t time.Time)

SetCreateAt sets the "create_at" field.

func (*ChatOptionMutation) SetField

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

func (m *ChatOptionMutation) SetID(id int64)

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

func (*ChatOptionMutation) SetKey

func (m *ChatOptionMutation) SetKey(s string)

SetKey sets the "key" field.

func (*ChatOptionMutation) SetOp

func (m *ChatOptionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ChatOptionMutation) SetUpdateAt

func (m *ChatOptionMutation) SetUpdateAt(t time.Time)

SetUpdateAt sets the "update_at" field.

func (*ChatOptionMutation) SetValue

func (m *ChatOptionMutation) SetValue(s string)

SetValue sets the "value" field.

func (ChatOptionMutation) Tx

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

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

func (*ChatOptionMutation) Type

func (m *ChatOptionMutation) Type() string

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

func (*ChatOptionMutation) UpdateAt

func (m *ChatOptionMutation) UpdateAt() (r time.Time, exists bool)

UpdateAt returns the value of the "update_at" field in the mutation.

func (*ChatOptionMutation) Value

func (m *ChatOptionMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*ChatOptionMutation) Where

func (m *ChatOptionMutation) Where(ps ...predicate.ChatOption)

Where appends a list predicates to the ChatOptionMutation builder.

func (*ChatOptionMutation) WhereP

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

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

type ChatOptionQuery

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

ChatOptionQuery is the builder for querying ChatOption entities.

func (*ChatOptionQuery) Aggregate

func (coq *ChatOptionQuery) Aggregate(fns ...AggregateFunc) *ChatOptionSelect

Aggregate returns a ChatOptionSelect configured with the given aggregations.

func (*ChatOptionQuery) All

func (coq *ChatOptionQuery) All(ctx context.Context) ([]*ChatOption, error)

All executes the query and returns a list of ChatOptions.

func (*ChatOptionQuery) AllX

func (coq *ChatOptionQuery) AllX(ctx context.Context) []*ChatOption

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

func (*ChatOptionQuery) Clone

func (coq *ChatOptionQuery) Clone() *ChatOptionQuery

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

func (*ChatOptionQuery) Count

func (coq *ChatOptionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ChatOptionQuery) CountX

func (coq *ChatOptionQuery) CountX(ctx context.Context) int

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

func (*ChatOptionQuery) ExecContext

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

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

func (*ChatOptionQuery) Exist

func (coq *ChatOptionQuery) Exist(ctx context.Context) (bool, error)

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

func (*ChatOptionQuery) ExistX

func (coq *ChatOptionQuery) ExistX(ctx context.Context) bool

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

func (*ChatOptionQuery) First

func (coq *ChatOptionQuery) First(ctx context.Context) (*ChatOption, error)

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

func (*ChatOptionQuery) FirstID

func (coq *ChatOptionQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*ChatOptionQuery) FirstIDX

func (coq *ChatOptionQuery) FirstIDX(ctx context.Context) int64

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

func (*ChatOptionQuery) FirstX

func (coq *ChatOptionQuery) FirstX(ctx context.Context) *ChatOption

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

func (*ChatOptionQuery) ForShare

func (coq *ChatOptionQuery) ForShare(opts ...sql.LockOption) *ChatOptionQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*ChatOptionQuery) ForUpdate

func (coq *ChatOptionQuery) ForUpdate(opts ...sql.LockOption) *ChatOptionQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*ChatOptionQuery) GroupBy

func (coq *ChatOptionQuery) GroupBy(field string, fields ...string) *ChatOptionGroupBy

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 {
	ChatID int64 `json:"chat_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.ChatOption.Query().
	GroupBy(chatoption.FieldChatID).
	Aggregate(entity.Count()).
	Scan(ctx, &v)

func (*ChatOptionQuery) IDs

func (coq *ChatOptionQuery) IDs(ctx context.Context) (ids []int64, err error)

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

func (*ChatOptionQuery) IDsX

func (coq *ChatOptionQuery) IDsX(ctx context.Context) []int64

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

func (*ChatOptionQuery) Limit

func (coq *ChatOptionQuery) Limit(limit int) *ChatOptionQuery

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

func (*ChatOptionQuery) Modify

func (coq *ChatOptionQuery) Modify(modifiers ...func(s *sql.Selector)) *ChatOptionSelect

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

func (*ChatOptionQuery) Offset

func (coq *ChatOptionQuery) Offset(offset int) *ChatOptionQuery

Offset to start from.

func (*ChatOptionQuery) Only

func (coq *ChatOptionQuery) Only(ctx context.Context) (*ChatOption, error)

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

func (*ChatOptionQuery) OnlyID

func (coq *ChatOptionQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*ChatOptionQuery) OnlyIDX

func (coq *ChatOptionQuery) OnlyIDX(ctx context.Context) int64

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

func (*ChatOptionQuery) OnlyX

func (coq *ChatOptionQuery) OnlyX(ctx context.Context) *ChatOption

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

func (*ChatOptionQuery) Order

func (coq *ChatOptionQuery) Order(o ...OrderFunc) *ChatOptionQuery

Order specifies how the records should be ordered.

func (*ChatOptionQuery) QueryContext

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

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

func (*ChatOptionQuery) Select

func (coq *ChatOptionQuery) Select(fields ...string) *ChatOptionSelect

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 {
	ChatID int64 `json:"chat_id,omitempty"`
}

client.ChatOption.Query().
	Select(chatoption.FieldChatID).
	Scan(ctx, &v)

func (*ChatOptionQuery) Unique

func (coq *ChatOptionQuery) Unique(unique bool) *ChatOptionQuery

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

Where adds a new predicate for the ChatOptionQuery builder.

type ChatOptionSelect

type ChatOptionSelect struct {
	*ChatOptionQuery
	// contains filtered or unexported fields
}

ChatOptionSelect is the builder for selecting fields of ChatOption entities.

func (*ChatOptionSelect) Aggregate

func (cos *ChatOptionSelect) Aggregate(fns ...AggregateFunc) *ChatOptionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ChatOptionSelect) Bool

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

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

func (*ChatOptionSelect) BoolX

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

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

func (*ChatOptionSelect) Bools

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

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

func (*ChatOptionSelect) BoolsX

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

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

func (ChatOptionSelect) ExecContext

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

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

func (*ChatOptionSelect) Float64

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

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

func (*ChatOptionSelect) Float64X

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

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

func (*ChatOptionSelect) Float64s

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

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

func (*ChatOptionSelect) Float64sX

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

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

func (*ChatOptionSelect) Int

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

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

func (*ChatOptionSelect) IntX

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

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

func (*ChatOptionSelect) Ints

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

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

func (*ChatOptionSelect) IntsX

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

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

func (*ChatOptionSelect) Modify

func (cos *ChatOptionSelect) Modify(modifiers ...func(s *sql.Selector)) *ChatOptionSelect

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

func (ChatOptionSelect) QueryContext

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

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

func (*ChatOptionSelect) Scan

func (cos *ChatOptionSelect) Scan(ctx context.Context, v any) error

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

func (*ChatOptionSelect) ScanX

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

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

func (*ChatOptionSelect) String

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

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

func (*ChatOptionSelect) StringX

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

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

func (*ChatOptionSelect) Strings

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

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

func (*ChatOptionSelect) StringsX

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

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

type ChatOptionUpdate

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

ChatOptionUpdate is the builder for updating ChatOption entities.

func (*ChatOptionUpdate) AddChatID

func (cou *ChatOptionUpdate) AddChatID(i int64) *ChatOptionUpdate

AddChatID adds i to the "chat_id" field.

func (*ChatOptionUpdate) Exec

func (cou *ChatOptionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatOptionUpdate) ExecContext

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

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

func (*ChatOptionUpdate) ExecX

func (cou *ChatOptionUpdate) ExecX(ctx context.Context)

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

func (*ChatOptionUpdate) Modify

func (cou *ChatOptionUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ChatOptionUpdate

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

func (*ChatOptionUpdate) Mutation

func (cou *ChatOptionUpdate) Mutation() *ChatOptionMutation

Mutation returns the ChatOptionMutation object of the builder.

func (*ChatOptionUpdate) QueryContext

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

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

func (*ChatOptionUpdate) Save

func (cou *ChatOptionUpdate) Save(ctx context.Context) (int, error)

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

func (*ChatOptionUpdate) SaveX

func (cou *ChatOptionUpdate) SaveX(ctx context.Context) int

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

func (*ChatOptionUpdate) SetChatID

func (cou *ChatOptionUpdate) SetChatID(i int64) *ChatOptionUpdate

SetChatID sets the "chat_id" field.

func (*ChatOptionUpdate) SetKey

func (cou *ChatOptionUpdate) SetKey(s string) *ChatOptionUpdate

SetKey sets the "key" field.

func (*ChatOptionUpdate) SetNillableValue

func (cou *ChatOptionUpdate) SetNillableValue(s *string) *ChatOptionUpdate

SetNillableValue sets the "value" field if the given value is not nil.

func (*ChatOptionUpdate) SetUpdateAt

func (cou *ChatOptionUpdate) SetUpdateAt(t time.Time) *ChatOptionUpdate

SetUpdateAt sets the "update_at" field.

func (*ChatOptionUpdate) SetValue

func (cou *ChatOptionUpdate) SetValue(s string) *ChatOptionUpdate

SetValue sets the "value" field.

func (*ChatOptionUpdate) Where

Where appends a list predicates to the ChatOptionUpdate builder.

type ChatOptionUpdateOne

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

ChatOptionUpdateOne is the builder for updating a single ChatOption entity.

func (*ChatOptionUpdateOne) AddChatID

func (couo *ChatOptionUpdateOne) AddChatID(i int64) *ChatOptionUpdateOne

AddChatID adds i to the "chat_id" field.

func (*ChatOptionUpdateOne) Exec

func (couo *ChatOptionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ChatOptionUpdateOne) ExecContext

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

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

func (*ChatOptionUpdateOne) ExecX

func (couo *ChatOptionUpdateOne) ExecX(ctx context.Context)

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

func (*ChatOptionUpdateOne) Modify

func (couo *ChatOptionUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ChatOptionUpdateOne

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

func (*ChatOptionUpdateOne) Mutation

func (couo *ChatOptionUpdateOne) Mutation() *ChatOptionMutation

Mutation returns the ChatOptionMutation object of the builder.

func (*ChatOptionUpdateOne) QueryContext

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

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

func (*ChatOptionUpdateOne) Save

func (couo *ChatOptionUpdateOne) Save(ctx context.Context) (*ChatOption, error)

Save executes the query and returns the updated ChatOption entity.

func (*ChatOptionUpdateOne) SaveX

func (couo *ChatOptionUpdateOne) SaveX(ctx context.Context) *ChatOption

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

func (*ChatOptionUpdateOne) Select

func (couo *ChatOptionUpdateOne) Select(field string, fields ...string) *ChatOptionUpdateOne

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

func (*ChatOptionUpdateOne) SetChatID

func (couo *ChatOptionUpdateOne) SetChatID(i int64) *ChatOptionUpdateOne

SetChatID sets the "chat_id" field.

func (*ChatOptionUpdateOne) SetKey

SetKey sets the "key" field.

func (*ChatOptionUpdateOne) SetNillableValue

func (couo *ChatOptionUpdateOne) SetNillableValue(s *string) *ChatOptionUpdateOne

SetNillableValue sets the "value" field if the given value is not nil.

func (*ChatOptionUpdateOne) SetUpdateAt

func (couo *ChatOptionUpdateOne) SetUpdateAt(t time.Time) *ChatOptionUpdateOne

SetUpdateAt sets the "update_at" field.

func (*ChatOptionUpdateOne) SetValue

func (couo *ChatOptionUpdateOne) SetValue(s string) *ChatOptionUpdateOne

SetValue sets the "value" field.

func (*ChatOptionUpdateOne) Where

Where appends a list predicates to the ChatOptionUpdate builder.

type ChatOptionUpsert

type ChatOptionUpsert struct {
	*sql.UpdateSet
}

ChatOptionUpsert is the "OnConflict" setter.

func (*ChatOptionUpsert) AddChatID

func (u *ChatOptionUpsert) AddChatID(v int64) *ChatOptionUpsert

AddChatID adds v to the "chat_id" field.

func (*ChatOptionUpsert) SetChatID

func (u *ChatOptionUpsert) SetChatID(v int64) *ChatOptionUpsert

SetChatID sets the "chat_id" field.

func (*ChatOptionUpsert) SetKey

SetKey sets the "key" field.

func (*ChatOptionUpsert) SetUpdateAt

func (u *ChatOptionUpsert) SetUpdateAt(v time.Time) *ChatOptionUpsert

SetUpdateAt sets the "update_at" field.

func (*ChatOptionUpsert) SetValue

func (u *ChatOptionUpsert) SetValue(v string) *ChatOptionUpsert

SetValue sets the "value" field.

func (*ChatOptionUpsert) UpdateChatID

func (u *ChatOptionUpsert) UpdateChatID() *ChatOptionUpsert

UpdateChatID sets the "chat_id" field to the value that was provided on create.

func (*ChatOptionUpsert) UpdateKey

func (u *ChatOptionUpsert) UpdateKey() *ChatOptionUpsert

UpdateKey sets the "key" field to the value that was provided on create.

func (*ChatOptionUpsert) UpdateUpdateAt

func (u *ChatOptionUpsert) UpdateUpdateAt() *ChatOptionUpsert

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*ChatOptionUpsert) UpdateValue

func (u *ChatOptionUpsert) UpdateValue() *ChatOptionUpsert

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

type ChatOptionUpsertBulk

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

ChatOptionUpsertBulk is the builder for "upsert"-ing a bulk of ChatOption nodes.

func (*ChatOptionUpsertBulk) AddChatID

AddChatID adds v to the "chat_id" field.

func (*ChatOptionUpsertBulk) DoNothing

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

func (*ChatOptionUpsertBulk) Exec

Exec executes the query.

func (*ChatOptionUpsertBulk) ExecX

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

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

func (*ChatOptionUpsertBulk) Ignore

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

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

func (*ChatOptionUpsertBulk) SetChatID

SetChatID sets the "chat_id" field.

func (*ChatOptionUpsertBulk) SetKey

SetKey sets the "key" field.

func (*ChatOptionUpsertBulk) SetUpdateAt

SetUpdateAt sets the "update_at" field.

func (*ChatOptionUpsertBulk) SetValue

SetValue sets the "value" field.

func (*ChatOptionUpsertBulk) Update

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

func (*ChatOptionUpsertBulk) UpdateChatID

func (u *ChatOptionUpsertBulk) UpdateChatID() *ChatOptionUpsertBulk

UpdateChatID sets the "chat_id" field to the value that was provided on create.

func (*ChatOptionUpsertBulk) UpdateKey

UpdateKey sets the "key" field to the value that was provided on create.

func (*ChatOptionUpsertBulk) UpdateNewValues

func (u *ChatOptionUpsertBulk) UpdateNewValues() *ChatOptionUpsertBulk

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

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

func (*ChatOptionUpsertBulk) UpdateUpdateAt

func (u *ChatOptionUpsertBulk) UpdateUpdateAt() *ChatOptionUpsertBulk

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*ChatOptionUpsertBulk) UpdateValue

func (u *ChatOptionUpsertBulk) UpdateValue() *ChatOptionUpsertBulk

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

type ChatOptionUpsertOne

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

ChatOptionUpsertOne is the builder for "upsert"-ing

one ChatOption node.

func (*ChatOptionUpsertOne) AddChatID

AddChatID adds v to the "chat_id" field.

func (*ChatOptionUpsertOne) DoNothing

func (u *ChatOptionUpsertOne) DoNothing() *ChatOptionUpsertOne

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

func (*ChatOptionUpsertOne) Exec

Exec executes the query.

func (*ChatOptionUpsertOne) ExecX

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

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

func (*ChatOptionUpsertOne) ID

func (u *ChatOptionUpsertOne) ID(ctx context.Context) (id int64, err error)

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

func (*ChatOptionUpsertOne) IDX

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

func (*ChatOptionUpsertOne) Ignore

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

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

func (*ChatOptionUpsertOne) SetChatID

SetChatID sets the "chat_id" field.

func (*ChatOptionUpsertOne) SetKey

SetKey sets the "key" field.

func (*ChatOptionUpsertOne) SetUpdateAt

func (u *ChatOptionUpsertOne) SetUpdateAt(v time.Time) *ChatOptionUpsertOne

SetUpdateAt sets the "update_at" field.

func (*ChatOptionUpsertOne) SetValue

SetValue sets the "value" field.

func (*ChatOptionUpsertOne) Update

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

func (*ChatOptionUpsertOne) UpdateChatID

func (u *ChatOptionUpsertOne) UpdateChatID() *ChatOptionUpsertOne

UpdateChatID sets the "chat_id" field to the value that was provided on create.

func (*ChatOptionUpsertOne) UpdateKey

func (u *ChatOptionUpsertOne) UpdateKey() *ChatOptionUpsertOne

UpdateKey sets the "key" field to the value that was provided on create.

func (*ChatOptionUpsertOne) UpdateNewValues

func (u *ChatOptionUpsertOne) UpdateNewValues() *ChatOptionUpsertOne

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

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

func (*ChatOptionUpsertOne) UpdateUpdateAt

func (u *ChatOptionUpsertOne) UpdateUpdateAt() *ChatOptionUpsertOne

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*ChatOptionUpsertOne) UpdateValue

func (u *ChatOptionUpsertOne) UpdateValue() *ChatOptionUpsertOne

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

type ChatOptions

type ChatOptions []*ChatOption

ChatOptions is a parsable slice of ChatOption.

type ChatQuery

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

ChatQuery is the builder for querying Chat entities.

func (*ChatQuery) Aggregate

func (cq *ChatQuery) Aggregate(fns ...AggregateFunc) *ChatSelect

Aggregate returns a ChatSelect configured with the given aggregations.

func (*ChatQuery) All

func (cq *ChatQuery) All(ctx context.Context) ([]*Chat, error)

All executes the query and returns a list of Chats.

func (*ChatQuery) AllX

func (cq *ChatQuery) AllX(ctx context.Context) []*Chat

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

func (*ChatQuery) Clone

func (cq *ChatQuery) Clone() *ChatQuery

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

func (*ChatQuery) Count

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

Count returns the count of the given query.

func (*ChatQuery) CountX

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

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

func (*ChatQuery) ExecContext

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

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

func (*ChatQuery) Exist

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

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

func (*ChatQuery) ExistX

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

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

func (*ChatQuery) First

func (cq *ChatQuery) First(ctx context.Context) (*Chat, error)

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

func (*ChatQuery) FirstID

func (cq *ChatQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*ChatQuery) FirstIDX

func (cq *ChatQuery) FirstIDX(ctx context.Context) int64

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

func (*ChatQuery) FirstX

func (cq *ChatQuery) FirstX(ctx context.Context) *Chat

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

func (*ChatQuery) ForShare

func (cq *ChatQuery) ForShare(opts ...sql.LockOption) *ChatQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*ChatQuery) ForUpdate

func (cq *ChatQuery) ForUpdate(opts ...sql.LockOption) *ChatQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*ChatQuery) GroupBy

func (cq *ChatQuery) GroupBy(field string, fields ...string) *ChatGroupBy

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 {
	ChatID int64 `json:"chat_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Chat.Query().
	GroupBy(chat.FieldChatID).
	Aggregate(entity.Count()).
	Scan(ctx, &v)

func (*ChatQuery) IDs

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

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

func (*ChatQuery) IDsX

func (cq *ChatQuery) IDsX(ctx context.Context) []int64

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

func (*ChatQuery) Limit

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

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

func (*ChatQuery) Modify

func (cq *ChatQuery) Modify(modifiers ...func(s *sql.Selector)) *ChatSelect

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

func (*ChatQuery) Offset

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

Offset to start from.

func (*ChatQuery) Only

func (cq *ChatQuery) Only(ctx context.Context) (*Chat, error)

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

func (*ChatQuery) OnlyID

func (cq *ChatQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*ChatQuery) OnlyIDX

func (cq *ChatQuery) OnlyIDX(ctx context.Context) int64

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

func (*ChatQuery) OnlyX

func (cq *ChatQuery) OnlyX(ctx context.Context) *Chat

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

func (*ChatQuery) Order

func (cq *ChatQuery) Order(o ...OrderFunc) *ChatQuery

Order specifies how the records should be ordered.

func (*ChatQuery) QueryContext

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

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

func (*ChatQuery) Select

func (cq *ChatQuery) Select(fields ...string) *ChatSelect

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 {
	ChatID int64 `json:"chat_id,omitempty"`
}

client.Chat.Query().
	Select(chat.FieldChatID).
	Scan(ctx, &v)

func (*ChatQuery) Unique

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

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

func (cq *ChatQuery) Where(ps ...predicate.Chat) *ChatQuery

Where adds a new predicate for the ChatQuery builder.

type ChatSelect

type ChatSelect struct {
	*ChatQuery
	// contains filtered or unexported fields
}

ChatSelect is the builder for selecting fields of Chat entities.

func (*ChatSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*ChatSelect) Bool

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

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

func (*ChatSelect) BoolX

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

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

func (*ChatSelect) Bools

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

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

func (*ChatSelect) BoolsX

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

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

func (ChatSelect) ExecContext

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

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

func (*ChatSelect) Float64

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

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

func (*ChatSelect) Float64X

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

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

func (*ChatSelect) Float64s

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

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

func (*ChatSelect) Float64sX

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

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

func (*ChatSelect) Int

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

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

func (*ChatSelect) IntX

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

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

func (*ChatSelect) Ints

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

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

func (*ChatSelect) IntsX

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

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

func (*ChatSelect) Modify

func (cs *ChatSelect) Modify(modifiers ...func(s *sql.Selector)) *ChatSelect

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

func (ChatSelect) QueryContext

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

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

func (*ChatSelect) Scan

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

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

func (*ChatSelect) ScanX

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

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

func (*ChatSelect) String

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

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

func (*ChatSelect) StringX

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

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

func (*ChatSelect) Strings

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

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

func (*ChatSelect) StringsX

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

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

type ChatUpdate

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

ChatUpdate is the builder for updating Chat entities.

func (*ChatUpdate) AddChatID

func (cu *ChatUpdate) AddChatID(i int64) *ChatUpdate

AddChatID adds i to the "chat_id" field.

func (*ChatUpdate) Exec

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

Exec executes the query.

func (*ChatUpdate) ExecContext

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

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

func (*ChatUpdate) ExecX

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

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

func (*ChatUpdate) Modify

func (cu *ChatUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ChatUpdate

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

func (*ChatUpdate) Mutation

func (cu *ChatUpdate) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatUpdate) QueryContext

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

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

func (*ChatUpdate) Save

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

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

func (*ChatUpdate) SaveX

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

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

func (*ChatUpdate) SetChatID

func (cu *ChatUpdate) SetChatID(i int64) *ChatUpdate

SetChatID sets the "chat_id" field.

func (*ChatUpdate) SetDescription

func (cu *ChatUpdate) SetDescription(s string) *ChatUpdate

SetDescription sets the "description" field.

func (*ChatUpdate) SetFirstName

func (cu *ChatUpdate) SetFirstName(s string) *ChatUpdate

SetFirstName sets the "first_name" field.

func (*ChatUpdate) SetIsForum

func (cu *ChatUpdate) SetIsForum(b bool) *ChatUpdate

SetIsForum sets the "is_forum" field.

func (*ChatUpdate) SetLastName

func (cu *ChatUpdate) SetLastName(s string) *ChatUpdate

SetLastName sets the "last_name" field.

func (*ChatUpdate) SetNillableDescription

func (cu *ChatUpdate) SetNillableDescription(s *string) *ChatUpdate

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

func (*ChatUpdate) SetNillableFirstName

func (cu *ChatUpdate) SetNillableFirstName(s *string) *ChatUpdate

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*ChatUpdate) SetNillableIsForum

func (cu *ChatUpdate) SetNillableIsForum(b *bool) *ChatUpdate

SetNillableIsForum sets the "is_forum" field if the given value is not nil.

func (*ChatUpdate) SetNillableLastName

func (cu *ChatUpdate) SetNillableLastName(s *string) *ChatUpdate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*ChatUpdate) SetNillableTitle

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

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

func (*ChatUpdate) SetNillableType

func (cu *ChatUpdate) SetNillableType(s *string) *ChatUpdate

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

func (*ChatUpdate) SetNillableUserName

func (cu *ChatUpdate) SetNillableUserName(s *string) *ChatUpdate

SetNillableUserName sets the "user_name" field if the given value is not nil.

func (*ChatUpdate) SetTitle

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

SetTitle sets the "title" field.

func (*ChatUpdate) SetType

func (cu *ChatUpdate) SetType(s string) *ChatUpdate

SetType sets the "type" field.

func (*ChatUpdate) SetUpdateAt

func (cu *ChatUpdate) SetUpdateAt(t time.Time) *ChatUpdate

SetUpdateAt sets the "update_at" field.

func (*ChatUpdate) SetUserName

func (cu *ChatUpdate) SetUserName(s string) *ChatUpdate

SetUserName sets the "user_name" field.

func (*ChatUpdate) Where

func (cu *ChatUpdate) Where(ps ...predicate.Chat) *ChatUpdate

Where appends a list predicates to the ChatUpdate builder.

type ChatUpdateOne

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

ChatUpdateOne is the builder for updating a single Chat entity.

func (*ChatUpdateOne) AddChatID

func (cuo *ChatUpdateOne) AddChatID(i int64) *ChatUpdateOne

AddChatID adds i to the "chat_id" field.

func (*ChatUpdateOne) Exec

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

Exec executes the query on the entity.

func (*ChatUpdateOne) ExecContext

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

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

func (*ChatUpdateOne) ExecX

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

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

func (*ChatUpdateOne) Modify

func (cuo *ChatUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ChatUpdateOne

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

func (*ChatUpdateOne) Mutation

func (cuo *ChatUpdateOne) Mutation() *ChatMutation

Mutation returns the ChatMutation object of the builder.

func (*ChatUpdateOne) QueryContext

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

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

func (*ChatUpdateOne) Save

func (cuo *ChatUpdateOne) Save(ctx context.Context) (*Chat, error)

Save executes the query and returns the updated Chat entity.

func (*ChatUpdateOne) SaveX

func (cuo *ChatUpdateOne) SaveX(ctx context.Context) *Chat

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

func (*ChatUpdateOne) Select

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

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

func (*ChatUpdateOne) SetChatID

func (cuo *ChatUpdateOne) SetChatID(i int64) *ChatUpdateOne

SetChatID sets the "chat_id" field.

func (*ChatUpdateOne) SetDescription

func (cuo *ChatUpdateOne) SetDescription(s string) *ChatUpdateOne

SetDescription sets the "description" field.

func (*ChatUpdateOne) SetFirstName

func (cuo *ChatUpdateOne) SetFirstName(s string) *ChatUpdateOne

SetFirstName sets the "first_name" field.

func (*ChatUpdateOne) SetIsForum

func (cuo *ChatUpdateOne) SetIsForum(b bool) *ChatUpdateOne

SetIsForum sets the "is_forum" field.

func (*ChatUpdateOne) SetLastName

func (cuo *ChatUpdateOne) SetLastName(s string) *ChatUpdateOne

SetLastName sets the "last_name" field.

func (*ChatUpdateOne) SetNillableDescription

func (cuo *ChatUpdateOne) SetNillableDescription(s *string) *ChatUpdateOne

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

func (*ChatUpdateOne) SetNillableFirstName

func (cuo *ChatUpdateOne) SetNillableFirstName(s *string) *ChatUpdateOne

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*ChatUpdateOne) SetNillableIsForum

func (cuo *ChatUpdateOne) SetNillableIsForum(b *bool) *ChatUpdateOne

SetNillableIsForum sets the "is_forum" field if the given value is not nil.

func (*ChatUpdateOne) SetNillableLastName

func (cuo *ChatUpdateOne) SetNillableLastName(s *string) *ChatUpdateOne

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*ChatUpdateOne) SetNillableTitle

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

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

func (*ChatUpdateOne) SetNillableType

func (cuo *ChatUpdateOne) SetNillableType(s *string) *ChatUpdateOne

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

func (*ChatUpdateOne) SetNillableUserName

func (cuo *ChatUpdateOne) SetNillableUserName(s *string) *ChatUpdateOne

SetNillableUserName sets the "user_name" field if the given value is not nil.

func (*ChatUpdateOne) SetTitle

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

SetTitle sets the "title" field.

func (*ChatUpdateOne) SetType

func (cuo *ChatUpdateOne) SetType(s string) *ChatUpdateOne

SetType sets the "type" field.

func (*ChatUpdateOne) SetUpdateAt

func (cuo *ChatUpdateOne) SetUpdateAt(t time.Time) *ChatUpdateOne

SetUpdateAt sets the "update_at" field.

func (*ChatUpdateOne) SetUserName

func (cuo *ChatUpdateOne) SetUserName(s string) *ChatUpdateOne

SetUserName sets the "user_name" field.

func (*ChatUpdateOne) Where

func (cuo *ChatUpdateOne) Where(ps ...predicate.Chat) *ChatUpdateOne

Where appends a list predicates to the ChatUpdate builder.

type ChatUpsert

type ChatUpsert struct {
	*sql.UpdateSet
}

ChatUpsert is the "OnConflict" setter.

func (*ChatUpsert) AddChatID

func (u *ChatUpsert) AddChatID(v int64) *ChatUpsert

AddChatID adds v to the "chat_id" field.

func (*ChatUpsert) SetChatID

func (u *ChatUpsert) SetChatID(v int64) *ChatUpsert

SetChatID sets the "chat_id" field.

func (*ChatUpsert) SetDescription

func (u *ChatUpsert) SetDescription(v string) *ChatUpsert

SetDescription sets the "description" field.

func (*ChatUpsert) SetFirstName

func (u *ChatUpsert) SetFirstName(v string) *ChatUpsert

SetFirstName sets the "first_name" field.

func (*ChatUpsert) SetIsForum

func (u *ChatUpsert) SetIsForum(v bool) *ChatUpsert

SetIsForum sets the "is_forum" field.

func (*ChatUpsert) SetLastName

func (u *ChatUpsert) SetLastName(v string) *ChatUpsert

SetLastName sets the "last_name" field.

func (*ChatUpsert) SetTitle

func (u *ChatUpsert) SetTitle(v string) *ChatUpsert

SetTitle sets the "title" field.

func (*ChatUpsert) SetType

func (u *ChatUpsert) SetType(v string) *ChatUpsert

SetType sets the "type" field.

func (*ChatUpsert) SetUpdateAt

func (u *ChatUpsert) SetUpdateAt(v time.Time) *ChatUpsert

SetUpdateAt sets the "update_at" field.

func (*ChatUpsert) SetUserName

func (u *ChatUpsert) SetUserName(v string) *ChatUpsert

SetUserName sets the "user_name" field.

func (*ChatUpsert) UpdateChatID

func (u *ChatUpsert) UpdateChatID() *ChatUpsert

UpdateChatID sets the "chat_id" field to the value that was provided on create.

func (*ChatUpsert) UpdateDescription

func (u *ChatUpsert) UpdateDescription() *ChatUpsert

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ChatUpsert) UpdateFirstName

func (u *ChatUpsert) UpdateFirstName() *ChatUpsert

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*ChatUpsert) UpdateIsForum

func (u *ChatUpsert) UpdateIsForum() *ChatUpsert

UpdateIsForum sets the "is_forum" field to the value that was provided on create.

func (*ChatUpsert) UpdateLastName

func (u *ChatUpsert) UpdateLastName() *ChatUpsert

UpdateLastName sets the "last_name" field to the value that was provided on create.

func (*ChatUpsert) UpdateTitle

func (u *ChatUpsert) UpdateTitle() *ChatUpsert

UpdateTitle sets the "title" field to the value that was provided on create.

func (*ChatUpsert) UpdateType

func (u *ChatUpsert) UpdateType() *ChatUpsert

UpdateType sets the "type" field to the value that was provided on create.

func (*ChatUpsert) UpdateUpdateAt

func (u *ChatUpsert) UpdateUpdateAt() *ChatUpsert

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*ChatUpsert) UpdateUserName

func (u *ChatUpsert) UpdateUserName() *ChatUpsert

UpdateUserName sets the "user_name" field to the value that was provided on create.

type ChatUpsertBulk

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

ChatUpsertBulk is the builder for "upsert"-ing a bulk of Chat nodes.

func (*ChatUpsertBulk) AddChatID

func (u *ChatUpsertBulk) AddChatID(v int64) *ChatUpsertBulk

AddChatID adds v to the "chat_id" field.

func (*ChatUpsertBulk) DoNothing

func (u *ChatUpsertBulk) DoNothing() *ChatUpsertBulk

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

func (*ChatUpsertBulk) Exec

func (u *ChatUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatUpsertBulk) ExecX

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

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

func (*ChatUpsertBulk) Ignore

func (u *ChatUpsertBulk) Ignore() *ChatUpsertBulk

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

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

func (*ChatUpsertBulk) SetChatID

func (u *ChatUpsertBulk) SetChatID(v int64) *ChatUpsertBulk

SetChatID sets the "chat_id" field.

func (*ChatUpsertBulk) SetDescription

func (u *ChatUpsertBulk) SetDescription(v string) *ChatUpsertBulk

SetDescription sets the "description" field.

func (*ChatUpsertBulk) SetFirstName

func (u *ChatUpsertBulk) SetFirstName(v string) *ChatUpsertBulk

SetFirstName sets the "first_name" field.

func (*ChatUpsertBulk) SetIsForum

func (u *ChatUpsertBulk) SetIsForum(v bool) *ChatUpsertBulk

SetIsForum sets the "is_forum" field.

func (*ChatUpsertBulk) SetLastName

func (u *ChatUpsertBulk) SetLastName(v string) *ChatUpsertBulk

SetLastName sets the "last_name" field.

func (*ChatUpsertBulk) SetTitle

func (u *ChatUpsertBulk) SetTitle(v string) *ChatUpsertBulk

SetTitle sets the "title" field.

func (*ChatUpsertBulk) SetType

func (u *ChatUpsertBulk) SetType(v string) *ChatUpsertBulk

SetType sets the "type" field.

func (*ChatUpsertBulk) SetUpdateAt

func (u *ChatUpsertBulk) SetUpdateAt(v time.Time) *ChatUpsertBulk

SetUpdateAt sets the "update_at" field.

func (*ChatUpsertBulk) SetUserName

func (u *ChatUpsertBulk) SetUserName(v string) *ChatUpsertBulk

SetUserName sets the "user_name" field.

func (*ChatUpsertBulk) Update

func (u *ChatUpsertBulk) Update(set func(*ChatUpsert)) *ChatUpsertBulk

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

func (*ChatUpsertBulk) UpdateChatID

func (u *ChatUpsertBulk) UpdateChatID() *ChatUpsertBulk

UpdateChatID sets the "chat_id" field to the value that was provided on create.

func (*ChatUpsertBulk) UpdateDescription

func (u *ChatUpsertBulk) UpdateDescription() *ChatUpsertBulk

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ChatUpsertBulk) UpdateFirstName

func (u *ChatUpsertBulk) UpdateFirstName() *ChatUpsertBulk

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*ChatUpsertBulk) UpdateIsForum

func (u *ChatUpsertBulk) UpdateIsForum() *ChatUpsertBulk

UpdateIsForum sets the "is_forum" field to the value that was provided on create.

func (*ChatUpsertBulk) UpdateLastName

func (u *ChatUpsertBulk) UpdateLastName() *ChatUpsertBulk

UpdateLastName sets the "last_name" field to the value that was provided on create.

func (*ChatUpsertBulk) UpdateNewValues

func (u *ChatUpsertBulk) UpdateNewValues() *ChatUpsertBulk

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

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

func (*ChatUpsertBulk) UpdateTitle

func (u *ChatUpsertBulk) UpdateTitle() *ChatUpsertBulk

UpdateTitle sets the "title" field to the value that was provided on create.

func (*ChatUpsertBulk) UpdateType

func (u *ChatUpsertBulk) UpdateType() *ChatUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

func (*ChatUpsertBulk) UpdateUpdateAt

func (u *ChatUpsertBulk) UpdateUpdateAt() *ChatUpsertBulk

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*ChatUpsertBulk) UpdateUserName

func (u *ChatUpsertBulk) UpdateUserName() *ChatUpsertBulk

UpdateUserName sets the "user_name" field to the value that was provided on create.

type ChatUpsertOne

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

ChatUpsertOne is the builder for "upsert"-ing

one Chat node.

func (*ChatUpsertOne) AddChatID

func (u *ChatUpsertOne) AddChatID(v int64) *ChatUpsertOne

AddChatID adds v to the "chat_id" field.

func (*ChatUpsertOne) DoNothing

func (u *ChatUpsertOne) DoNothing() *ChatUpsertOne

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

func (*ChatUpsertOne) Exec

func (u *ChatUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ChatUpsertOne) ExecX

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

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

func (*ChatUpsertOne) ID

func (u *ChatUpsertOne) ID(ctx context.Context) (id int64, err error)

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

func (*ChatUpsertOne) IDX

func (u *ChatUpsertOne) IDX(ctx context.Context) int64

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

func (*ChatUpsertOne) Ignore

func (u *ChatUpsertOne) Ignore() *ChatUpsertOne

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

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

func (*ChatUpsertOne) SetChatID

func (u *ChatUpsertOne) SetChatID(v int64) *ChatUpsertOne

SetChatID sets the "chat_id" field.

func (*ChatUpsertOne) SetDescription

func (u *ChatUpsertOne) SetDescription(v string) *ChatUpsertOne

SetDescription sets the "description" field.

func (*ChatUpsertOne) SetFirstName

func (u *ChatUpsertOne) SetFirstName(v string) *ChatUpsertOne

SetFirstName sets the "first_name" field.

func (*ChatUpsertOne) SetIsForum

func (u *ChatUpsertOne) SetIsForum(v bool) *ChatUpsertOne

SetIsForum sets the "is_forum" field.

func (*ChatUpsertOne) SetLastName

func (u *ChatUpsertOne) SetLastName(v string) *ChatUpsertOne

SetLastName sets the "last_name" field.

func (*ChatUpsertOne) SetTitle

func (u *ChatUpsertOne) SetTitle(v string) *ChatUpsertOne

SetTitle sets the "title" field.

func (*ChatUpsertOne) SetType

func (u *ChatUpsertOne) SetType(v string) *ChatUpsertOne

SetType sets the "type" field.

func (*ChatUpsertOne) SetUpdateAt

func (u *ChatUpsertOne) SetUpdateAt(v time.Time) *ChatUpsertOne

SetUpdateAt sets the "update_at" field.

func (*ChatUpsertOne) SetUserName

func (u *ChatUpsertOne) SetUserName(v string) *ChatUpsertOne

SetUserName sets the "user_name" field.

func (*ChatUpsertOne) Update

func (u *ChatUpsertOne) Update(set func(*ChatUpsert)) *ChatUpsertOne

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

func (*ChatUpsertOne) UpdateChatID

func (u *ChatUpsertOne) UpdateChatID() *ChatUpsertOne

UpdateChatID sets the "chat_id" field to the value that was provided on create.

func (*ChatUpsertOne) UpdateDescription

func (u *ChatUpsertOne) UpdateDescription() *ChatUpsertOne

UpdateDescription sets the "description" field to the value that was provided on create.

func (*ChatUpsertOne) UpdateFirstName

func (u *ChatUpsertOne) UpdateFirstName() *ChatUpsertOne

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*ChatUpsertOne) UpdateIsForum

func (u *ChatUpsertOne) UpdateIsForum() *ChatUpsertOne

UpdateIsForum sets the "is_forum" field to the value that was provided on create.

func (*ChatUpsertOne) UpdateLastName

func (u *ChatUpsertOne) UpdateLastName() *ChatUpsertOne

UpdateLastName sets the "last_name" field to the value that was provided on create.

func (*ChatUpsertOne) UpdateNewValues

func (u *ChatUpsertOne) UpdateNewValues() *ChatUpsertOne

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

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

func (*ChatUpsertOne) UpdateTitle

func (u *ChatUpsertOne) UpdateTitle() *ChatUpsertOne

UpdateTitle sets the "title" field to the value that was provided on create.

func (*ChatUpsertOne) UpdateType

func (u *ChatUpsertOne) UpdateType() *ChatUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

func (*ChatUpsertOne) UpdateUpdateAt

func (u *ChatUpsertOne) UpdateUpdateAt() *ChatUpsertOne

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*ChatUpsertOne) UpdateUserName

func (u *ChatUpsertOne) UpdateUserName() *ChatUpsertOne

UpdateUserName sets the "user_name" field to the value that was provided on create.

type Chats

type Chats []*Chat

Chats is a parsable slice of Chat.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Chat is the client for interacting with the Chat builders.
	Chat *ChatClient
	// ChatOption is the client for interacting with the ChatOption builders.
	ChatOption *ChatOptionClient
	// GameAccount is the client for interacting with the GameAccount builders.
	GameAccount *GameAccountClient
	// GameRole is the client for interacting with the GameRole builders.
	GameRole *GameRoleClient
	// GameRoleAttribute is the client for interacting with the GameRoleAttribute builders.
	GameRoleAttribute *GameRoleAttributeClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	Chat.
	Query().
	Count(ctx)

func (*Client) ExecContext

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

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

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) QueryContext

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

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

func (*Client) Tx

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

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

func (*Client) Use

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

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

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

type GameAccount struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int64 `json:"user_id,omitempty"`
	// AccountID holds the value of the "account_id" field.
	AccountID string `json:"account_id,omitempty"`
	// GameToken holds the value of the "game_token" field.
	GameToken string `json:"game_token,omitempty"`
	// CookieToken holds the value of the "cookie_token" field.
	CookieToken string `json:"cookie_token,omitempty"`
	// Stoken holds the value of the "stoken" field.
	Stoken string `json:"stoken,omitempty"`
	// Mid holds the value of the "mid" field.
	Mid string `json:"mid,omitempty"`
	// CreateAt holds the value of the "create_at" field.
	CreateAt time.Time `json:"create_at,omitempty"`
	// UpdateAt holds the value of the "update_at" field.
	UpdateAt time.Time `json:"update_at,omitempty"`
	// contains filtered or unexported fields
}

GameAccount is the model entity for the GameAccount schema.

func (*GameAccount) ExecContext

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

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

func (*GameAccount) QueryContext

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

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

func (*GameAccount) String

func (ga *GameAccount) String() string

String implements the fmt.Stringer.

func (*GameAccount) Unwrap

func (ga *GameAccount) Unwrap() *GameAccount

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

func (ga *GameAccount) Update() *GameAccountUpdateOne

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

type GameAccountClient

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

GameAccountClient is a client for the GameAccount schema.

func NewGameAccountClient

func NewGameAccountClient(c config) *GameAccountClient

NewGameAccountClient returns a client for the GameAccount from the given config.

func (*GameAccountClient) Create

func (c *GameAccountClient) Create() *GameAccountCreate

Create returns a builder for creating a GameAccount entity.

func (*GameAccountClient) CreateBulk

func (c *GameAccountClient) CreateBulk(builders ...*GameAccountCreate) *GameAccountCreateBulk

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

func (*GameAccountClient) Delete

func (c *GameAccountClient) Delete() *GameAccountDelete

Delete returns a delete builder for GameAccount.

func (*GameAccountClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GameAccountClient) DeleteOneID

func (c *GameAccountClient) DeleteOneID(id int64) *GameAccountDeleteOne

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

func (*GameAccountClient) ExecContext

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

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

func (*GameAccountClient) Get

Get returns a GameAccount entity by its id.

func (*GameAccountClient) GetX

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

func (*GameAccountClient) Hooks

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

Hooks returns the client hooks.

func (*GameAccountClient) Intercept

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

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

func (*GameAccountClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GameAccountClient) Query

func (c *GameAccountClient) Query() *GameAccountQuery

Query returns a query builder for GameAccount.

func (*GameAccountClient) QueryContext

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

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

func (*GameAccountClient) Update

func (c *GameAccountClient) Update() *GameAccountUpdate

Update returns an update builder for GameAccount.

func (*GameAccountClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GameAccountClient) UpdateOneID

func (c *GameAccountClient) UpdateOneID(id int64) *GameAccountUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GameAccountClient) Use

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

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

type GameAccountCreate

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

GameAccountCreate is the builder for creating a GameAccount entity.

func (*GameAccountCreate) Exec

func (gac *GameAccountCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GameAccountCreate) ExecContext

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

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

func (*GameAccountCreate) ExecX

func (gac *GameAccountCreate) ExecX(ctx context.Context)

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

func (*GameAccountCreate) Mutation

func (gac *GameAccountCreate) Mutation() *GameAccountMutation

Mutation returns the GameAccountMutation object of the builder.

func (*GameAccountCreate) OnConflict

func (gac *GameAccountCreate) OnConflict(opts ...sql.ConflictOption) *GameAccountUpsertOne

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

client.GameAccount.Create().
	SetUserID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GameAccountUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*GameAccountCreate) OnConflictColumns

func (gac *GameAccountCreate) OnConflictColumns(columns ...string) *GameAccountUpsertOne

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

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

func (*GameAccountCreate) QueryContext

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

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

func (*GameAccountCreate) Save

func (gac *GameAccountCreate) Save(ctx context.Context) (*GameAccount, error)

Save creates the GameAccount in the database.

func (*GameAccountCreate) SaveX

func (gac *GameAccountCreate) SaveX(ctx context.Context) *GameAccount

SaveX calls Save and panics if Save returns an error.

func (*GameAccountCreate) SetAccountID

func (gac *GameAccountCreate) SetAccountID(s string) *GameAccountCreate

SetAccountID sets the "account_id" field.

func (*GameAccountCreate) SetCookieToken

func (gac *GameAccountCreate) SetCookieToken(s string) *GameAccountCreate

SetCookieToken sets the "cookie_token" field.

func (*GameAccountCreate) SetCreateAt

func (gac *GameAccountCreate) SetCreateAt(t time.Time) *GameAccountCreate

SetCreateAt sets the "create_at" field.

func (*GameAccountCreate) SetGameToken

func (gac *GameAccountCreate) SetGameToken(s string) *GameAccountCreate

SetGameToken sets the "game_token" field.

func (*GameAccountCreate) SetID

func (gac *GameAccountCreate) SetID(i int64) *GameAccountCreate

SetID sets the "id" field.

func (*GameAccountCreate) SetMid

func (gac *GameAccountCreate) SetMid(s string) *GameAccountCreate

SetMid sets the "mid" field.

func (*GameAccountCreate) SetNillableCookieToken

func (gac *GameAccountCreate) SetNillableCookieToken(s *string) *GameAccountCreate

SetNillableCookieToken sets the "cookie_token" field if the given value is not nil.

func (*GameAccountCreate) SetNillableCreateAt

func (gac *GameAccountCreate) SetNillableCreateAt(t *time.Time) *GameAccountCreate

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

func (*GameAccountCreate) SetNillableGameToken

func (gac *GameAccountCreate) SetNillableGameToken(s *string) *GameAccountCreate

SetNillableGameToken sets the "game_token" field if the given value is not nil.

func (*GameAccountCreate) SetNillableMid

func (gac *GameAccountCreate) SetNillableMid(s *string) *GameAccountCreate

SetNillableMid sets the "mid" field if the given value is not nil.

func (*GameAccountCreate) SetNillableStoken

func (gac *GameAccountCreate) SetNillableStoken(s *string) *GameAccountCreate

SetNillableStoken sets the "stoken" field if the given value is not nil.

func (*GameAccountCreate) SetNillableUpdateAt

func (gac *GameAccountCreate) SetNillableUpdateAt(t *time.Time) *GameAccountCreate

SetNillableUpdateAt sets the "update_at" field if the given value is not nil.

func (*GameAccountCreate) SetStoken

func (gac *GameAccountCreate) SetStoken(s string) *GameAccountCreate

SetStoken sets the "stoken" field.

func (*GameAccountCreate) SetUpdateAt

func (gac *GameAccountCreate) SetUpdateAt(t time.Time) *GameAccountCreate

SetUpdateAt sets the "update_at" field.

func (*GameAccountCreate) SetUserID

func (gac *GameAccountCreate) SetUserID(i int64) *GameAccountCreate

SetUserID sets the "user_id" field.

type GameAccountCreateBulk

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

GameAccountCreateBulk is the builder for creating many GameAccount entities in bulk.

func (*GameAccountCreateBulk) Exec

func (gacb *GameAccountCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GameAccountCreateBulk) ExecContext

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

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

func (*GameAccountCreateBulk) ExecX

func (gacb *GameAccountCreateBulk) ExecX(ctx context.Context)

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

func (*GameAccountCreateBulk) OnConflict

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

client.GameAccount.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GameAccountUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*GameAccountCreateBulk) OnConflictColumns

func (gacb *GameAccountCreateBulk) OnConflictColumns(columns ...string) *GameAccountUpsertBulk

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

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

func (*GameAccountCreateBulk) QueryContext

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

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

func (*GameAccountCreateBulk) Save

func (gacb *GameAccountCreateBulk) Save(ctx context.Context) ([]*GameAccount, error)

Save creates the GameAccount entities in the database.

func (*GameAccountCreateBulk) SaveX

func (gacb *GameAccountCreateBulk) SaveX(ctx context.Context) []*GameAccount

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

type GameAccountDelete

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

GameAccountDelete is the builder for deleting a GameAccount entity.

func (*GameAccountDelete) Exec

func (gad *GameAccountDelete) Exec(ctx context.Context) (int, error)

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

func (*GameAccountDelete) ExecContext

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

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

func (*GameAccountDelete) ExecX

func (gad *GameAccountDelete) ExecX(ctx context.Context) int

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

func (*GameAccountDelete) QueryContext

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

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

func (*GameAccountDelete) Where

Where appends a list predicates to the GameAccountDelete builder.

type GameAccountDeleteOne

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

GameAccountDeleteOne is the builder for deleting a single GameAccount entity.

func (*GameAccountDeleteOne) Exec

func (gado *GameAccountDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GameAccountDeleteOne) ExecX

func (gado *GameAccountDeleteOne) ExecX(ctx context.Context)

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

func (*GameAccountDeleteOne) Where

Where appends a list predicates to the GameAccountDelete builder.

type GameAccountGroupBy

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

GameAccountGroupBy is the group-by builder for GameAccount entities.

func (*GameAccountGroupBy) Aggregate

func (gagb *GameAccountGroupBy) Aggregate(fns ...AggregateFunc) *GameAccountGroupBy

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

func (*GameAccountGroupBy) Bool

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

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

func (*GameAccountGroupBy) BoolX

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

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

func (*GameAccountGroupBy) Bools

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

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

func (*GameAccountGroupBy) BoolsX

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

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

func (*GameAccountGroupBy) Float64

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

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

func (*GameAccountGroupBy) Float64X

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

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

func (*GameAccountGroupBy) Float64s

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

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

func (*GameAccountGroupBy) Float64sX

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

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

func (*GameAccountGroupBy) Int

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

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

func (*GameAccountGroupBy) IntX

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

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

func (*GameAccountGroupBy) Ints

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

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

func (*GameAccountGroupBy) IntsX

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

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

func (*GameAccountGroupBy) Scan

func (gagb *GameAccountGroupBy) Scan(ctx context.Context, v any) error

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

func (*GameAccountGroupBy) ScanX

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

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

func (*GameAccountGroupBy) String

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

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

func (*GameAccountGroupBy) StringX

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

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

func (*GameAccountGroupBy) Strings

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

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

func (*GameAccountGroupBy) StringsX

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

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

type GameAccountMutation

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

GameAccountMutation represents an operation that mutates the GameAccount nodes in the graph.

func (*GameAccountMutation) AccountID

func (m *GameAccountMutation) AccountID() (r string, exists bool)

AccountID returns the value of the "account_id" field in the mutation.

func (*GameAccountMutation) AddField

func (m *GameAccountMutation) 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 (*GameAccountMutation) AddUserID

func (m *GameAccountMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*GameAccountMutation) AddedEdges

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

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

func (*GameAccountMutation) AddedField

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

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

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

func (*GameAccountMutation) AddedIDs

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

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

func (*GameAccountMutation) AddedUserID

func (m *GameAccountMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*GameAccountMutation) ClearEdge

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

func (m *GameAccountMutation) 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 (*GameAccountMutation) ClearedEdges

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

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

func (*GameAccountMutation) ClearedFields

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

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

func (GameAccountMutation) Client

func (m GameAccountMutation) 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 (*GameAccountMutation) CookieToken

func (m *GameAccountMutation) CookieToken() (r string, exists bool)

CookieToken returns the value of the "cookie_token" field in the mutation.

func (*GameAccountMutation) CreateAt

func (m *GameAccountMutation) CreateAt() (r time.Time, exists bool)

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

func (*GameAccountMutation) EdgeCleared

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

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

func (*GameAccountMutation) ExecContext

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

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

func (*GameAccountMutation) Field

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

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

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

func (*GameAccountMutation) Fields

func (m *GameAccountMutation) 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 (*GameAccountMutation) GameToken

func (m *GameAccountMutation) GameToken() (r string, exists bool)

GameToken returns the value of the "game_token" field in the mutation.

func (*GameAccountMutation) ID

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

func (m *GameAccountMutation) 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 (*GameAccountMutation) Mid

func (m *GameAccountMutation) Mid() (r string, exists bool)

Mid returns the value of the "mid" field in the mutation.

func (*GameAccountMutation) OldAccountID

func (m *GameAccountMutation) OldAccountID(ctx context.Context) (v string, err error)

OldAccountID returns the old "account_id" field's value of the GameAccount entity. If the GameAccount 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 (*GameAccountMutation) OldCookieToken

func (m *GameAccountMutation) OldCookieToken(ctx context.Context) (v string, err error)

OldCookieToken returns the old "cookie_token" field's value of the GameAccount entity. If the GameAccount 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 (*GameAccountMutation) OldCreateAt

func (m *GameAccountMutation) OldCreateAt(ctx context.Context) (v time.Time, err error)

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

func (m *GameAccountMutation) 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 (*GameAccountMutation) OldGameToken

func (m *GameAccountMutation) OldGameToken(ctx context.Context) (v string, err error)

OldGameToken returns the old "game_token" field's value of the GameAccount entity. If the GameAccount 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 (*GameAccountMutation) OldMid

func (m *GameAccountMutation) OldMid(ctx context.Context) (v string, err error)

OldMid returns the old "mid" field's value of the GameAccount entity. If the GameAccount 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 (*GameAccountMutation) OldStoken

func (m *GameAccountMutation) OldStoken(ctx context.Context) (v string, err error)

OldStoken returns the old "stoken" field's value of the GameAccount entity. If the GameAccount 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 (*GameAccountMutation) OldUpdateAt

func (m *GameAccountMutation) OldUpdateAt(ctx context.Context) (v time.Time, err error)

OldUpdateAt returns the old "update_at" field's value of the GameAccount entity. If the GameAccount 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 (*GameAccountMutation) OldUserID

func (m *GameAccountMutation) OldUserID(ctx context.Context) (v int64, err error)

OldUserID returns the old "user_id" field's value of the GameAccount entity. If the GameAccount 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 (*GameAccountMutation) Op

func (m *GameAccountMutation) Op() Op

Op returns the operation name.

func (*GameAccountMutation) QueryContext

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

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

func (*GameAccountMutation) RemovedEdges

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

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

func (*GameAccountMutation) RemovedIDs

func (m *GameAccountMutation) 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 (*GameAccountMutation) ResetAccountID

func (m *GameAccountMutation) ResetAccountID()

ResetAccountID resets all changes to the "account_id" field.

func (*GameAccountMutation) ResetCookieToken

func (m *GameAccountMutation) ResetCookieToken()

ResetCookieToken resets all changes to the "cookie_token" field.

func (*GameAccountMutation) ResetCreateAt

func (m *GameAccountMutation) ResetCreateAt()

ResetCreateAt resets all changes to the "create_at" field.

func (*GameAccountMutation) ResetEdge

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

func (m *GameAccountMutation) 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 (*GameAccountMutation) ResetGameToken

func (m *GameAccountMutation) ResetGameToken()

ResetGameToken resets all changes to the "game_token" field.

func (*GameAccountMutation) ResetMid

func (m *GameAccountMutation) ResetMid()

ResetMid resets all changes to the "mid" field.

func (*GameAccountMutation) ResetStoken

func (m *GameAccountMutation) ResetStoken()

ResetStoken resets all changes to the "stoken" field.

func (*GameAccountMutation) ResetUpdateAt

func (m *GameAccountMutation) ResetUpdateAt()

ResetUpdateAt resets all changes to the "update_at" field.

func (*GameAccountMutation) ResetUserID

func (m *GameAccountMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*GameAccountMutation) SetAccountID

func (m *GameAccountMutation) SetAccountID(s string)

SetAccountID sets the "account_id" field.

func (*GameAccountMutation) SetCookieToken

func (m *GameAccountMutation) SetCookieToken(s string)

SetCookieToken sets the "cookie_token" field.

func (*GameAccountMutation) SetCreateAt

func (m *GameAccountMutation) SetCreateAt(t time.Time)

SetCreateAt sets the "create_at" field.

func (*GameAccountMutation) SetField

func (m *GameAccountMutation) 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 (*GameAccountMutation) SetGameToken

func (m *GameAccountMutation) SetGameToken(s string)

SetGameToken sets the "game_token" field.

func (*GameAccountMutation) SetID

func (m *GameAccountMutation) SetID(id int64)

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

func (*GameAccountMutation) SetMid

func (m *GameAccountMutation) SetMid(s string)

SetMid sets the "mid" field.

func (*GameAccountMutation) SetOp

func (m *GameAccountMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GameAccountMutation) SetStoken

func (m *GameAccountMutation) SetStoken(s string)

SetStoken sets the "stoken" field.

func (*GameAccountMutation) SetUpdateAt

func (m *GameAccountMutation) SetUpdateAt(t time.Time)

SetUpdateAt sets the "update_at" field.

func (*GameAccountMutation) SetUserID

func (m *GameAccountMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (*GameAccountMutation) Stoken

func (m *GameAccountMutation) Stoken() (r string, exists bool)

Stoken returns the value of the "stoken" field in the mutation.

func (GameAccountMutation) Tx

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

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

func (*GameAccountMutation) Type

func (m *GameAccountMutation) Type() string

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

func (*GameAccountMutation) UpdateAt

func (m *GameAccountMutation) UpdateAt() (r time.Time, exists bool)

UpdateAt returns the value of the "update_at" field in the mutation.

func (*GameAccountMutation) UserID

func (m *GameAccountMutation) UserID() (r int64, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*GameAccountMutation) Where

func (m *GameAccountMutation) Where(ps ...predicate.GameAccount)

Where appends a list predicates to the GameAccountMutation builder.

func (*GameAccountMutation) WhereP

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

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

type GameAccountQuery

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

GameAccountQuery is the builder for querying GameAccount entities.

func (*GameAccountQuery) Aggregate

func (gaq *GameAccountQuery) Aggregate(fns ...AggregateFunc) *GameAccountSelect

Aggregate returns a GameAccountSelect configured with the given aggregations.

func (*GameAccountQuery) All

func (gaq *GameAccountQuery) All(ctx context.Context) ([]*GameAccount, error)

All executes the query and returns a list of GameAccounts.

func (*GameAccountQuery) AllX

func (gaq *GameAccountQuery) AllX(ctx context.Context) []*GameAccount

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

func (*GameAccountQuery) Clone

func (gaq *GameAccountQuery) Clone() *GameAccountQuery

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

func (*GameAccountQuery) Count

func (gaq *GameAccountQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GameAccountQuery) CountX

func (gaq *GameAccountQuery) CountX(ctx context.Context) int

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

func (*GameAccountQuery) ExecContext

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

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

func (*GameAccountQuery) Exist

func (gaq *GameAccountQuery) Exist(ctx context.Context) (bool, error)

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

func (*GameAccountQuery) ExistX

func (gaq *GameAccountQuery) ExistX(ctx context.Context) bool

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

func (*GameAccountQuery) First

func (gaq *GameAccountQuery) First(ctx context.Context) (*GameAccount, error)

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

func (*GameAccountQuery) FirstID

func (gaq *GameAccountQuery) FirstID(ctx context.Context) (id int64, err error)

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

func (*GameAccountQuery) FirstIDX

func (gaq *GameAccountQuery) FirstIDX(ctx context.Context) int64

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

func (*GameAccountQuery) FirstX

func (gaq *GameAccountQuery) FirstX(ctx context.Context) *GameAccount

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

func (*GameAccountQuery) ForShare

func (gaq *GameAccountQuery) ForShare(opts ...sql.LockOption) *GameAccountQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*GameAccountQuery) ForUpdate

func (gaq *GameAccountQuery) ForUpdate(opts ...sql.LockOption) *GameAccountQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*GameAccountQuery) GroupBy

func (gaq *GameAccountQuery) GroupBy(field string, fields ...string) *GameAccountGroupBy

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 {
	UserID int64 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GameAccount.Query().
	GroupBy(gameaccount.FieldUserID).
	Aggregate(entity.Count()).
	Scan(ctx, &v)

func (*GameAccountQuery) IDs

func (gaq *GameAccountQuery) IDs(ctx context.Context) (ids []int64, err error)

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

func (*GameAccountQuery) IDsX

func (gaq *GameAccountQuery) IDsX(ctx context.Context) []int64

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

func (*GameAccountQuery) Limit

func (gaq *GameAccountQuery) Limit(limit int) *GameAccountQuery

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

func (*GameAccountQuery) Modify

func (gaq *GameAccountQuery) Modify(modifiers ...func(s *sql.Selector)) *GameAccountSelect

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

func (*GameAccountQuery) Offset

func (gaq *GameAccountQuery) Offset(offset int) *GameAccountQuery

Offset to start from.

func (*GameAccountQuery) Only

func (gaq *GameAccountQuery) Only(ctx context.Context) (*GameAccount, error)

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

func (*GameAccountQuery) OnlyID

func (gaq *GameAccountQuery) OnlyID(ctx context.Context) (id int64, err error)

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

func (*GameAccountQuery) OnlyIDX

func (gaq *GameAccountQuery) OnlyIDX(ctx context.Context) int64

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

func (*GameAccountQuery) OnlyX

func (gaq *GameAccountQuery) OnlyX(ctx context.Context) *GameAccount

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

func (*GameAccountQuery) Order

func (gaq *GameAccountQuery) Order(o ...OrderFunc) *GameAccountQuery

Order specifies how the records should be ordered.

func (*GameAccountQuery) QueryContext

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

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

func (*GameAccountQuery) Select

func (gaq *GameAccountQuery) Select(fields ...string) *GameAccountSelect

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 {
	UserID int64 `json:"user_id,omitempty"`
}

client.GameAccount.Query().
	Select(gameaccount.FieldUserID).
	Scan(ctx, &v)

func (*GameAccountQuery) Unique

func (gaq *GameAccountQuery) Unique(unique bool) *GameAccountQuery

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

Where adds a new predicate for the GameAccountQuery builder.

type GameAccountSelect

type GameAccountSelect struct {
	*GameAccountQuery
	// contains filtered or unexported fields
}

GameAccountSelect is the builder for selecting fields of GameAccount entities.

func (*GameAccountSelect) Aggregate

func (gas *GameAccountSelect) Aggregate(fns ...AggregateFunc) *GameAccountSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GameAccountSelect) Bool

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

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

func (*GameAccountSelect) BoolX

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

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

func (*GameAccountSelect) Bools

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

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

func (*GameAccountSelect) BoolsX

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

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

func (GameAccountSelect) ExecContext

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

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

func (*GameAccountSelect) Float64

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

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

func (*GameAccountSelect) Float64X

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

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

func (*GameAccountSelect) Float64s

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

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

func (*GameAccountSelect) Float64sX

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

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

func (*GameAccountSelect) Int

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

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

func (*GameAccountSelect) IntX

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

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

func (*GameAccountSelect) Ints

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

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

func (*GameAccountSelect) IntsX

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

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

func (*GameAccountSelect) Modify

func (gas *GameAccountSelect) Modify(modifiers ...func(s *sql.Selector)) *GameAccountSelect

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

func (GameAccountSelect) QueryContext

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

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

func (*GameAccountSelect) Scan

func (gas *GameAccountSelect) Scan(ctx context.Context, v any) error

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

func (*GameAccountSelect) ScanX

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

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

func (*GameAccountSelect) String

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

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

func (*GameAccountSelect) StringX

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

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

func (*GameAccountSelect) Strings

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

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

func (*GameAccountSelect) StringsX

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

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

type GameAccountUpdate

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

GameAccountUpdate is the builder for updating GameAccount entities.

func (*GameAccountUpdate) AddUserID

func (gau *GameAccountUpdate) AddUserID(i int64) *GameAccountUpdate

AddUserID adds i to the "user_id" field.

func (*GameAccountUpdate) Exec

func (gau *GameAccountUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GameAccountUpdate) ExecContext

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

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

func (*GameAccountUpdate) ExecX

func (gau *GameAccountUpdate) ExecX(ctx context.Context)

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

func (*GameAccountUpdate) Modify

func (gau *GameAccountUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *GameAccountUpdate

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

func (*GameAccountUpdate) Mutation

func (gau *GameAccountUpdate) Mutation() *GameAccountMutation

Mutation returns the GameAccountMutation object of the builder.

func (*GameAccountUpdate) QueryContext

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

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

func (*GameAccountUpdate) Save

func (gau *GameAccountUpdate) Save(ctx context.Context) (int, error)

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

func (*GameAccountUpdate) SaveX

func (gau *GameAccountUpdate) SaveX(ctx context.Context) int

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

func (*GameAccountUpdate) SetAccountID

func (gau *GameAccountUpdate) SetAccountID(s string) *GameAccountUpdate

SetAccountID sets the "account_id" field.

func (*GameAccountUpdate) SetCookieToken

func (gau *GameAccountUpdate) SetCookieToken(s string) *GameAccountUpdate

SetCookieToken sets the "cookie_token" field.

func (*GameAccountUpdate) SetGameToken

func (gau *GameAccountUpdate) SetGameToken(s string) *GameAccountUpdate

SetGameToken sets the "game_token" field.

func (*GameAccountUpdate) SetMid

func (gau *GameAccountUpdate) SetMid(s string) *GameAccountUpdate

SetMid sets the "mid" field.

func (*GameAccountUpdate) SetNillableCookieToken

func (gau *GameAccountUpdate) SetNillableCookieToken(s *string) *GameAccountUpdate

SetNillableCookieToken sets the "cookie_token" field if the given value is not nil.

func (*GameAccountUpdate) SetNillableGameToken

func (gau *GameAccountUpdate) SetNillableGameToken(s *string) *GameAccountUpdate

SetNillableGameToken sets the "game_token" field if the given value is not nil.

func (*GameAccountUpdate) SetNillableMid

func (gau *GameAccountUpdate) SetNillableMid(s *string) *GameAccountUpdate

SetNillableMid sets the "mid" field if the given value is not nil.

func (*GameAccountUpdate) SetNillableStoken

func (gau *GameAccountUpdate) SetNillableStoken(s *string) *GameAccountUpdate

SetNillableStoken sets the "stoken" field if the given value is not nil.

func (*GameAccountUpdate) SetStoken

func (gau *GameAccountUpdate) SetStoken(s string) *GameAccountUpdate

SetStoken sets the "stoken" field.

func (*GameAccountUpdate) SetUpdateAt

func (gau *GameAccountUpdate) SetUpdateAt(t time.Time) *GameAccountUpdate

SetUpdateAt sets the "update_at" field.

func (*GameAccountUpdate) SetUserID

func (gau *GameAccountUpdate) SetUserID(i int64) *GameAccountUpdate

SetUserID sets the "user_id" field.

func (*GameAccountUpdate) Where

Where appends a list predicates to the GameAccountUpdate builder.

type GameAccountUpdateOne

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

GameAccountUpdateOne is the builder for updating a single GameAccount entity.

func (*GameAccountUpdateOne) AddUserID

func (gauo *GameAccountUpdateOne) AddUserID(i int64) *GameAccountUpdateOne

AddUserID adds i to the "user_id" field.

func (*GameAccountUpdateOne) Exec

func (gauo *GameAccountUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GameAccountUpdateOne) ExecContext

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

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

func (*GameAccountUpdateOne) ExecX

func (gauo *GameAccountUpdateOne) ExecX(ctx context.Context)

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

func (*GameAccountUpdateOne) Modify

func (gauo *GameAccountUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *GameAccountUpdateOne

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

func (*GameAccountUpdateOne) Mutation

func (gauo *GameAccountUpdateOne) Mutation() *GameAccountMutation

Mutation returns the GameAccountMutation object of the builder.

func (*GameAccountUpdateOne) QueryContext

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

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

func (*GameAccountUpdateOne) Save

Save executes the query and returns the updated GameAccount entity.

func (*GameAccountUpdateOne) SaveX

func (gauo *GameAccountUpdateOne) SaveX(ctx context.Context) *GameAccount

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

func (*GameAccountUpdateOne) Select

func (gauo *GameAccountUpdateOne) Select(field string, fields ...string) *GameAccountUpdateOne

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

func (*GameAccountUpdateOne) SetAccountID

func (gauo *GameAccountUpdateOne) SetAccountID(s string) *GameAccountUpdateOne

SetAccountID sets the "account_id" field.

func (*GameAccountUpdateOne) SetCookieToken

func (gauo *GameAccountUpdateOne) SetCookieToken(s string) *GameAccountUpdateOne

SetCookieToken sets the "cookie_token" field.

func (*GameAccountUpdateOne) SetGameToken

func (gauo *GameAccountUpdateOne) SetGameToken(s string) *GameAccountUpdateOne

SetGameToken sets the "game_token" field.

func (*GameAccountUpdateOne) SetMid

SetMid sets the "mid" field.

func (*GameAccountUpdateOne) SetNillableCookieToken

func (gauo *GameAccountUpdateOne) SetNillableCookieToken(s *string) *GameAccountUpdateOne

SetNillableCookieToken sets the "cookie_token" field if the given value is not nil.

func (*GameAccountUpdateOne) SetNillableGameToken

func (gauo *GameAccountUpdateOne) SetNillableGameToken(s *string) *GameAccountUpdateOne

SetNillableGameToken sets the "game_token" field if the given value is not nil.

func (*GameAccountUpdateOne) SetNillableMid

func (gauo *GameAccountUpdateOne) SetNillableMid(s *string) *GameAccountUpdateOne

SetNillableMid sets the "mid" field if the given value is not nil.

func (*GameAccountUpdateOne) SetNillableStoken

func (gauo *GameAccountUpdateOne) SetNillableStoken(s *string) *GameAccountUpdateOne

SetNillableStoken sets the "stoken" field if the given value is not nil.

func (*GameAccountUpdateOne) SetStoken

func (gauo *GameAccountUpdateOne) SetStoken(s string) *GameAccountUpdateOne

SetStoken sets the "stoken" field.

func (*GameAccountUpdateOne) SetUpdateAt

func (gauo *GameAccountUpdateOne) SetUpdateAt(t time.Time) *GameAccountUpdateOne

SetUpdateAt sets the "update_at" field.

func (*GameAccountUpdateOne) SetUserID

func (gauo *GameAccountUpdateOne) SetUserID(i int64) *GameAccountUpdateOne

SetUserID sets the "user_id" field.

func (*GameAccountUpdateOne) Where

Where appends a list predicates to the GameAccountUpdate builder.

type GameAccountUpsert

type GameAccountUpsert struct {
	*sql.UpdateSet
}

GameAccountUpsert is the "OnConflict" setter.

func (*GameAccountUpsert) AddUserID

func (u *GameAccountUpsert) AddUserID(v int64) *GameAccountUpsert

AddUserID adds v to the "user_id" field.

func (*GameAccountUpsert) SetAccountID

func (u *GameAccountUpsert) SetAccountID(v string) *GameAccountUpsert

SetAccountID sets the "account_id" field.

func (*GameAccountUpsert) SetCookieToken

func (u *GameAccountUpsert) SetCookieToken(v string) *GameAccountUpsert

SetCookieToken sets the "cookie_token" field.

func (*GameAccountUpsert) SetGameToken

func (u *GameAccountUpsert) SetGameToken(v string) *GameAccountUpsert

SetGameToken sets the "game_token" field.

func (*GameAccountUpsert) SetMid

SetMid sets the "mid" field.

func (*GameAccountUpsert) SetStoken

func (u *GameAccountUpsert) SetStoken(v string) *GameAccountUpsert

SetStoken sets the "stoken" field.

func (*GameAccountUpsert) SetUpdateAt

func (u *GameAccountUpsert) SetUpdateAt(v time.Time) *GameAccountUpsert

SetUpdateAt sets the "update_at" field.

func (*GameAccountUpsert) SetUserID

func (u *GameAccountUpsert) SetUserID(v int64) *GameAccountUpsert

SetUserID sets the "user_id" field.

func (*GameAccountUpsert) UpdateAccountID

func (u *GameAccountUpsert) UpdateAccountID() *GameAccountUpsert

UpdateAccountID sets the "account_id" field to the value that was provided on create.

func (*GameAccountUpsert) UpdateCookieToken

func (u *GameAccountUpsert) UpdateCookieToken() *GameAccountUpsert

UpdateCookieToken sets the "cookie_token" field to the value that was provided on create.

func (*GameAccountUpsert) UpdateGameToken

func (u *GameAccountUpsert) UpdateGameToken() *GameAccountUpsert

UpdateGameToken sets the "game_token" field to the value that was provided on create.

func (*GameAccountUpsert) UpdateMid

func (u *GameAccountUpsert) UpdateMid() *GameAccountUpsert

UpdateMid sets the "mid" field to the value that was provided on create.

func (*GameAccountUpsert) UpdateStoken

func (u *GameAccountUpsert) UpdateStoken() *GameAccountUpsert

UpdateStoken sets the "stoken" field to the value that was provided on create.

func (*GameAccountUpsert) UpdateUpdateAt

func (u *GameAccountUpsert) UpdateUpdateAt() *GameAccountUpsert

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*GameAccountUpsert) UpdateUserID

func (u *GameAccountUpsert) UpdateUserID() *GameAccountUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type GameAccountUpsertBulk

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

GameAccountUpsertBulk is the builder for "upsert"-ing a bulk of GameAccount nodes.

func (*GameAccountUpsertBulk) AddUserID

AddUserID adds v to the "user_id" field.

func (*GameAccountUpsertBulk) DoNothing

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

func (*GameAccountUpsertBulk) Exec

Exec executes the query.

func (*GameAccountUpsertBulk) ExecX

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

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

func (*GameAccountUpsertBulk) Ignore

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

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

func (*GameAccountUpsertBulk) SetAccountID

SetAccountID sets the "account_id" field.

func (*GameAccountUpsertBulk) SetCookieToken

func (u *GameAccountUpsertBulk) SetCookieToken(v string) *GameAccountUpsertBulk

SetCookieToken sets the "cookie_token" field.

func (*GameAccountUpsertBulk) SetGameToken

SetGameToken sets the "game_token" field.

func (*GameAccountUpsertBulk) SetMid

SetMid sets the "mid" field.

func (*GameAccountUpsertBulk) SetStoken

SetStoken sets the "stoken" field.

func (*GameAccountUpsertBulk) SetUpdateAt

SetUpdateAt sets the "update_at" field.

func (*GameAccountUpsertBulk) SetUserID

SetUserID sets the "user_id" field.

func (*GameAccountUpsertBulk) Update

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

func (*GameAccountUpsertBulk) UpdateAccountID

func (u *GameAccountUpsertBulk) UpdateAccountID() *GameAccountUpsertBulk

UpdateAccountID sets the "account_id" field to the value that was provided on create.

func (*GameAccountUpsertBulk) UpdateCookieToken

func (u *GameAccountUpsertBulk) UpdateCookieToken() *GameAccountUpsertBulk

UpdateCookieToken sets the "cookie_token" field to the value that was provided on create.

func (*GameAccountUpsertBulk) UpdateGameToken

func (u *GameAccountUpsertBulk) UpdateGameToken() *GameAccountUpsertBulk

UpdateGameToken sets the "game_token" field to the value that was provided on create.

func (*GameAccountUpsertBulk) UpdateMid

UpdateMid sets the "mid" field to the value that was provided on create.

func (*GameAccountUpsertBulk) UpdateNewValues

func (u *GameAccountUpsertBulk) UpdateNewValues() *GameAccountUpsertBulk

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

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

func (*GameAccountUpsertBulk) UpdateStoken

func (u *GameAccountUpsertBulk) UpdateStoken() *GameAccountUpsertBulk

UpdateStoken sets the "stoken" field to the value that was provided on create.

func (*GameAccountUpsertBulk) UpdateUpdateAt

func (u *GameAccountUpsertBulk) UpdateUpdateAt() *GameAccountUpsertBulk

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*GameAccountUpsertBulk) UpdateUserID

func (u *GameAccountUpsertBulk) UpdateUserID() *GameAccountUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

type GameAccountUpsertOne

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

GameAccountUpsertOne is the builder for "upsert"-ing

one GameAccount node.

func (*GameAccountUpsertOne) AddUserID

AddUserID adds v to the "user_id" field.

func (*GameAccountUpsertOne) DoNothing

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

func (*GameAccountUpsertOne) Exec

Exec executes the query.

func (*GameAccountUpsertOne) ExecX

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

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

func (*GameAccountUpsertOne) ID

func (u *GameAccountUpsertOne) ID(ctx context.Context) (id int64, err error)

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

func (*GameAccountUpsertOne) IDX

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

func (*GameAccountUpsertOne) Ignore

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

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

func (*GameAccountUpsertOne) SetAccountID

func (u *GameAccountUpsertOne) SetAccountID(v string) *GameAccountUpsertOne

SetAccountID sets the "account_id" field.

func (*GameAccountUpsertOne) SetCookieToken

func (u *GameAccountUpsertOne) SetCookieToken(v string) *GameAccountUpsertOne

SetCookieToken sets the "cookie_token" field.

func (*GameAccountUpsertOne) SetGameToken

func (u *GameAccountUpsertOne) SetGameToken(v string) *GameAccountUpsertOne

SetGameToken sets the "game_token" field.

func (*GameAccountUpsertOne) SetMid

SetMid sets the "mid" field.

func (*GameAccountUpsertOne) SetStoken

SetStoken sets the "stoken" field.

func (*GameAccountUpsertOne) SetUpdateAt

SetUpdateAt sets the "update_at" field.

func (*GameAccountUpsertOne) SetUserID

SetUserID sets the "user_id" field.

func (*GameAccountUpsertOne) Update

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

func (*GameAccountUpsertOne) UpdateAccountID

func (u *GameAccountUpsertOne) UpdateAccountID() *GameAccountUpsertOne

UpdateAccountID sets the "account_id" field to the value that was provided on create.

func (*GameAccountUpsertOne) UpdateCookieToken

func (u *GameAccountUpsertOne) UpdateCookieToken() *GameAccountUpsertOne

UpdateCookieToken sets the "cookie_token" field to the value that was provided on create.

func (*GameAccountUpsertOne) UpdateGameToken

func (u *GameAccountUpsertOne) UpdateGameToken() *GameAccountUpsertOne

UpdateGameToken sets the "game_token" field to the value that was provided on create.

func (*GameAccountUpsertOne) UpdateMid

UpdateMid sets the "mid" field to the value that was provided on create.

func (*GameAccountUpsertOne) UpdateNewValues

func (u *GameAccountUpsertOne) UpdateNewValues() *GameAccountUpsertOne

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

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

func (*GameAccountUpsertOne) UpdateStoken

func (u *GameAccountUpsertOne) UpdateStoken() *GameAccountUpsertOne

UpdateStoken sets the "stoken" field to the value that was provided on create.

func (*GameAccountUpsertOne) UpdateUpdateAt

func (u *GameAccountUpsertOne) UpdateUpdateAt() *GameAccountUpsertOne

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*GameAccountUpsertOne) UpdateUserID

func (u *GameAccountUpsertOne) UpdateUserID() *GameAccountUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type GameAccounts

type GameAccounts []*GameAccount

GameAccounts is a parsable slice of GameAccount.

type GameRole

type GameRole struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int64 `json:"user_id,omitempty"`
	// AccountID holds the value of the "account_id" field.
	AccountID string `json:"account_id,omitempty"`
	// RoleID holds the value of the "role_id" field.
	RoleID string `json:"role_id,omitempty"`
	// Level holds the value of the "level" field.
	Level int `json:"level,omitempty"`
	// Region holds the value of the "region" field.
	Region string `json:"region,omitempty"`
	// RegionName holds the value of the "region_name" field.
	RegionName string `json:"region_name,omitempty"`
	// NickName holds the value of the "nick_name" field.
	NickName string `json:"nick_name,omitempty"`
	// CreateAt holds the value of the "create_at" field.
	CreateAt time.Time `json:"create_at,omitempty"`
	// UpdateAt holds the value of the "update_at" field.
	UpdateAt time.Time `json:"update_at,omitempty"`
	// contains filtered or unexported fields
}

GameRole is the model entity for the GameRole schema.

func (*GameRole) ExecContext

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

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

func (*GameRole) QueryContext

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

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

func (*GameRole) String

func (gr *GameRole) String() string

String implements the fmt.Stringer.

func (*GameRole) Unwrap

func (gr *GameRole) Unwrap() *GameRole

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

func (gr *GameRole) Update() *GameRoleUpdateOne

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

type GameRoleAttribute

type GameRoleAttribute struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int64 `json:"user_id,omitempty"`
	// AccountID holds the value of the "account_id" field.
	AccountID string `json:"account_id,omitempty"`
	// RoleID holds the value of the "role_id" field.
	RoleID string `json:"role_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Type holds the value of the "type" field.
	Type int `json:"type,omitempty"`
	// Value holds the value of the "value" field.
	Value string `json:"value,omitempty"`
	// CreateAt holds the value of the "create_at" field.
	CreateAt time.Time `json:"create_at,omitempty"`
	// UpdateAt holds the value of the "update_at" field.
	UpdateAt time.Time `json:"update_at,omitempty"`
	// contains filtered or unexported fields
}

GameRoleAttribute is the model entity for the GameRoleAttribute schema.

func (*GameRoleAttribute) ExecContext

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

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

func (*GameRoleAttribute) QueryContext

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

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

func (*GameRoleAttribute) String

func (gra *GameRoleAttribute) String() string

String implements the fmt.Stringer.

func (*GameRoleAttribute) Unwrap

func (gra *GameRoleAttribute) Unwrap() *GameRoleAttribute

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

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

type GameRoleAttributeClient

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

GameRoleAttributeClient is a client for the GameRoleAttribute schema.

func NewGameRoleAttributeClient

func NewGameRoleAttributeClient(c config) *GameRoleAttributeClient

NewGameRoleAttributeClient returns a client for the GameRoleAttribute from the given config.

func (*GameRoleAttributeClient) Create

Create returns a builder for creating a GameRoleAttribute entity.

func (*GameRoleAttributeClient) CreateBulk

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

func (*GameRoleAttributeClient) Delete

Delete returns a delete builder for GameRoleAttribute.

func (*GameRoleAttributeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GameRoleAttributeClient) DeleteOneID

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

func (*GameRoleAttributeClient) ExecContext

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

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

func (*GameRoleAttributeClient) Get

Get returns a GameRoleAttribute entity by its id.

func (*GameRoleAttributeClient) GetX

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

func (*GameRoleAttributeClient) Hooks

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

Hooks returns the client hooks.

func (*GameRoleAttributeClient) Intercept

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

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

func (*GameRoleAttributeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GameRoleAttributeClient) Query

Query returns a query builder for GameRoleAttribute.

func (*GameRoleAttributeClient) QueryContext

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

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

func (*GameRoleAttributeClient) Update

Update returns an update builder for GameRoleAttribute.

func (*GameRoleAttributeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*GameRoleAttributeClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*GameRoleAttributeClient) Use

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

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

type GameRoleAttributeCreate

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

GameRoleAttributeCreate is the builder for creating a GameRoleAttribute entity.

func (*GameRoleAttributeCreate) Exec

func (grac *GameRoleAttributeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GameRoleAttributeCreate) ExecContext

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

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

func (*GameRoleAttributeCreate) ExecX

func (grac *GameRoleAttributeCreate) ExecX(ctx context.Context)

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

func (*GameRoleAttributeCreate) Mutation

Mutation returns the GameRoleAttributeMutation object of the builder.

func (*GameRoleAttributeCreate) OnConflict

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

client.GameRoleAttribute.Create().
	SetUserID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GameRoleAttributeUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*GameRoleAttributeCreate) OnConflictColumns

func (grac *GameRoleAttributeCreate) OnConflictColumns(columns ...string) *GameRoleAttributeUpsertOne

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

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

func (*GameRoleAttributeCreate) QueryContext

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

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

func (*GameRoleAttributeCreate) Save

Save creates the GameRoleAttribute in the database.

func (*GameRoleAttributeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*GameRoleAttributeCreate) SetAccountID

SetAccountID sets the "account_id" field.

func (*GameRoleAttributeCreate) SetCreateAt

SetCreateAt sets the "create_at" field.

func (*GameRoleAttributeCreate) SetID

SetID sets the "id" field.

func (*GameRoleAttributeCreate) SetName

SetName sets the "name" field.

func (*GameRoleAttributeCreate) SetNillableCreateAt

func (grac *GameRoleAttributeCreate) SetNillableCreateAt(t *time.Time) *GameRoleAttributeCreate

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

func (*GameRoleAttributeCreate) SetNillableType

func (grac *GameRoleAttributeCreate) SetNillableType(i *int) *GameRoleAttributeCreate

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

func (*GameRoleAttributeCreate) SetNillableUpdateAt

func (grac *GameRoleAttributeCreate) SetNillableUpdateAt(t *time.Time) *GameRoleAttributeCreate

SetNillableUpdateAt sets the "update_at" field if the given value is not nil.

func (*GameRoleAttributeCreate) SetNillableValue

func (grac *GameRoleAttributeCreate) SetNillableValue(s *string) *GameRoleAttributeCreate

SetNillableValue sets the "value" field if the given value is not nil.

func (*GameRoleAttributeCreate) SetRoleID

SetRoleID sets the "role_id" field.

func (*GameRoleAttributeCreate) SetType

SetType sets the "type" field.

func (*GameRoleAttributeCreate) SetUpdateAt

SetUpdateAt sets the "update_at" field.

func (*GameRoleAttributeCreate) SetUserID

SetUserID sets the "user_id" field.

func (*GameRoleAttributeCreate) SetValue

SetValue sets the "value" field.

type GameRoleAttributeCreateBulk

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

GameRoleAttributeCreateBulk is the builder for creating many GameRoleAttribute entities in bulk.

func (*GameRoleAttributeCreateBulk) Exec

Exec executes the query.

func (*GameRoleAttributeCreateBulk) ExecContext

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

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

func (*GameRoleAttributeCreateBulk) ExecX

func (gracb *GameRoleAttributeCreateBulk) ExecX(ctx context.Context)

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

func (*GameRoleAttributeCreateBulk) OnConflict

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

client.GameRoleAttribute.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GameRoleAttributeUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*GameRoleAttributeCreateBulk) OnConflictColumns

func (gracb *GameRoleAttributeCreateBulk) OnConflictColumns(columns ...string) *GameRoleAttributeUpsertBulk

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

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

func (*GameRoleAttributeCreateBulk) QueryContext

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

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

func (*GameRoleAttributeCreateBulk) Save

Save creates the GameRoleAttribute entities in the database.

func (*GameRoleAttributeCreateBulk) SaveX

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

type GameRoleAttributeDelete

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

GameRoleAttributeDelete is the builder for deleting a GameRoleAttribute entity.

func (*GameRoleAttributeDelete) Exec

func (grad *GameRoleAttributeDelete) Exec(ctx context.Context) (int, error)

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

func (*GameRoleAttributeDelete) ExecContext

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

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

func (*GameRoleAttributeDelete) ExecX

func (grad *GameRoleAttributeDelete) ExecX(ctx context.Context) int

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

func (*GameRoleAttributeDelete) QueryContext

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

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

func (*GameRoleAttributeDelete) Where

Where appends a list predicates to the GameRoleAttributeDelete builder.

type GameRoleAttributeDeleteOne

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

GameRoleAttributeDeleteOne is the builder for deleting a single GameRoleAttribute entity.

func (*GameRoleAttributeDeleteOne) Exec

Exec executes the deletion query.

func (*GameRoleAttributeDeleteOne) ExecX

func (grado *GameRoleAttributeDeleteOne) ExecX(ctx context.Context)

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

func (*GameRoleAttributeDeleteOne) Where

Where appends a list predicates to the GameRoleAttributeDelete builder.

type GameRoleAttributeGroupBy

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

GameRoleAttributeGroupBy is the group-by builder for GameRoleAttribute entities.

func (*GameRoleAttributeGroupBy) Aggregate

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

func (*GameRoleAttributeGroupBy) Bool

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

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

func (*GameRoleAttributeGroupBy) BoolX

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

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

func (*GameRoleAttributeGroupBy) Bools

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

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

func (*GameRoleAttributeGroupBy) BoolsX

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

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

func (*GameRoleAttributeGroupBy) Float64

func (s *GameRoleAttributeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeGroupBy) Float64X

func (s *GameRoleAttributeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GameRoleAttributeGroupBy) Float64s

func (s *GameRoleAttributeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeGroupBy) Float64sX

func (s *GameRoleAttributeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GameRoleAttributeGroupBy) Int

func (s *GameRoleAttributeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeGroupBy) IntX

func (s *GameRoleAttributeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GameRoleAttributeGroupBy) Ints

func (s *GameRoleAttributeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeGroupBy) IntsX

func (s *GameRoleAttributeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GameRoleAttributeGroupBy) Scan

func (gragb *GameRoleAttributeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GameRoleAttributeGroupBy) ScanX

func (s *GameRoleAttributeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GameRoleAttributeGroupBy) String

func (s *GameRoleAttributeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeGroupBy) StringX

func (s *GameRoleAttributeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GameRoleAttributeGroupBy) Strings

func (s *GameRoleAttributeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeGroupBy) StringsX

func (s *GameRoleAttributeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GameRoleAttributeMutation

type GameRoleAttributeMutation struct {
	// contains filtered or unexported fields
}

GameRoleAttributeMutation represents an operation that mutates the GameRoleAttribute nodes in the graph.

func (*GameRoleAttributeMutation) AccountID

func (m *GameRoleAttributeMutation) AccountID() (r string, exists bool)

AccountID returns the value of the "account_id" field in the mutation.

func (*GameRoleAttributeMutation) AddField

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) AddType

func (m *GameRoleAttributeMutation) AddType(i int)

AddType adds i to the "type" field.

func (*GameRoleAttributeMutation) AddUserID

func (m *GameRoleAttributeMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*GameRoleAttributeMutation) AddedEdges

func (m *GameRoleAttributeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GameRoleAttributeMutation) AddedField

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) AddedFields

func (m *GameRoleAttributeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GameRoleAttributeMutation) AddedIDs

func (m *GameRoleAttributeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GameRoleAttributeMutation) AddedType

func (m *GameRoleAttributeMutation) AddedType() (r int, exists bool)

AddedType returns the value that was added to the "type" field in this mutation.

func (*GameRoleAttributeMutation) AddedUserID

func (m *GameRoleAttributeMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*GameRoleAttributeMutation) ClearEdge

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) ClearField

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) ClearedEdges

func (m *GameRoleAttributeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GameRoleAttributeMutation) ClearedFields

func (m *GameRoleAttributeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GameRoleAttributeMutation) Client

func (m GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) CreateAt

func (m *GameRoleAttributeMutation) CreateAt() (r time.Time, exists bool)

CreateAt returns the value of the "create_at" field in the mutation.

func (*GameRoleAttributeMutation) EdgeCleared

func (m *GameRoleAttributeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GameRoleAttributeMutation) ExecContext

func (c *GameRoleAttributeMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleAttributeMutation) Field

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) FieldCleared

func (m *GameRoleAttributeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GameRoleAttributeMutation) Fields

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) GetType

func (m *GameRoleAttributeMutation) GetType() (r int, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*GameRoleAttributeMutation) ID

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) Name

func (m *GameRoleAttributeMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*GameRoleAttributeMutation) OldAccountID

func (m *GameRoleAttributeMutation) OldAccountID(ctx context.Context) (v string, err error)

OldAccountID returns the old "account_id" field's value of the GameRoleAttribute entity. If the GameRoleAttribute 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 (*GameRoleAttributeMutation) OldCreateAt

func (m *GameRoleAttributeMutation) OldCreateAt(ctx context.Context) (v time.Time, err error)

OldCreateAt returns the old "create_at" field's value of the GameRoleAttribute entity. If the GameRoleAttribute 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 (*GameRoleAttributeMutation) OldField

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) OldName

func (m *GameRoleAttributeMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the GameRoleAttribute entity. If the GameRoleAttribute 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 (*GameRoleAttributeMutation) OldRoleID

func (m *GameRoleAttributeMutation) OldRoleID(ctx context.Context) (v string, err error)

OldRoleID returns the old "role_id" field's value of the GameRoleAttribute entity. If the GameRoleAttribute 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 (*GameRoleAttributeMutation) OldType

func (m *GameRoleAttributeMutation) OldType(ctx context.Context) (v int, err error)

OldType returns the old "type" field's value of the GameRoleAttribute entity. If the GameRoleAttribute 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 (*GameRoleAttributeMutation) OldUpdateAt

func (m *GameRoleAttributeMutation) OldUpdateAt(ctx context.Context) (v time.Time, err error)

OldUpdateAt returns the old "update_at" field's value of the GameRoleAttribute entity. If the GameRoleAttribute 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 (*GameRoleAttributeMutation) OldUserID

func (m *GameRoleAttributeMutation) OldUserID(ctx context.Context) (v int64, err error)

OldUserID returns the old "user_id" field's value of the GameRoleAttribute entity. If the GameRoleAttribute 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 (*GameRoleAttributeMutation) OldValue

func (m *GameRoleAttributeMutation) OldValue(ctx context.Context) (v string, err error)

OldValue returns the old "value" field's value of the GameRoleAttribute entity. If the GameRoleAttribute 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 (*GameRoleAttributeMutation) Op

func (m *GameRoleAttributeMutation) Op() Op

Op returns the operation name.

func (*GameRoleAttributeMutation) QueryContext

func (c *GameRoleAttributeMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleAttributeMutation) RemovedEdges

func (m *GameRoleAttributeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GameRoleAttributeMutation) RemovedIDs

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) ResetAccountID

func (m *GameRoleAttributeMutation) ResetAccountID()

ResetAccountID resets all changes to the "account_id" field.

func (*GameRoleAttributeMutation) ResetCreateAt

func (m *GameRoleAttributeMutation) ResetCreateAt()

ResetCreateAt resets all changes to the "create_at" field.

func (*GameRoleAttributeMutation) ResetEdge

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) ResetField

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) ResetName

func (m *GameRoleAttributeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*GameRoleAttributeMutation) ResetRoleID

func (m *GameRoleAttributeMutation) ResetRoleID()

ResetRoleID resets all changes to the "role_id" field.

func (*GameRoleAttributeMutation) ResetType

func (m *GameRoleAttributeMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*GameRoleAttributeMutation) ResetUpdateAt

func (m *GameRoleAttributeMutation) ResetUpdateAt()

ResetUpdateAt resets all changes to the "update_at" field.

func (*GameRoleAttributeMutation) ResetUserID

func (m *GameRoleAttributeMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*GameRoleAttributeMutation) ResetValue

func (m *GameRoleAttributeMutation) ResetValue()

ResetValue resets all changes to the "value" field.

func (*GameRoleAttributeMutation) RoleID

func (m *GameRoleAttributeMutation) RoleID() (r string, exists bool)

RoleID returns the value of the "role_id" field in the mutation.

func (*GameRoleAttributeMutation) SetAccountID

func (m *GameRoleAttributeMutation) SetAccountID(s string)

SetAccountID sets the "account_id" field.

func (*GameRoleAttributeMutation) SetCreateAt

func (m *GameRoleAttributeMutation) SetCreateAt(t time.Time)

SetCreateAt sets the "create_at" field.

func (*GameRoleAttributeMutation) SetField

func (m *GameRoleAttributeMutation) 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 (*GameRoleAttributeMutation) SetID

func (m *GameRoleAttributeMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of GameRoleAttribute entities.

func (*GameRoleAttributeMutation) SetName

func (m *GameRoleAttributeMutation) SetName(s string)

SetName sets the "name" field.

func (*GameRoleAttributeMutation) SetOp

func (m *GameRoleAttributeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GameRoleAttributeMutation) SetRoleID

func (m *GameRoleAttributeMutation) SetRoleID(s string)

SetRoleID sets the "role_id" field.

func (*GameRoleAttributeMutation) SetType

func (m *GameRoleAttributeMutation) SetType(i int)

SetType sets the "type" field.

func (*GameRoleAttributeMutation) SetUpdateAt

func (m *GameRoleAttributeMutation) SetUpdateAt(t time.Time)

SetUpdateAt sets the "update_at" field.

func (*GameRoleAttributeMutation) SetUserID

func (m *GameRoleAttributeMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (*GameRoleAttributeMutation) SetValue

func (m *GameRoleAttributeMutation) SetValue(s string)

SetValue sets the "value" field.

func (GameRoleAttributeMutation) Tx

func (m GameRoleAttributeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GameRoleAttributeMutation) Type

Type returns the node type of this mutation (GameRoleAttribute).

func (*GameRoleAttributeMutation) UpdateAt

func (m *GameRoleAttributeMutation) UpdateAt() (r time.Time, exists bool)

UpdateAt returns the value of the "update_at" field in the mutation.

func (*GameRoleAttributeMutation) UserID

func (m *GameRoleAttributeMutation) UserID() (r int64, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*GameRoleAttributeMutation) Value

func (m *GameRoleAttributeMutation) Value() (r string, exists bool)

Value returns the value of the "value" field in the mutation.

func (*GameRoleAttributeMutation) Where

Where appends a list predicates to the GameRoleAttributeMutation builder.

func (*GameRoleAttributeMutation) WhereP

func (m *GameRoleAttributeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GameRoleAttributeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GameRoleAttributeQuery

type GameRoleAttributeQuery struct {
	// contains filtered or unexported fields
}

GameRoleAttributeQuery is the builder for querying GameRoleAttribute entities.

func (*GameRoleAttributeQuery) Aggregate

Aggregate returns a GameRoleAttributeSelect configured with the given aggregations.

func (*GameRoleAttributeQuery) All

All executes the query and returns a list of GameRoleAttributes.

func (*GameRoleAttributeQuery) AllX

AllX is like All, but panics if an error occurs.

func (*GameRoleAttributeQuery) Clone

Clone returns a duplicate of the GameRoleAttributeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GameRoleAttributeQuery) Count

func (graq *GameRoleAttributeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GameRoleAttributeQuery) CountX

func (graq *GameRoleAttributeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GameRoleAttributeQuery) ExecContext

func (c *GameRoleAttributeQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleAttributeQuery) Exist

func (graq *GameRoleAttributeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GameRoleAttributeQuery) ExistX

func (graq *GameRoleAttributeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GameRoleAttributeQuery) First

First returns the first GameRoleAttribute entity from the query. Returns a *NotFoundError when no GameRoleAttribute was found.

func (*GameRoleAttributeQuery) FirstID

func (graq *GameRoleAttributeQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first GameRoleAttribute ID from the query. Returns a *NotFoundError when no GameRoleAttribute ID was found.

func (*GameRoleAttributeQuery) FirstIDX

func (graq *GameRoleAttributeQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*GameRoleAttributeQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*GameRoleAttributeQuery) ForShare

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*GameRoleAttributeQuery) ForUpdate

func (graq *GameRoleAttributeQuery) ForUpdate(opts ...sql.LockOption) *GameRoleAttributeQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*GameRoleAttributeQuery) GroupBy

func (graq *GameRoleAttributeQuery) GroupBy(field string, fields ...string) *GameRoleAttributeGroupBy

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 {
	UserID int64 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GameRoleAttribute.Query().
	GroupBy(gameroleattribute.FieldUserID).
	Aggregate(entity.Count()).
	Scan(ctx, &v)

func (*GameRoleAttributeQuery) IDs

func (graq *GameRoleAttributeQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of GameRoleAttribute IDs.

func (*GameRoleAttributeQuery) IDsX

func (graq *GameRoleAttributeQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*GameRoleAttributeQuery) Limit

Limit the number of records to be returned by this query.

func (*GameRoleAttributeQuery) Modify

func (graq *GameRoleAttributeQuery) Modify(modifiers ...func(s *sql.Selector)) *GameRoleAttributeSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*GameRoleAttributeQuery) Offset

func (graq *GameRoleAttributeQuery) Offset(offset int) *GameRoleAttributeQuery

Offset to start from.

func (*GameRoleAttributeQuery) Only

Only returns a single GameRoleAttribute entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GameRoleAttribute entity is found. Returns a *NotFoundError when no GameRoleAttribute entities are found.

func (*GameRoleAttributeQuery) OnlyID

func (graq *GameRoleAttributeQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only GameRoleAttribute ID in the query. Returns a *NotSingularError when more than one GameRoleAttribute ID is found. Returns a *NotFoundError when no entities are found.

func (*GameRoleAttributeQuery) OnlyIDX

func (graq *GameRoleAttributeQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GameRoleAttributeQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*GameRoleAttributeQuery) Order

Order specifies how the records should be ordered.

func (*GameRoleAttributeQuery) QueryContext

func (c *GameRoleAttributeQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleAttributeQuery) Select

func (graq *GameRoleAttributeQuery) Select(fields ...string) *GameRoleAttributeSelect

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 {
	UserID int64 `json:"user_id,omitempty"`
}

client.GameRoleAttribute.Query().
	Select(gameroleattribute.FieldUserID).
	Scan(ctx, &v)

func (*GameRoleAttributeQuery) Unique

func (graq *GameRoleAttributeQuery) Unique(unique bool) *GameRoleAttributeQuery

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 (*GameRoleAttributeQuery) Where

Where adds a new predicate for the GameRoleAttributeQuery builder.

type GameRoleAttributeSelect

type GameRoleAttributeSelect struct {
	*GameRoleAttributeQuery
	// contains filtered or unexported fields
}

GameRoleAttributeSelect is the builder for selecting fields of GameRoleAttribute entities.

func (*GameRoleAttributeSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*GameRoleAttributeSelect) Bool

func (s *GameRoleAttributeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeSelect) BoolX

func (s *GameRoleAttributeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GameRoleAttributeSelect) Bools

func (s *GameRoleAttributeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeSelect) BoolsX

func (s *GameRoleAttributeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (GameRoleAttributeSelect) ExecContext

func (c GameRoleAttributeSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleAttributeSelect) Float64

func (s *GameRoleAttributeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeSelect) Float64X

func (s *GameRoleAttributeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GameRoleAttributeSelect) Float64s

func (s *GameRoleAttributeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeSelect) Float64sX

func (s *GameRoleAttributeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GameRoleAttributeSelect) Int

func (s *GameRoleAttributeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeSelect) IntX

func (s *GameRoleAttributeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GameRoleAttributeSelect) Ints

func (s *GameRoleAttributeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeSelect) IntsX

func (s *GameRoleAttributeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GameRoleAttributeSelect) Modify

func (gras *GameRoleAttributeSelect) Modify(modifiers ...func(s *sql.Selector)) *GameRoleAttributeSelect

Modify adds a query modifier for attaching custom logic to queries.

func (GameRoleAttributeSelect) QueryContext

func (c GameRoleAttributeSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleAttributeSelect) Scan

func (gras *GameRoleAttributeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GameRoleAttributeSelect) ScanX

func (s *GameRoleAttributeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GameRoleAttributeSelect) String

func (s *GameRoleAttributeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeSelect) StringX

func (s *GameRoleAttributeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GameRoleAttributeSelect) Strings

func (s *GameRoleAttributeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GameRoleAttributeSelect) StringsX

func (s *GameRoleAttributeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GameRoleAttributeUpdate

type GameRoleAttributeUpdate struct {
	// contains filtered or unexported fields
}

GameRoleAttributeUpdate is the builder for updating GameRoleAttribute entities.

func (*GameRoleAttributeUpdate) AddType

AddType adds i to the "type" field.

func (*GameRoleAttributeUpdate) AddUserID

AddUserID adds i to the "user_id" field.

func (*GameRoleAttributeUpdate) Exec

func (grau *GameRoleAttributeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GameRoleAttributeUpdate) ExecContext

func (c *GameRoleAttributeUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleAttributeUpdate) ExecX

func (grau *GameRoleAttributeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleAttributeUpdate) Modify

func (grau *GameRoleAttributeUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *GameRoleAttributeUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*GameRoleAttributeUpdate) Mutation

Mutation returns the GameRoleAttributeMutation object of the builder.

func (*GameRoleAttributeUpdate) QueryContext

func (c *GameRoleAttributeUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleAttributeUpdate) Save

func (grau *GameRoleAttributeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GameRoleAttributeUpdate) SaveX

func (grau *GameRoleAttributeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GameRoleAttributeUpdate) SetAccountID

SetAccountID sets the "account_id" field.

func (*GameRoleAttributeUpdate) SetName

SetName sets the "name" field.

func (*GameRoleAttributeUpdate) SetNillableType

func (grau *GameRoleAttributeUpdate) SetNillableType(i *int) *GameRoleAttributeUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*GameRoleAttributeUpdate) SetNillableValue

func (grau *GameRoleAttributeUpdate) SetNillableValue(s *string) *GameRoleAttributeUpdate

SetNillableValue sets the "value" field if the given value is not nil.

func (*GameRoleAttributeUpdate) SetRoleID

SetRoleID sets the "role_id" field.

func (*GameRoleAttributeUpdate) SetType

SetType sets the "type" field.

func (*GameRoleAttributeUpdate) SetUpdateAt

SetUpdateAt sets the "update_at" field.

func (*GameRoleAttributeUpdate) SetUserID

SetUserID sets the "user_id" field.

func (*GameRoleAttributeUpdate) SetValue

SetValue sets the "value" field.

func (*GameRoleAttributeUpdate) Where

Where appends a list predicates to the GameRoleAttributeUpdate builder.

type GameRoleAttributeUpdateOne

type GameRoleAttributeUpdateOne struct {
	// contains filtered or unexported fields
}

GameRoleAttributeUpdateOne is the builder for updating a single GameRoleAttribute entity.

func (*GameRoleAttributeUpdateOne) AddType

AddType adds i to the "type" field.

func (*GameRoleAttributeUpdateOne) AddUserID

AddUserID adds i to the "user_id" field.

func (*GameRoleAttributeUpdateOne) Exec

Exec executes the query on the entity.

func (*GameRoleAttributeUpdateOne) ExecContext

func (c *GameRoleAttributeUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleAttributeUpdateOne) ExecX

func (grauo *GameRoleAttributeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleAttributeUpdateOne) Modify

func (grauo *GameRoleAttributeUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *GameRoleAttributeUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*GameRoleAttributeUpdateOne) Mutation

Mutation returns the GameRoleAttributeMutation object of the builder.

func (*GameRoleAttributeUpdateOne) QueryContext

func (c *GameRoleAttributeUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleAttributeUpdateOne) Save

Save executes the query and returns the updated GameRoleAttribute entity.

func (*GameRoleAttributeUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*GameRoleAttributeUpdateOne) Select

func (grauo *GameRoleAttributeUpdateOne) Select(field string, fields ...string) *GameRoleAttributeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GameRoleAttributeUpdateOne) SetAccountID

SetAccountID sets the "account_id" field.

func (*GameRoleAttributeUpdateOne) SetName

SetName sets the "name" field.

func (*GameRoleAttributeUpdateOne) SetNillableType

func (grauo *GameRoleAttributeUpdateOne) SetNillableType(i *int) *GameRoleAttributeUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*GameRoleAttributeUpdateOne) SetNillableValue

func (grauo *GameRoleAttributeUpdateOne) SetNillableValue(s *string) *GameRoleAttributeUpdateOne

SetNillableValue sets the "value" field if the given value is not nil.

func (*GameRoleAttributeUpdateOne) SetRoleID

SetRoleID sets the "role_id" field.

func (*GameRoleAttributeUpdateOne) SetType

SetType sets the "type" field.

func (*GameRoleAttributeUpdateOne) SetUpdateAt

SetUpdateAt sets the "update_at" field.

func (*GameRoleAttributeUpdateOne) SetUserID

SetUserID sets the "user_id" field.

func (*GameRoleAttributeUpdateOne) SetValue

SetValue sets the "value" field.

func (*GameRoleAttributeUpdateOne) Where

Where appends a list predicates to the GameRoleAttributeUpdate builder.

type GameRoleAttributeUpsert

type GameRoleAttributeUpsert struct {
	*sql.UpdateSet
}

GameRoleAttributeUpsert is the "OnConflict" setter.

func (*GameRoleAttributeUpsert) AddType

AddType adds v to the "type" field.

func (*GameRoleAttributeUpsert) AddUserID

AddUserID adds v to the "user_id" field.

func (*GameRoleAttributeUpsert) SetAccountID

SetAccountID sets the "account_id" field.

func (*GameRoleAttributeUpsert) SetName

SetName sets the "name" field.

func (*GameRoleAttributeUpsert) SetRoleID

SetRoleID sets the "role_id" field.

func (*GameRoleAttributeUpsert) SetType

SetType sets the "type" field.

func (*GameRoleAttributeUpsert) SetUpdateAt

SetUpdateAt sets the "update_at" field.

func (*GameRoleAttributeUpsert) SetUserID

SetUserID sets the "user_id" field.

func (*GameRoleAttributeUpsert) SetValue

SetValue sets the "value" field.

func (*GameRoleAttributeUpsert) UpdateAccountID

func (u *GameRoleAttributeUpsert) UpdateAccountID() *GameRoleAttributeUpsert

UpdateAccountID sets the "account_id" field to the value that was provided on create.

func (*GameRoleAttributeUpsert) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*GameRoleAttributeUpsert) UpdateRoleID

UpdateRoleID sets the "role_id" field to the value that was provided on create.

func (*GameRoleAttributeUpsert) UpdateType

UpdateType sets the "type" field to the value that was provided on create.

func (*GameRoleAttributeUpsert) UpdateUpdateAt

func (u *GameRoleAttributeUpsert) UpdateUpdateAt() *GameRoleAttributeUpsert

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*GameRoleAttributeUpsert) UpdateUserID

UpdateUserID sets the "user_id" field to the value that was provided on create.

func (*GameRoleAttributeUpsert) UpdateValue

UpdateValue sets the "value" field to the value that was provided on create.

type GameRoleAttributeUpsertBulk

type GameRoleAttributeUpsertBulk struct {
	// contains filtered or unexported fields
}

GameRoleAttributeUpsertBulk is the builder for "upsert"-ing a bulk of GameRoleAttribute nodes.

func (*GameRoleAttributeUpsertBulk) AddType

AddType adds v to the "type" field.

func (*GameRoleAttributeUpsertBulk) AddUserID

AddUserID adds v to the "user_id" field.

func (*GameRoleAttributeUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GameRoleAttributeUpsertBulk) Exec

Exec executes the query.

func (*GameRoleAttributeUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleAttributeUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GameRoleAttribute.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*GameRoleAttributeUpsertBulk) SetAccountID

SetAccountID sets the "account_id" field.

func (*GameRoleAttributeUpsertBulk) SetName

SetName sets the "name" field.

func (*GameRoleAttributeUpsertBulk) SetRoleID

SetRoleID sets the "role_id" field.

func (*GameRoleAttributeUpsertBulk) SetType

SetType sets the "type" field.

func (*GameRoleAttributeUpsertBulk) SetUpdateAt

SetUpdateAt sets the "update_at" field.

func (*GameRoleAttributeUpsertBulk) SetUserID

SetUserID sets the "user_id" field.

func (*GameRoleAttributeUpsertBulk) SetValue

SetValue sets the "value" field.

func (*GameRoleAttributeUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the GameRoleAttributeCreateBulk.OnConflict documentation for more info.

func (*GameRoleAttributeUpsertBulk) UpdateAccountID

UpdateAccountID sets the "account_id" field to the value that was provided on create.

func (*GameRoleAttributeUpsertBulk) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*GameRoleAttributeUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.GameRoleAttribute.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(gameroleattribute.FieldID)
		}),
	).
	Exec(ctx)

func (*GameRoleAttributeUpsertBulk) UpdateRoleID

UpdateRoleID sets the "role_id" field to the value that was provided on create.

func (*GameRoleAttributeUpsertBulk) UpdateType

UpdateType sets the "type" field to the value that was provided on create.

func (*GameRoleAttributeUpsertBulk) UpdateUpdateAt

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*GameRoleAttributeUpsertBulk) UpdateUserID

UpdateUserID sets the "user_id" field to the value that was provided on create.

func (*GameRoleAttributeUpsertBulk) UpdateValue

UpdateValue sets the "value" field to the value that was provided on create.

type GameRoleAttributeUpsertOne

type GameRoleAttributeUpsertOne struct {
	// contains filtered or unexported fields
}

GameRoleAttributeUpsertOne is the builder for "upsert"-ing

one GameRoleAttribute node.

func (*GameRoleAttributeUpsertOne) AddType

AddType adds v to the "type" field.

func (*GameRoleAttributeUpsertOne) AddUserID

AddUserID adds v to the "user_id" field.

func (*GameRoleAttributeUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GameRoleAttributeUpsertOne) Exec

Exec executes the query.

func (*GameRoleAttributeUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleAttributeUpsertOne) ID

func (u *GameRoleAttributeUpsertOne) ID(ctx context.Context) (id int64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*GameRoleAttributeUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*GameRoleAttributeUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GameRoleAttribute.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*GameRoleAttributeUpsertOne) SetAccountID

SetAccountID sets the "account_id" field.

func (*GameRoleAttributeUpsertOne) SetName

SetName sets the "name" field.

func (*GameRoleAttributeUpsertOne) SetRoleID

SetRoleID sets the "role_id" field.

func (*GameRoleAttributeUpsertOne) SetType

SetType sets the "type" field.

func (*GameRoleAttributeUpsertOne) SetUpdateAt

SetUpdateAt sets the "update_at" field.

func (*GameRoleAttributeUpsertOne) SetUserID

SetUserID sets the "user_id" field.

func (*GameRoleAttributeUpsertOne) SetValue

SetValue sets the "value" field.

func (*GameRoleAttributeUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the GameRoleAttributeCreate.OnConflict documentation for more info.

func (*GameRoleAttributeUpsertOne) UpdateAccountID

UpdateAccountID sets the "account_id" field to the value that was provided on create.

func (*GameRoleAttributeUpsertOne) UpdateName

UpdateName sets the "name" field to the value that was provided on create.

func (*GameRoleAttributeUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.GameRoleAttribute.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(gameroleattribute.FieldID)
		}),
	).
	Exec(ctx)

func (*GameRoleAttributeUpsertOne) UpdateRoleID

UpdateRoleID sets the "role_id" field to the value that was provided on create.

func (*GameRoleAttributeUpsertOne) UpdateType

UpdateType sets the "type" field to the value that was provided on create.

func (*GameRoleAttributeUpsertOne) UpdateUpdateAt

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*GameRoleAttributeUpsertOne) UpdateUserID

UpdateUserID sets the "user_id" field to the value that was provided on create.

func (*GameRoleAttributeUpsertOne) UpdateValue

UpdateValue sets the "value" field to the value that was provided on create.

type GameRoleAttributes

type GameRoleAttributes []*GameRoleAttribute

GameRoleAttributes is a parsable slice of GameRoleAttribute.

type GameRoleClient

type GameRoleClient struct {
	// contains filtered or unexported fields
}

GameRoleClient is a client for the GameRole schema.

func NewGameRoleClient

func NewGameRoleClient(c config) *GameRoleClient

NewGameRoleClient returns a client for the GameRole from the given config.

func (*GameRoleClient) Create

func (c *GameRoleClient) Create() *GameRoleCreate

Create returns a builder for creating a GameRole entity.

func (*GameRoleClient) CreateBulk

func (c *GameRoleClient) CreateBulk(builders ...*GameRoleCreate) *GameRoleCreateBulk

CreateBulk returns a builder for creating a bulk of GameRole entities.

func (*GameRoleClient) Delete

func (c *GameRoleClient) Delete() *GameRoleDelete

Delete returns a delete builder for GameRole.

func (*GameRoleClient) DeleteOne

func (c *GameRoleClient) DeleteOne(gr *GameRole) *GameRoleDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GameRoleClient) DeleteOneID

func (c *GameRoleClient) DeleteOneID(id int64) *GameRoleDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*GameRoleClient) ExecContext

func (c *GameRoleClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleClient) Get

func (c *GameRoleClient) Get(ctx context.Context, id int64) (*GameRole, error)

Get returns a GameRole entity by its id.

func (*GameRoleClient) GetX

func (c *GameRoleClient) GetX(ctx context.Context, id int64) *GameRole

GetX is like Get, but panics if an error occurs.

func (*GameRoleClient) Hooks

func (c *GameRoleClient) Hooks() []Hook

Hooks returns the client hooks.

func (*GameRoleClient) Intercept

func (c *GameRoleClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `gamerole.Intercept(f(g(h())))`.

func (*GameRoleClient) Interceptors

func (c *GameRoleClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*GameRoleClient) Query

func (c *GameRoleClient) Query() *GameRoleQuery

Query returns a query builder for GameRole.

func (*GameRoleClient) QueryContext

func (c *GameRoleClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleClient) Update

func (c *GameRoleClient) Update() *GameRoleUpdate

Update returns an update builder for GameRole.

func (*GameRoleClient) UpdateOne

func (c *GameRoleClient) UpdateOne(gr *GameRole) *GameRoleUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GameRoleClient) UpdateOneID

func (c *GameRoleClient) UpdateOneID(id int64) *GameRoleUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GameRoleClient) Use

func (c *GameRoleClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `gamerole.Hooks(f(g(h())))`.

type GameRoleCreate

type GameRoleCreate struct {
	// contains filtered or unexported fields
}

GameRoleCreate is the builder for creating a GameRole entity.

func (*GameRoleCreate) Exec

func (grc *GameRoleCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GameRoleCreate) ExecContext

func (c *GameRoleCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleCreate) ExecX

func (grc *GameRoleCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleCreate) Mutation

func (grc *GameRoleCreate) Mutation() *GameRoleMutation

Mutation returns the GameRoleMutation object of the builder.

func (*GameRoleCreate) OnConflict

func (grc *GameRoleCreate) OnConflict(opts ...sql.ConflictOption) *GameRoleUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.GameRole.Create().
	SetUserID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GameRoleUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*GameRoleCreate) OnConflictColumns

func (grc *GameRoleCreate) OnConflictColumns(columns ...string) *GameRoleUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.GameRole.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GameRoleCreate) QueryContext

func (c *GameRoleCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleCreate) Save

func (grc *GameRoleCreate) Save(ctx context.Context) (*GameRole, error)

Save creates the GameRole in the database.

func (*GameRoleCreate) SaveX

func (grc *GameRoleCreate) SaveX(ctx context.Context) *GameRole

SaveX calls Save and panics if Save returns an error.

func (*GameRoleCreate) SetAccountID

func (grc *GameRoleCreate) SetAccountID(s string) *GameRoleCreate

SetAccountID sets the "account_id" field.

func (*GameRoleCreate) SetCreateAt

func (grc *GameRoleCreate) SetCreateAt(t time.Time) *GameRoleCreate

SetCreateAt sets the "create_at" field.

func (*GameRoleCreate) SetID

func (grc *GameRoleCreate) SetID(i int64) *GameRoleCreate

SetID sets the "id" field.

func (*GameRoleCreate) SetLevel

func (grc *GameRoleCreate) SetLevel(i int) *GameRoleCreate

SetLevel sets the "level" field.

func (*GameRoleCreate) SetNickName

func (grc *GameRoleCreate) SetNickName(s string) *GameRoleCreate

SetNickName sets the "nick_name" field.

func (*GameRoleCreate) SetNillableCreateAt

func (grc *GameRoleCreate) SetNillableCreateAt(t *time.Time) *GameRoleCreate

SetNillableCreateAt sets the "create_at" field if the given value is not nil.

func (*GameRoleCreate) SetNillableLevel

func (grc *GameRoleCreate) SetNillableLevel(i *int) *GameRoleCreate

SetNillableLevel sets the "level" field if the given value is not nil.

func (*GameRoleCreate) SetNillableNickName

func (grc *GameRoleCreate) SetNillableNickName(s *string) *GameRoleCreate

SetNillableNickName sets the "nick_name" field if the given value is not nil.

func (*GameRoleCreate) SetNillableRegion

func (grc *GameRoleCreate) SetNillableRegion(s *string) *GameRoleCreate

SetNillableRegion sets the "region" field if the given value is not nil.

func (*GameRoleCreate) SetNillableRegionName

func (grc *GameRoleCreate) SetNillableRegionName(s *string) *GameRoleCreate

SetNillableRegionName sets the "region_name" field if the given value is not nil.

func (*GameRoleCreate) SetNillableUpdateAt

func (grc *GameRoleCreate) SetNillableUpdateAt(t *time.Time) *GameRoleCreate

SetNillableUpdateAt sets the "update_at" field if the given value is not nil.

func (*GameRoleCreate) SetRegion

func (grc *GameRoleCreate) SetRegion(s string) *GameRoleCreate

SetRegion sets the "region" field.

func (*GameRoleCreate) SetRegionName

func (grc *GameRoleCreate) SetRegionName(s string) *GameRoleCreate

SetRegionName sets the "region_name" field.

func (*GameRoleCreate) SetRoleID

func (grc *GameRoleCreate) SetRoleID(s string) *GameRoleCreate

SetRoleID sets the "role_id" field.

func (*GameRoleCreate) SetUpdateAt

func (grc *GameRoleCreate) SetUpdateAt(t time.Time) *GameRoleCreate

SetUpdateAt sets the "update_at" field.

func (*GameRoleCreate) SetUserID

func (grc *GameRoleCreate) SetUserID(i int64) *GameRoleCreate

SetUserID sets the "user_id" field.

type GameRoleCreateBulk

type GameRoleCreateBulk struct {
	// contains filtered or unexported fields
}

GameRoleCreateBulk is the builder for creating many GameRole entities in bulk.

func (*GameRoleCreateBulk) Exec

func (grcb *GameRoleCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GameRoleCreateBulk) ExecContext

func (c *GameRoleCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleCreateBulk) ExecX

func (grcb *GameRoleCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleCreateBulk) OnConflict

func (grcb *GameRoleCreateBulk) OnConflict(opts ...sql.ConflictOption) *GameRoleUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.GameRole.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.GameRoleUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*GameRoleCreateBulk) OnConflictColumns

func (grcb *GameRoleCreateBulk) OnConflictColumns(columns ...string) *GameRoleUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.GameRole.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*GameRoleCreateBulk) QueryContext

func (c *GameRoleCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleCreateBulk) Save

func (grcb *GameRoleCreateBulk) Save(ctx context.Context) ([]*GameRole, error)

Save creates the GameRole entities in the database.

func (*GameRoleCreateBulk) SaveX

func (grcb *GameRoleCreateBulk) SaveX(ctx context.Context) []*GameRole

SaveX is like Save, but panics if an error occurs.

type GameRoleDelete

type GameRoleDelete struct {
	// contains filtered or unexported fields
}

GameRoleDelete is the builder for deleting a GameRole entity.

func (*GameRoleDelete) Exec

func (grd *GameRoleDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*GameRoleDelete) ExecContext

func (c *GameRoleDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleDelete) ExecX

func (grd *GameRoleDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleDelete) QueryContext

func (c *GameRoleDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleDelete) Where

func (grd *GameRoleDelete) Where(ps ...predicate.GameRole) *GameRoleDelete

Where appends a list predicates to the GameRoleDelete builder.

type GameRoleDeleteOne

type GameRoleDeleteOne struct {
	// contains filtered or unexported fields
}

GameRoleDeleteOne is the builder for deleting a single GameRole entity.

func (*GameRoleDeleteOne) Exec

func (grdo *GameRoleDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GameRoleDeleteOne) ExecX

func (grdo *GameRoleDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleDeleteOne) Where

Where appends a list predicates to the GameRoleDelete builder.

type GameRoleGroupBy

type GameRoleGroupBy struct {
	// contains filtered or unexported fields
}

GameRoleGroupBy is the group-by builder for GameRole entities.

func (*GameRoleGroupBy) Aggregate

func (grgb *GameRoleGroupBy) Aggregate(fns ...AggregateFunc) *GameRoleGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*GameRoleGroupBy) Bool

func (s *GameRoleGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GameRoleGroupBy) BoolX

func (s *GameRoleGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GameRoleGroupBy) Bools

func (s *GameRoleGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GameRoleGroupBy) BoolsX

func (s *GameRoleGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*GameRoleGroupBy) Float64

func (s *GameRoleGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GameRoleGroupBy) Float64X

func (s *GameRoleGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GameRoleGroupBy) Float64s

func (s *GameRoleGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GameRoleGroupBy) Float64sX

func (s *GameRoleGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GameRoleGroupBy) Int

func (s *GameRoleGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GameRoleGroupBy) IntX

func (s *GameRoleGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GameRoleGroupBy) Ints

func (s *GameRoleGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GameRoleGroupBy) IntsX

func (s *GameRoleGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GameRoleGroupBy) Scan

func (grgb *GameRoleGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GameRoleGroupBy) ScanX

func (s *GameRoleGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GameRoleGroupBy) String

func (s *GameRoleGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GameRoleGroupBy) StringX

func (s *GameRoleGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GameRoleGroupBy) Strings

func (s *GameRoleGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GameRoleGroupBy) StringsX

func (s *GameRoleGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GameRoleMutation

type GameRoleMutation struct {
	// contains filtered or unexported fields
}

GameRoleMutation represents an operation that mutates the GameRole nodes in the graph.

func (*GameRoleMutation) AccountID

func (m *GameRoleMutation) AccountID() (r string, exists bool)

AccountID returns the value of the "account_id" field in the mutation.

func (*GameRoleMutation) AddField

func (m *GameRoleMutation) 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 (*GameRoleMutation) AddLevel

func (m *GameRoleMutation) AddLevel(i int)

AddLevel adds i to the "level" field.

func (*GameRoleMutation) AddUserID

func (m *GameRoleMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*GameRoleMutation) AddedEdges

func (m *GameRoleMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*GameRoleMutation) AddedField

func (m *GameRoleMutation) 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 (*GameRoleMutation) AddedFields

func (m *GameRoleMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*GameRoleMutation) AddedIDs

func (m *GameRoleMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*GameRoleMutation) AddedLevel

func (m *GameRoleMutation) AddedLevel() (r int, exists bool)

AddedLevel returns the value that was added to the "level" field in this mutation.

func (*GameRoleMutation) AddedUserID

func (m *GameRoleMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*GameRoleMutation) ClearEdge

func (m *GameRoleMutation) 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 (*GameRoleMutation) ClearField

func (m *GameRoleMutation) 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 (*GameRoleMutation) ClearedEdges

func (m *GameRoleMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*GameRoleMutation) ClearedFields

func (m *GameRoleMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (GameRoleMutation) Client

func (m GameRoleMutation) 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 (*GameRoleMutation) CreateAt

func (m *GameRoleMutation) CreateAt() (r time.Time, exists bool)

CreateAt returns the value of the "create_at" field in the mutation.

func (*GameRoleMutation) EdgeCleared

func (m *GameRoleMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*GameRoleMutation) ExecContext

func (c *GameRoleMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleMutation) Field

func (m *GameRoleMutation) 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 (*GameRoleMutation) FieldCleared

func (m *GameRoleMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*GameRoleMutation) Fields

func (m *GameRoleMutation) 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 (*GameRoleMutation) ID

func (m *GameRoleMutation) 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 (*GameRoleMutation) IDs

func (m *GameRoleMutation) 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 (*GameRoleMutation) Level

func (m *GameRoleMutation) Level() (r int, exists bool)

Level returns the value of the "level" field in the mutation.

func (*GameRoleMutation) NickName

func (m *GameRoleMutation) NickName() (r string, exists bool)

NickName returns the value of the "nick_name" field in the mutation.

func (*GameRoleMutation) OldAccountID

func (m *GameRoleMutation) OldAccountID(ctx context.Context) (v string, err error)

OldAccountID returns the old "account_id" field's value of the GameRole entity. If the GameRole 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 (*GameRoleMutation) OldCreateAt

func (m *GameRoleMutation) OldCreateAt(ctx context.Context) (v time.Time, err error)

OldCreateAt returns the old "create_at" field's value of the GameRole entity. If the GameRole 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 (*GameRoleMutation) OldField

func (m *GameRoleMutation) 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 (*GameRoleMutation) OldLevel

func (m *GameRoleMutation) OldLevel(ctx context.Context) (v int, err error)

OldLevel returns the old "level" field's value of the GameRole entity. If the GameRole 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 (*GameRoleMutation) OldNickName

func (m *GameRoleMutation) OldNickName(ctx context.Context) (v string, err error)

OldNickName returns the old "nick_name" field's value of the GameRole entity. If the GameRole 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 (*GameRoleMutation) OldRegion

func (m *GameRoleMutation) OldRegion(ctx context.Context) (v string, err error)

OldRegion returns the old "region" field's value of the GameRole entity. If the GameRole 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 (*GameRoleMutation) OldRegionName

func (m *GameRoleMutation) OldRegionName(ctx context.Context) (v string, err error)

OldRegionName returns the old "region_name" field's value of the GameRole entity. If the GameRole 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 (*GameRoleMutation) OldRoleID

func (m *GameRoleMutation) OldRoleID(ctx context.Context) (v string, err error)

OldRoleID returns the old "role_id" field's value of the GameRole entity. If the GameRole 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 (*GameRoleMutation) OldUpdateAt

func (m *GameRoleMutation) OldUpdateAt(ctx context.Context) (v time.Time, err error)

OldUpdateAt returns the old "update_at" field's value of the GameRole entity. If the GameRole 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 (*GameRoleMutation) OldUserID

func (m *GameRoleMutation) OldUserID(ctx context.Context) (v int64, err error)

OldUserID returns the old "user_id" field's value of the GameRole entity. If the GameRole 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 (*GameRoleMutation) Op

func (m *GameRoleMutation) Op() Op

Op returns the operation name.

func (*GameRoleMutation) QueryContext

func (c *GameRoleMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleMutation) Region

func (m *GameRoleMutation) Region() (r string, exists bool)

Region returns the value of the "region" field in the mutation.

func (*GameRoleMutation) RegionName

func (m *GameRoleMutation) RegionName() (r string, exists bool)

RegionName returns the value of the "region_name" field in the mutation.

func (*GameRoleMutation) RemovedEdges

func (m *GameRoleMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*GameRoleMutation) RemovedIDs

func (m *GameRoleMutation) 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 (*GameRoleMutation) ResetAccountID

func (m *GameRoleMutation) ResetAccountID()

ResetAccountID resets all changes to the "account_id" field.

func (*GameRoleMutation) ResetCreateAt

func (m *GameRoleMutation) ResetCreateAt()

ResetCreateAt resets all changes to the "create_at" field.

func (*GameRoleMutation) ResetEdge

func (m *GameRoleMutation) 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 (*GameRoleMutation) ResetField

func (m *GameRoleMutation) 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 (*GameRoleMutation) ResetLevel

func (m *GameRoleMutation) ResetLevel()

ResetLevel resets all changes to the "level" field.

func (*GameRoleMutation) ResetNickName

func (m *GameRoleMutation) ResetNickName()

ResetNickName resets all changes to the "nick_name" field.

func (*GameRoleMutation) ResetRegion

func (m *GameRoleMutation) ResetRegion()

ResetRegion resets all changes to the "region" field.

func (*GameRoleMutation) ResetRegionName

func (m *GameRoleMutation) ResetRegionName()

ResetRegionName resets all changes to the "region_name" field.

func (*GameRoleMutation) ResetRoleID

func (m *GameRoleMutation) ResetRoleID()

ResetRoleID resets all changes to the "role_id" field.

func (*GameRoleMutation) ResetUpdateAt

func (m *GameRoleMutation) ResetUpdateAt()

ResetUpdateAt resets all changes to the "update_at" field.

func (*GameRoleMutation) ResetUserID

func (m *GameRoleMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*GameRoleMutation) RoleID

func (m *GameRoleMutation) RoleID() (r string, exists bool)

RoleID returns the value of the "role_id" field in the mutation.

func (*GameRoleMutation) SetAccountID

func (m *GameRoleMutation) SetAccountID(s string)

SetAccountID sets the "account_id" field.

func (*GameRoleMutation) SetCreateAt

func (m *GameRoleMutation) SetCreateAt(t time.Time)

SetCreateAt sets the "create_at" field.

func (*GameRoleMutation) SetField

func (m *GameRoleMutation) 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 (*GameRoleMutation) SetID

func (m *GameRoleMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of GameRole entities.

func (*GameRoleMutation) SetLevel

func (m *GameRoleMutation) SetLevel(i int)

SetLevel sets the "level" field.

func (*GameRoleMutation) SetNickName

func (m *GameRoleMutation) SetNickName(s string)

SetNickName sets the "nick_name" field.

func (*GameRoleMutation) SetOp

func (m *GameRoleMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GameRoleMutation) SetRegion

func (m *GameRoleMutation) SetRegion(s string)

SetRegion sets the "region" field.

func (*GameRoleMutation) SetRegionName

func (m *GameRoleMutation) SetRegionName(s string)

SetRegionName sets the "region_name" field.

func (*GameRoleMutation) SetRoleID

func (m *GameRoleMutation) SetRoleID(s string)

SetRoleID sets the "role_id" field.

func (*GameRoleMutation) SetUpdateAt

func (m *GameRoleMutation) SetUpdateAt(t time.Time)

SetUpdateAt sets the "update_at" field.

func (*GameRoleMutation) SetUserID

func (m *GameRoleMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (GameRoleMutation) Tx

func (m GameRoleMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*GameRoleMutation) Type

func (m *GameRoleMutation) Type() string

Type returns the node type of this mutation (GameRole).

func (*GameRoleMutation) UpdateAt

func (m *GameRoleMutation) UpdateAt() (r time.Time, exists bool)

UpdateAt returns the value of the "update_at" field in the mutation.

func (*GameRoleMutation) UserID

func (m *GameRoleMutation) UserID() (r int64, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*GameRoleMutation) Where

func (m *GameRoleMutation) Where(ps ...predicate.GameRole)

Where appends a list predicates to the GameRoleMutation builder.

func (*GameRoleMutation) WhereP

func (m *GameRoleMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the GameRoleMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type GameRoleQuery

type GameRoleQuery struct {
	// contains filtered or unexported fields
}

GameRoleQuery is the builder for querying GameRole entities.

func (*GameRoleQuery) Aggregate

func (grq *GameRoleQuery) Aggregate(fns ...AggregateFunc) *GameRoleSelect

Aggregate returns a GameRoleSelect configured with the given aggregations.

func (*GameRoleQuery) All

func (grq *GameRoleQuery) All(ctx context.Context) ([]*GameRole, error)

All executes the query and returns a list of GameRoles.

func (*GameRoleQuery) AllX

func (grq *GameRoleQuery) AllX(ctx context.Context) []*GameRole

AllX is like All, but panics if an error occurs.

func (*GameRoleQuery) Clone

func (grq *GameRoleQuery) Clone() *GameRoleQuery

Clone returns a duplicate of the GameRoleQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*GameRoleQuery) Count

func (grq *GameRoleQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GameRoleQuery) CountX

func (grq *GameRoleQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*GameRoleQuery) ExecContext

func (c *GameRoleQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleQuery) Exist

func (grq *GameRoleQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*GameRoleQuery) ExistX

func (grq *GameRoleQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*GameRoleQuery) First

func (grq *GameRoleQuery) First(ctx context.Context) (*GameRole, error)

First returns the first GameRole entity from the query. Returns a *NotFoundError when no GameRole was found.

func (*GameRoleQuery) FirstID

func (grq *GameRoleQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first GameRole ID from the query. Returns a *NotFoundError when no GameRole ID was found.

func (*GameRoleQuery) FirstIDX

func (grq *GameRoleQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*GameRoleQuery) FirstX

func (grq *GameRoleQuery) FirstX(ctx context.Context) *GameRole

FirstX is like First, but panics if an error occurs.

func (*GameRoleQuery) ForShare

func (grq *GameRoleQuery) ForShare(opts ...sql.LockOption) *GameRoleQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*GameRoleQuery) ForUpdate

func (grq *GameRoleQuery) ForUpdate(opts ...sql.LockOption) *GameRoleQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*GameRoleQuery) GroupBy

func (grq *GameRoleQuery) GroupBy(field string, fields ...string) *GameRoleGroupBy

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 {
	UserID int64 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.GameRole.Query().
	GroupBy(gamerole.FieldUserID).
	Aggregate(entity.Count()).
	Scan(ctx, &v)

func (*GameRoleQuery) IDs

func (grq *GameRoleQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of GameRole IDs.

func (*GameRoleQuery) IDsX

func (grq *GameRoleQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*GameRoleQuery) Limit

func (grq *GameRoleQuery) Limit(limit int) *GameRoleQuery

Limit the number of records to be returned by this query.

func (*GameRoleQuery) Modify

func (grq *GameRoleQuery) Modify(modifiers ...func(s *sql.Selector)) *GameRoleSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*GameRoleQuery) Offset

func (grq *GameRoleQuery) Offset(offset int) *GameRoleQuery

Offset to start from.

func (*GameRoleQuery) Only

func (grq *GameRoleQuery) Only(ctx context.Context) (*GameRole, error)

Only returns a single GameRole entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one GameRole entity is found. Returns a *NotFoundError when no GameRole entities are found.

func (*GameRoleQuery) OnlyID

func (grq *GameRoleQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only GameRole ID in the query. Returns a *NotSingularError when more than one GameRole ID is found. Returns a *NotFoundError when no entities are found.

func (*GameRoleQuery) OnlyIDX

func (grq *GameRoleQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*GameRoleQuery) OnlyX

func (grq *GameRoleQuery) OnlyX(ctx context.Context) *GameRole

OnlyX is like Only, but panics if an error occurs.

func (*GameRoleQuery) Order

func (grq *GameRoleQuery) Order(o ...OrderFunc) *GameRoleQuery

Order specifies how the records should be ordered.

func (*GameRoleQuery) QueryContext

func (c *GameRoleQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleQuery) Select

func (grq *GameRoleQuery) Select(fields ...string) *GameRoleSelect

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 {
	UserID int64 `json:"user_id,omitempty"`
}

client.GameRole.Query().
	Select(gamerole.FieldUserID).
	Scan(ctx, &v)

func (*GameRoleQuery) Unique

func (grq *GameRoleQuery) Unique(unique bool) *GameRoleQuery

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 (*GameRoleQuery) Where

func (grq *GameRoleQuery) Where(ps ...predicate.GameRole) *GameRoleQuery

Where adds a new predicate for the GameRoleQuery builder.

type GameRoleSelect

type GameRoleSelect struct {
	*GameRoleQuery
	// contains filtered or unexported fields
}

GameRoleSelect is the builder for selecting fields of GameRole entities.

func (*GameRoleSelect) Aggregate

func (grs *GameRoleSelect) Aggregate(fns ...AggregateFunc) *GameRoleSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GameRoleSelect) Bool

func (s *GameRoleSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*GameRoleSelect) BoolX

func (s *GameRoleSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*GameRoleSelect) Bools

func (s *GameRoleSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*GameRoleSelect) BoolsX

func (s *GameRoleSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (GameRoleSelect) ExecContext

func (c GameRoleSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleSelect) Float64

func (s *GameRoleSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*GameRoleSelect) Float64X

func (s *GameRoleSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*GameRoleSelect) Float64s

func (s *GameRoleSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*GameRoleSelect) Float64sX

func (s *GameRoleSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*GameRoleSelect) Int

func (s *GameRoleSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*GameRoleSelect) IntX

func (s *GameRoleSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*GameRoleSelect) Ints

func (s *GameRoleSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*GameRoleSelect) IntsX

func (s *GameRoleSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*GameRoleSelect) Modify

func (grs *GameRoleSelect) Modify(modifiers ...func(s *sql.Selector)) *GameRoleSelect

Modify adds a query modifier for attaching custom logic to queries.

func (GameRoleSelect) QueryContext

func (c GameRoleSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleSelect) Scan

func (grs *GameRoleSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*GameRoleSelect) ScanX

func (s *GameRoleSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*GameRoleSelect) String

func (s *GameRoleSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*GameRoleSelect) StringX

func (s *GameRoleSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*GameRoleSelect) Strings

func (s *GameRoleSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*GameRoleSelect) StringsX

func (s *GameRoleSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type GameRoleUpdate

type GameRoleUpdate struct {
	// contains filtered or unexported fields
}

GameRoleUpdate is the builder for updating GameRole entities.

func (*GameRoleUpdate) AddLevel

func (gru *GameRoleUpdate) AddLevel(i int) *GameRoleUpdate

AddLevel adds i to the "level" field.

func (*GameRoleUpdate) AddUserID

func (gru *GameRoleUpdate) AddUserID(i int64) *GameRoleUpdate

AddUserID adds i to the "user_id" field.

func (*GameRoleUpdate) Exec

func (gru *GameRoleUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GameRoleUpdate) ExecContext

func (c *GameRoleUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleUpdate) ExecX

func (gru *GameRoleUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleUpdate) Modify

func (gru *GameRoleUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *GameRoleUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*GameRoleUpdate) Mutation

func (gru *GameRoleUpdate) Mutation() *GameRoleMutation

Mutation returns the GameRoleMutation object of the builder.

func (*GameRoleUpdate) QueryContext

func (c *GameRoleUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleUpdate) Save

func (gru *GameRoleUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*GameRoleUpdate) SaveX

func (gru *GameRoleUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*GameRoleUpdate) SetAccountID

func (gru *GameRoleUpdate) SetAccountID(s string) *GameRoleUpdate

SetAccountID sets the "account_id" field.

func (*GameRoleUpdate) SetLevel

func (gru *GameRoleUpdate) SetLevel(i int) *GameRoleUpdate

SetLevel sets the "level" field.

func (*GameRoleUpdate) SetNickName

func (gru *GameRoleUpdate) SetNickName(s string) *GameRoleUpdate

SetNickName sets the "nick_name" field.

func (*GameRoleUpdate) SetNillableLevel

func (gru *GameRoleUpdate) SetNillableLevel(i *int) *GameRoleUpdate

SetNillableLevel sets the "level" field if the given value is not nil.

func (*GameRoleUpdate) SetNillableNickName

func (gru *GameRoleUpdate) SetNillableNickName(s *string) *GameRoleUpdate

SetNillableNickName sets the "nick_name" field if the given value is not nil.

func (*GameRoleUpdate) SetNillableRegion

func (gru *GameRoleUpdate) SetNillableRegion(s *string) *GameRoleUpdate

SetNillableRegion sets the "region" field if the given value is not nil.

func (*GameRoleUpdate) SetNillableRegionName

func (gru *GameRoleUpdate) SetNillableRegionName(s *string) *GameRoleUpdate

SetNillableRegionName sets the "region_name" field if the given value is not nil.

func (*GameRoleUpdate) SetRegion

func (gru *GameRoleUpdate) SetRegion(s string) *GameRoleUpdate

SetRegion sets the "region" field.

func (*GameRoleUpdate) SetRegionName

func (gru *GameRoleUpdate) SetRegionName(s string) *GameRoleUpdate

SetRegionName sets the "region_name" field.

func (*GameRoleUpdate) SetRoleID

func (gru *GameRoleUpdate) SetRoleID(s string) *GameRoleUpdate

SetRoleID sets the "role_id" field.

func (*GameRoleUpdate) SetUpdateAt

func (gru *GameRoleUpdate) SetUpdateAt(t time.Time) *GameRoleUpdate

SetUpdateAt sets the "update_at" field.

func (*GameRoleUpdate) SetUserID

func (gru *GameRoleUpdate) SetUserID(i int64) *GameRoleUpdate

SetUserID sets the "user_id" field.

func (*GameRoleUpdate) Where

func (gru *GameRoleUpdate) Where(ps ...predicate.GameRole) *GameRoleUpdate

Where appends a list predicates to the GameRoleUpdate builder.

type GameRoleUpdateOne

type GameRoleUpdateOne struct {
	// contains filtered or unexported fields
}

GameRoleUpdateOne is the builder for updating a single GameRole entity.

func (*GameRoleUpdateOne) AddLevel

func (gruo *GameRoleUpdateOne) AddLevel(i int) *GameRoleUpdateOne

AddLevel adds i to the "level" field.

func (*GameRoleUpdateOne) AddUserID

func (gruo *GameRoleUpdateOne) AddUserID(i int64) *GameRoleUpdateOne

AddUserID adds i to the "user_id" field.

func (*GameRoleUpdateOne) Exec

func (gruo *GameRoleUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GameRoleUpdateOne) ExecContext

func (c *GameRoleUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*GameRoleUpdateOne) ExecX

func (gruo *GameRoleUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleUpdateOne) Modify

func (gruo *GameRoleUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *GameRoleUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*GameRoleUpdateOne) Mutation

func (gruo *GameRoleUpdateOne) Mutation() *GameRoleMutation

Mutation returns the GameRoleMutation object of the builder.

func (*GameRoleUpdateOne) QueryContext

func (c *GameRoleUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*GameRoleUpdateOne) Save

func (gruo *GameRoleUpdateOne) Save(ctx context.Context) (*GameRole, error)

Save executes the query and returns the updated GameRole entity.

func (*GameRoleUpdateOne) SaveX

func (gruo *GameRoleUpdateOne) SaveX(ctx context.Context) *GameRole

SaveX is like Save, but panics if an error occurs.

func (*GameRoleUpdateOne) Select

func (gruo *GameRoleUpdateOne) Select(field string, fields ...string) *GameRoleUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*GameRoleUpdateOne) SetAccountID

func (gruo *GameRoleUpdateOne) SetAccountID(s string) *GameRoleUpdateOne

SetAccountID sets the "account_id" field.

func (*GameRoleUpdateOne) SetLevel

func (gruo *GameRoleUpdateOne) SetLevel(i int) *GameRoleUpdateOne

SetLevel sets the "level" field.

func (*GameRoleUpdateOne) SetNickName

func (gruo *GameRoleUpdateOne) SetNickName(s string) *GameRoleUpdateOne

SetNickName sets the "nick_name" field.

func (*GameRoleUpdateOne) SetNillableLevel

func (gruo *GameRoleUpdateOne) SetNillableLevel(i *int) *GameRoleUpdateOne

SetNillableLevel sets the "level" field if the given value is not nil.

func (*GameRoleUpdateOne) SetNillableNickName

func (gruo *GameRoleUpdateOne) SetNillableNickName(s *string) *GameRoleUpdateOne

SetNillableNickName sets the "nick_name" field if the given value is not nil.

func (*GameRoleUpdateOne) SetNillableRegion

func (gruo *GameRoleUpdateOne) SetNillableRegion(s *string) *GameRoleUpdateOne

SetNillableRegion sets the "region" field if the given value is not nil.

func (*GameRoleUpdateOne) SetNillableRegionName

func (gruo *GameRoleUpdateOne) SetNillableRegionName(s *string) *GameRoleUpdateOne

SetNillableRegionName sets the "region_name" field if the given value is not nil.

func (*GameRoleUpdateOne) SetRegion

func (gruo *GameRoleUpdateOne) SetRegion(s string) *GameRoleUpdateOne

SetRegion sets the "region" field.

func (*GameRoleUpdateOne) SetRegionName

func (gruo *GameRoleUpdateOne) SetRegionName(s string) *GameRoleUpdateOne

SetRegionName sets the "region_name" field.

func (*GameRoleUpdateOne) SetRoleID

func (gruo *GameRoleUpdateOne) SetRoleID(s string) *GameRoleUpdateOne

SetRoleID sets the "role_id" field.

func (*GameRoleUpdateOne) SetUpdateAt

func (gruo *GameRoleUpdateOne) SetUpdateAt(t time.Time) *GameRoleUpdateOne

SetUpdateAt sets the "update_at" field.

func (*GameRoleUpdateOne) SetUserID

func (gruo *GameRoleUpdateOne) SetUserID(i int64) *GameRoleUpdateOne

SetUserID sets the "user_id" field.

func (*GameRoleUpdateOne) Where

Where appends a list predicates to the GameRoleUpdate builder.

type GameRoleUpsert

type GameRoleUpsert struct {
	*sql.UpdateSet
}

GameRoleUpsert is the "OnConflict" setter.

func (*GameRoleUpsert) AddLevel

func (u *GameRoleUpsert) AddLevel(v int) *GameRoleUpsert

AddLevel adds v to the "level" field.

func (*GameRoleUpsert) AddUserID

func (u *GameRoleUpsert) AddUserID(v int64) *GameRoleUpsert

AddUserID adds v to the "user_id" field.

func (*GameRoleUpsert) SetAccountID

func (u *GameRoleUpsert) SetAccountID(v string) *GameRoleUpsert

SetAccountID sets the "account_id" field.

func (*GameRoleUpsert) SetLevel

func (u *GameRoleUpsert) SetLevel(v int) *GameRoleUpsert

SetLevel sets the "level" field.

func (*GameRoleUpsert) SetNickName

func (u *GameRoleUpsert) SetNickName(v string) *GameRoleUpsert

SetNickName sets the "nick_name" field.

func (*GameRoleUpsert) SetRegion

func (u *GameRoleUpsert) SetRegion(v string) *GameRoleUpsert

SetRegion sets the "region" field.

func (*GameRoleUpsert) SetRegionName

func (u *GameRoleUpsert) SetRegionName(v string) *GameRoleUpsert

SetRegionName sets the "region_name" field.

func (*GameRoleUpsert) SetRoleID

func (u *GameRoleUpsert) SetRoleID(v string) *GameRoleUpsert

SetRoleID sets the "role_id" field.

func (*GameRoleUpsert) SetUpdateAt

func (u *GameRoleUpsert) SetUpdateAt(v time.Time) *GameRoleUpsert

SetUpdateAt sets the "update_at" field.

func (*GameRoleUpsert) SetUserID

func (u *GameRoleUpsert) SetUserID(v int64) *GameRoleUpsert

SetUserID sets the "user_id" field.

func (*GameRoleUpsert) UpdateAccountID

func (u *GameRoleUpsert) UpdateAccountID() *GameRoleUpsert

UpdateAccountID sets the "account_id" field to the value that was provided on create.

func (*GameRoleUpsert) UpdateLevel

func (u *GameRoleUpsert) UpdateLevel() *GameRoleUpsert

UpdateLevel sets the "level" field to the value that was provided on create.

func (*GameRoleUpsert) UpdateNickName

func (u *GameRoleUpsert) UpdateNickName() *GameRoleUpsert

UpdateNickName sets the "nick_name" field to the value that was provided on create.

func (*GameRoleUpsert) UpdateRegion

func (u *GameRoleUpsert) UpdateRegion() *GameRoleUpsert

UpdateRegion sets the "region" field to the value that was provided on create.

func (*GameRoleUpsert) UpdateRegionName

func (u *GameRoleUpsert) UpdateRegionName() *GameRoleUpsert

UpdateRegionName sets the "region_name" field to the value that was provided on create.

func (*GameRoleUpsert) UpdateRoleID

func (u *GameRoleUpsert) UpdateRoleID() *GameRoleUpsert

UpdateRoleID sets the "role_id" field to the value that was provided on create.

func (*GameRoleUpsert) UpdateUpdateAt

func (u *GameRoleUpsert) UpdateUpdateAt() *GameRoleUpsert

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*GameRoleUpsert) UpdateUserID

func (u *GameRoleUpsert) UpdateUserID() *GameRoleUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

type GameRoleUpsertBulk

type GameRoleUpsertBulk struct {
	// contains filtered or unexported fields
}

GameRoleUpsertBulk is the builder for "upsert"-ing a bulk of GameRole nodes.

func (*GameRoleUpsertBulk) AddLevel

func (u *GameRoleUpsertBulk) AddLevel(v int) *GameRoleUpsertBulk

AddLevel adds v to the "level" field.

func (*GameRoleUpsertBulk) AddUserID

func (u *GameRoleUpsertBulk) AddUserID(v int64) *GameRoleUpsertBulk

AddUserID adds v to the "user_id" field.

func (*GameRoleUpsertBulk) DoNothing

func (u *GameRoleUpsertBulk) DoNothing() *GameRoleUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GameRoleUpsertBulk) Exec

func (u *GameRoleUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GameRoleUpsertBulk) ExecX

func (u *GameRoleUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GameRole.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*GameRoleUpsertBulk) SetAccountID

func (u *GameRoleUpsertBulk) SetAccountID(v string) *GameRoleUpsertBulk

SetAccountID sets the "account_id" field.

func (*GameRoleUpsertBulk) SetLevel

func (u *GameRoleUpsertBulk) SetLevel(v int) *GameRoleUpsertBulk

SetLevel sets the "level" field.

func (*GameRoleUpsertBulk) SetNickName

func (u *GameRoleUpsertBulk) SetNickName(v string) *GameRoleUpsertBulk

SetNickName sets the "nick_name" field.

func (*GameRoleUpsertBulk) SetRegion

func (u *GameRoleUpsertBulk) SetRegion(v string) *GameRoleUpsertBulk

SetRegion sets the "region" field.

func (*GameRoleUpsertBulk) SetRegionName

func (u *GameRoleUpsertBulk) SetRegionName(v string) *GameRoleUpsertBulk

SetRegionName sets the "region_name" field.

func (*GameRoleUpsertBulk) SetRoleID

func (u *GameRoleUpsertBulk) SetRoleID(v string) *GameRoleUpsertBulk

SetRoleID sets the "role_id" field.

func (*GameRoleUpsertBulk) SetUpdateAt

func (u *GameRoleUpsertBulk) SetUpdateAt(v time.Time) *GameRoleUpsertBulk

SetUpdateAt sets the "update_at" field.

func (*GameRoleUpsertBulk) SetUserID

func (u *GameRoleUpsertBulk) SetUserID(v int64) *GameRoleUpsertBulk

SetUserID sets the "user_id" field.

func (*GameRoleUpsertBulk) Update

func (u *GameRoleUpsertBulk) Update(set func(*GameRoleUpsert)) *GameRoleUpsertBulk

Update allows overriding fields `UPDATE` values. See the GameRoleCreateBulk.OnConflict documentation for more info.

func (*GameRoleUpsertBulk) UpdateAccountID

func (u *GameRoleUpsertBulk) UpdateAccountID() *GameRoleUpsertBulk

UpdateAccountID sets the "account_id" field to the value that was provided on create.

func (*GameRoleUpsertBulk) UpdateLevel

func (u *GameRoleUpsertBulk) UpdateLevel() *GameRoleUpsertBulk

UpdateLevel sets the "level" field to the value that was provided on create.

func (*GameRoleUpsertBulk) UpdateNewValues

func (u *GameRoleUpsertBulk) UpdateNewValues() *GameRoleUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.GameRole.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(gamerole.FieldID)
		}),
	).
	Exec(ctx)

func (*GameRoleUpsertBulk) UpdateNickName

func (u *GameRoleUpsertBulk) UpdateNickName() *GameRoleUpsertBulk

UpdateNickName sets the "nick_name" field to the value that was provided on create.

func (*GameRoleUpsertBulk) UpdateRegion

func (u *GameRoleUpsertBulk) UpdateRegion() *GameRoleUpsertBulk

UpdateRegion sets the "region" field to the value that was provided on create.

func (*GameRoleUpsertBulk) UpdateRegionName

func (u *GameRoleUpsertBulk) UpdateRegionName() *GameRoleUpsertBulk

UpdateRegionName sets the "region_name" field to the value that was provided on create.

func (*GameRoleUpsertBulk) UpdateRoleID

func (u *GameRoleUpsertBulk) UpdateRoleID() *GameRoleUpsertBulk

UpdateRoleID sets the "role_id" field to the value that was provided on create.

func (*GameRoleUpsertBulk) UpdateUpdateAt

func (u *GameRoleUpsertBulk) UpdateUpdateAt() *GameRoleUpsertBulk

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*GameRoleUpsertBulk) UpdateUserID

func (u *GameRoleUpsertBulk) UpdateUserID() *GameRoleUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

type GameRoleUpsertOne

type GameRoleUpsertOne struct {
	// contains filtered or unexported fields
}

GameRoleUpsertOne is the builder for "upsert"-ing

one GameRole node.

func (*GameRoleUpsertOne) AddLevel

func (u *GameRoleUpsertOne) AddLevel(v int) *GameRoleUpsertOne

AddLevel adds v to the "level" field.

func (*GameRoleUpsertOne) AddUserID

func (u *GameRoleUpsertOne) AddUserID(v int64) *GameRoleUpsertOne

AddUserID adds v to the "user_id" field.

func (*GameRoleUpsertOne) DoNothing

func (u *GameRoleUpsertOne) DoNothing() *GameRoleUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*GameRoleUpsertOne) Exec

func (u *GameRoleUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*GameRoleUpsertOne) ExecX

func (u *GameRoleUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*GameRoleUpsertOne) ID

func (u *GameRoleUpsertOne) ID(ctx context.Context) (id int64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*GameRoleUpsertOne) IDX

func (u *GameRoleUpsertOne) IDX(ctx context.Context) int64

IDX is like ID, but panics if an error occurs.

func (*GameRoleUpsertOne) Ignore

func (u *GameRoleUpsertOne) Ignore() *GameRoleUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.GameRole.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*GameRoleUpsertOne) SetAccountID

func (u *GameRoleUpsertOne) SetAccountID(v string) *GameRoleUpsertOne

SetAccountID sets the "account_id" field.

func (*GameRoleUpsertOne) SetLevel

func (u *GameRoleUpsertOne) SetLevel(v int) *GameRoleUpsertOne

SetLevel sets the "level" field.

func (*GameRoleUpsertOne) SetNickName

func (u *GameRoleUpsertOne) SetNickName(v string) *GameRoleUpsertOne

SetNickName sets the "nick_name" field.

func (*GameRoleUpsertOne) SetRegion

func (u *GameRoleUpsertOne) SetRegion(v string) *GameRoleUpsertOne

SetRegion sets the "region" field.

func (*GameRoleUpsertOne) SetRegionName

func (u *GameRoleUpsertOne) SetRegionName(v string) *GameRoleUpsertOne

SetRegionName sets the "region_name" field.

func (*GameRoleUpsertOne) SetRoleID

func (u *GameRoleUpsertOne) SetRoleID(v string) *GameRoleUpsertOne

SetRoleID sets the "role_id" field.

func (*GameRoleUpsertOne) SetUpdateAt

func (u *GameRoleUpsertOne) SetUpdateAt(v time.Time) *GameRoleUpsertOne

SetUpdateAt sets the "update_at" field.

func (*GameRoleUpsertOne) SetUserID

func (u *GameRoleUpsertOne) SetUserID(v int64) *GameRoleUpsertOne

SetUserID sets the "user_id" field.

func (*GameRoleUpsertOne) Update

func (u *GameRoleUpsertOne) Update(set func(*GameRoleUpsert)) *GameRoleUpsertOne

Update allows overriding fields `UPDATE` values. See the GameRoleCreate.OnConflict documentation for more info.

func (*GameRoleUpsertOne) UpdateAccountID

func (u *GameRoleUpsertOne) UpdateAccountID() *GameRoleUpsertOne

UpdateAccountID sets the "account_id" field to the value that was provided on create.

func (*GameRoleUpsertOne) UpdateLevel

func (u *GameRoleUpsertOne) UpdateLevel() *GameRoleUpsertOne

UpdateLevel sets the "level" field to the value that was provided on create.

func (*GameRoleUpsertOne) UpdateNewValues

func (u *GameRoleUpsertOne) UpdateNewValues() *GameRoleUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.GameRole.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(gamerole.FieldID)
		}),
	).
	Exec(ctx)

func (*GameRoleUpsertOne) UpdateNickName

func (u *GameRoleUpsertOne) UpdateNickName() *GameRoleUpsertOne

UpdateNickName sets the "nick_name" field to the value that was provided on create.

func (*GameRoleUpsertOne) UpdateRegion

func (u *GameRoleUpsertOne) UpdateRegion() *GameRoleUpsertOne

UpdateRegion sets the "region" field to the value that was provided on create.

func (*GameRoleUpsertOne) UpdateRegionName

func (u *GameRoleUpsertOne) UpdateRegionName() *GameRoleUpsertOne

UpdateRegionName sets the "region_name" field to the value that was provided on create.

func (*GameRoleUpsertOne) UpdateRoleID

func (u *GameRoleUpsertOne) UpdateRoleID() *GameRoleUpsertOne

UpdateRoleID sets the "role_id" field to the value that was provided on create.

func (*GameRoleUpsertOne) UpdateUpdateAt

func (u *GameRoleUpsertOne) UpdateUpdateAt() *GameRoleUpsertOne

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*GameRoleUpsertOne) UpdateUserID

func (u *GameRoleUpsertOne) UpdateUserID() *GameRoleUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

type GameRoles

type GameRoles []*GameRole

GameRoles is a parsable slice of GameRole.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// Chat is the client for interacting with the Chat builders.
	Chat *ChatClient
	// ChatOption is the client for interacting with the ChatOption builders.
	ChatOption *ChatOptionClient
	// GameAccount is the client for interacting with the GameAccount builders.
	GameAccount *GameAccountClient
	// GameRole is the client for interacting with the GameRole builders.
	GameRole *GameRoleClient
	// GameRoleAttribute is the client for interacting with the GameRoleAttribute builders.
	GameRoleAttribute *GameRoleAttributeClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) QueryContext

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int64 `json:"id,omitempty"`
	// UserID holds the value of the "user_id" field.
	UserID int64 `json:"user_id,omitempty"`
	// IsBot holds the value of the "is_bot" field.
	IsBot bool `json:"is_bot,omitempty"`
	// UserName holds the value of the "user_name" field.
	UserName string `json:"user_name,omitempty"`
	// FirstName holds the value of the "first_name" field.
	FirstName string `json:"first_name,omitempty"`
	// LastName holds the value of the "last_name" field.
	LastName string `json:"last_name,omitempty"`
	// CreateAt holds the value of the "create_at" field.
	CreateAt time.Time `json:"create_at,omitempty"`
	// UpdateAt holds the value of the "update_at" field.
	UpdateAt time.Time `json:"update_at,omitempty"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) ExecContext

func (c *User) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*User) QueryContext

func (c *User) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User 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 (*User) Update

func (u *User) Update() *UserUpdateOne

Update returns a builder for updating this User. Note that you need to call User.Unwrap() before calling this method if this User was returned from a transaction, and the transaction was committed or rolled back.

type UserClient

type UserClient struct {
	// contains filtered or unexported fields
}

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a builder for creating a User entity.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

CreateBulk returns a builder for creating a bulk of User entities.

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int64) *UserDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*UserClient) ExecContext

func (c *UserClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int64) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int64) *User

GetX is like Get, but panics if an error occurs.

func (*UserClient) Hooks

func (c *UserClient) Hooks() []Hook

Hooks returns the client hooks.

func (*UserClient) Intercept

func (c *UserClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `user.Intercept(f(g(h())))`.

func (*UserClient) Interceptors

func (c *UserClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) QueryContext

func (c *UserClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int64) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

func (c *UserClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `user.Hooks(f(g(h())))`.

type UserCreate

type UserCreate struct {
	// contains filtered or unexported fields
}

UserCreate is the builder for creating a User entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecContext

func (c *UserCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) OnConflict

func (uc *UserCreate) OnConflict(opts ...sql.ConflictOption) *UserUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.Create().
	SetUserID(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*UserCreate) OnConflictColumns

func (uc *UserCreate) OnConflictColumns(columns ...string) *UserUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreate) QueryContext

func (c *UserCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetCreateAt

func (uc *UserCreate) SetCreateAt(t time.Time) *UserCreate

SetCreateAt sets the "create_at" field.

func (*UserCreate) SetFirstName

func (uc *UserCreate) SetFirstName(s string) *UserCreate

SetFirstName sets the "first_name" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(i int64) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIsBot

func (uc *UserCreate) SetIsBot(b bool) *UserCreate

SetIsBot sets the "is_bot" field.

func (*UserCreate) SetLastName

func (uc *UserCreate) SetLastName(s string) *UserCreate

SetLastName sets the "last_name" field.

func (*UserCreate) SetNillableCreateAt

func (uc *UserCreate) SetNillableCreateAt(t *time.Time) *UserCreate

SetNillableCreateAt sets the "create_at" field if the given value is not nil.

func (*UserCreate) SetNillableFirstName

func (uc *UserCreate) SetNillableFirstName(s *string) *UserCreate

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*UserCreate) SetNillableIsBot

func (uc *UserCreate) SetNillableIsBot(b *bool) *UserCreate

SetNillableIsBot sets the "is_bot" field if the given value is not nil.

func (*UserCreate) SetNillableLastName

func (uc *UserCreate) SetNillableLastName(s *string) *UserCreate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*UserCreate) SetNillableUpdateAt

func (uc *UserCreate) SetNillableUpdateAt(t *time.Time) *UserCreate

SetNillableUpdateAt sets the "update_at" field if the given value is not nil.

func (*UserCreate) SetNillableUserName

func (uc *UserCreate) SetNillableUserName(s *string) *UserCreate

SetNillableUserName sets the "user_name" field if the given value is not nil.

func (*UserCreate) SetUpdateAt

func (uc *UserCreate) SetUpdateAt(t time.Time) *UserCreate

SetUpdateAt sets the "update_at" field.

func (*UserCreate) SetUserID

func (uc *UserCreate) SetUserID(i int64) *UserCreate

SetUserID sets the "user_id" field.

func (*UserCreate) SetUserName

func (uc *UserCreate) SetUserName(s string) *UserCreate

SetUserName sets the "user_name" field.

type UserCreateBulk

type UserCreateBulk struct {
	// contains filtered or unexported fields
}

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecContext

func (c *UserCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserCreateBulk) OnConflict

func (ucb *UserCreateBulk) OnConflict(opts ...sql.ConflictOption) *UserUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.User.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.UserUpsert) {
		SetUserID(v+v).
	}).
	Exec(ctx)

func (*UserCreateBulk) OnConflictColumns

func (ucb *UserCreateBulk) OnConflictColumns(columns ...string) *UserUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*UserCreateBulk) QueryContext

func (c *UserCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

SaveX is like Save, but panics if an error occurs.

type UserDelete

type UserDelete struct {
	// contains filtered or unexported fields
}

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*UserDelete) ExecContext

func (c *UserDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*UserDelete) QueryContext

func (c *UserDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

type UserDeleteOne struct {
	// contains filtered or unexported fields
}

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

type UserGroupBy

type UserGroupBy struct {
	// contains filtered or unexported fields
}

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*UserGroupBy) Bool

func (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolX

func (s *UserGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserGroupBy) Bools

func (s *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) BoolsX

func (s *UserGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*UserGroupBy) Float64

func (s *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64X

func (s *UserGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserGroupBy) Float64s

func (s *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) Float64sX

func (s *UserGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserGroupBy) Int

func (s *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntX

func (s *UserGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserGroupBy) Ints

func (s *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) IntsX

func (s *UserGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (s *UserGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserGroupBy) String

func (s *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringX

func (s *UserGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserGroupBy) Strings

func (s *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserGroupBy) StringsX

func (s *UserGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserMutation

type UserMutation struct {
	// contains filtered or unexported fields
}

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddField

func (m *UserMutation) 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 (*UserMutation) AddUserID

func (m *UserMutation) AddUserID(i int64)

AddUserID adds i to the "user_id" field.

func (*UserMutation) AddedEdges

func (m *UserMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*UserMutation) AddedField

func (m *UserMutation) 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 (*UserMutation) AddedFields

func (m *UserMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*UserMutation) AddedIDs

func (m *UserMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*UserMutation) AddedUserID

func (m *UserMutation) AddedUserID() (r int64, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*UserMutation) ClearEdge

func (m *UserMutation) 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 (*UserMutation) ClearField

func (m *UserMutation) 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 (*UserMutation) ClearedEdges

func (m *UserMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*UserMutation) ClearedFields

func (m *UserMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (UserMutation) Client

func (m UserMutation) 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 (*UserMutation) CreateAt

func (m *UserMutation) CreateAt() (r time.Time, exists bool)

CreateAt returns the value of the "create_at" field in the mutation.

func (*UserMutation) EdgeCleared

func (m *UserMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*UserMutation) ExecContext

func (c *UserMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserMutation) Field

func (m *UserMutation) 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 (*UserMutation) FieldCleared

func (m *UserMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*UserMutation) Fields

func (m *UserMutation) 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 (*UserMutation) FirstName

func (m *UserMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "first_name" field in the mutation.

func (*UserMutation) ID

func (m *UserMutation) 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 (*UserMutation) IDs

func (m *UserMutation) 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 (*UserMutation) IsBot

func (m *UserMutation) IsBot() (r bool, exists bool)

IsBot returns the value of the "is_bot" field in the mutation.

func (*UserMutation) LastName

func (m *UserMutation) LastName() (r string, exists bool)

LastName returns the value of the "last_name" field in the mutation.

func (*UserMutation) OldCreateAt

func (m *UserMutation) OldCreateAt(ctx context.Context) (v time.Time, err error)

OldCreateAt returns the old "create_at" field's value of the User entity. If the User 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 (*UserMutation) OldField

func (m *UserMutation) 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 (*UserMutation) OldFirstName

func (m *UserMutation) OldFirstName(ctx context.Context) (v string, err error)

OldFirstName returns the old "first_name" field's value of the User entity. If the User 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 (*UserMutation) OldIsBot

func (m *UserMutation) OldIsBot(ctx context.Context) (v bool, err error)

OldIsBot returns the old "is_bot" field's value of the User entity. If the User 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 (*UserMutation) OldLastName

func (m *UserMutation) OldLastName(ctx context.Context) (v string, err error)

OldLastName returns the old "last_name" field's value of the User entity. If the User 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 (*UserMutation) OldUpdateAt

func (m *UserMutation) OldUpdateAt(ctx context.Context) (v time.Time, err error)

OldUpdateAt returns the old "update_at" field's value of the User entity. If the User 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 (*UserMutation) OldUserID

func (m *UserMutation) OldUserID(ctx context.Context) (v int64, err error)

OldUserID returns the old "user_id" field's value of the User entity. If the User 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 (*UserMutation) OldUserName

func (m *UserMutation) OldUserName(ctx context.Context) (v string, err error)

OldUserName returns the old "user_name" field's value of the User entity. If the User 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 (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) QueryContext

func (c *UserMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserMutation) RemovedEdges

func (m *UserMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*UserMutation) RemovedIDs

func (m *UserMutation) 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 (*UserMutation) ResetCreateAt

func (m *UserMutation) ResetCreateAt()

ResetCreateAt resets all changes to the "create_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) 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 (*UserMutation) ResetField

func (m *UserMutation) 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 (*UserMutation) ResetFirstName

func (m *UserMutation) ResetFirstName()

ResetFirstName resets all changes to the "first_name" field.

func (*UserMutation) ResetIsBot

func (m *UserMutation) ResetIsBot()

ResetIsBot resets all changes to the "is_bot" field.

func (*UserMutation) ResetLastName

func (m *UserMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*UserMutation) ResetUpdateAt

func (m *UserMutation) ResetUpdateAt()

ResetUpdateAt resets all changes to the "update_at" field.

func (*UserMutation) ResetUserID

func (m *UserMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*UserMutation) ResetUserName

func (m *UserMutation) ResetUserName()

ResetUserName resets all changes to the "user_name" field.

func (*UserMutation) SetCreateAt

func (m *UserMutation) SetCreateAt(t time.Time)

SetCreateAt sets the "create_at" field.

func (*UserMutation) SetField

func (m *UserMutation) 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 (*UserMutation) SetFirstName

func (m *UserMutation) SetFirstName(s string)

SetFirstName sets the "first_name" field.

func (*UserMutation) SetID

func (m *UserMutation) SetID(id int64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of User entities.

func (*UserMutation) SetIsBot

func (m *UserMutation) SetIsBot(b bool)

SetIsBot sets the "is_bot" field.

func (*UserMutation) SetLastName

func (m *UserMutation) SetLastName(s string)

SetLastName sets the "last_name" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetUpdateAt

func (m *UserMutation) SetUpdateAt(t time.Time)

SetUpdateAt sets the "update_at" field.

func (*UserMutation) SetUserID

func (m *UserMutation) SetUserID(i int64)

SetUserID sets the "user_id" field.

func (*UserMutation) SetUserName

func (m *UserMutation) SetUserName(s string)

SetUserName sets the "user_name" field.

func (UserMutation) Tx

func (m UserMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*UserMutation) Type

func (m *UserMutation) Type() string

Type returns the node type of this mutation (User).

func (*UserMutation) UpdateAt

func (m *UserMutation) UpdateAt() (r time.Time, exists bool)

UpdateAt returns the value of the "update_at" field in the mutation.

func (*UserMutation) UserID

func (m *UserMutation) UserID() (r int64, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*UserMutation) UserName

func (m *UserMutation) UserName() (r string, exists bool)

UserName returns the value of the "user_name" field in the mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

func (m *UserMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the UserMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

AllX is like All, but panics if an error occurs.

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

Clone returns a duplicate of the UserQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*UserQuery) ExecContext

func (c *UserQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

First returns the first User entity from the query. Returns a *NotFoundError when no User was found.

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int64, err error)

FirstID returns the first User ID from the query. Returns a *NotFoundError when no User ID was found.

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int64

FirstIDX is like FirstID, but panics if an error occurs.

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

FirstX is like First, but panics if an error occurs.

func (*UserQuery) ForShare

func (uq *UserQuery) ForShare(opts ...sql.LockOption) *UserQuery

ForShare behaves similarly to ForUpdate, except that it acquires a shared mode lock on any rows that are read. Other sessions can read the rows, but cannot modify them until your transaction commits.

func (*UserQuery) ForUpdate

func (uq *UserQuery) ForUpdate(opts ...sql.LockOption) *UserQuery

ForUpdate locks the selected rows against concurrent updates, and prevent them from being updated, deleted or "selected ... for update" by other sessions, until the transaction is either committed or rolled-back.

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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 {
	UserID int64 `json:"user_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldUserID).
	Aggregate(entity.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []int64, err error)

IDs executes the query and returns a list of User IDs.

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int64

IDsX is like IDs, but panics if an error occurs.

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit the number of records to be returned by this query.

func (*UserQuery) Modify

func (uq *UserQuery) Modify(modifiers ...func(s *sql.Selector)) *UserSelect

Modify adds a query modifier for attaching custom logic to queries.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

Only returns a single User entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one User entity is found. Returns a *NotFoundError when no User entities are found.

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int64, err error)

OnlyID is like Only, but returns the only User ID in the query. Returns a *NotSingularError when more than one User ID is found. Returns a *NotFoundError when no entities are found.

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

OnlyX is like Only, but panics if an error occurs.

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order specifies how the records should be ordered.

func (*UserQuery) QueryContext

func (c *UserQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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 {
	UserID int64 `json:"user_id,omitempty"`
}

client.User.Query().
	Select(user.FieldUserID).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

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 (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *UserSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolX

func (s *UserSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*UserSelect) Bools

func (s *UserSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*UserSelect) BoolsX

func (s *UserSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (UserSelect) ExecContext

func (c UserSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserSelect) Float64

func (s *UserSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64X

func (s *UserSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*UserSelect) Float64s

func (s *UserSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*UserSelect) Float64sX

func (s *UserSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*UserSelect) Int

func (s *UserSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntX

func (s *UserSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*UserSelect) Ints

func (s *UserSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*UserSelect) IntsX

func (s *UserSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*UserSelect) Modify

func (us *UserSelect) Modify(modifiers ...func(s *sql.Selector)) *UserSelect

Modify adds a query modifier for attaching custom logic to queries.

func (UserSelect) QueryContext

func (c UserSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*UserSelect) ScanX

func (s *UserSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*UserSelect) String

func (s *UserSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringX

func (s *UserSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*UserSelect) Strings

func (s *UserSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*UserSelect) StringsX

func (s *UserSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type UserUpdate

type UserUpdate struct {
	// contains filtered or unexported fields
}

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddUserID

func (uu *UserUpdate) AddUserID(i int64) *UserUpdate

AddUserID adds i to the "user_id" field.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecContext

func (c *UserUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdate) Modify

func (uu *UserUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdate

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) QueryContext

func (c *UserUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*UserUpdate) SetFirstName

func (uu *UserUpdate) SetFirstName(s string) *UserUpdate

SetFirstName sets the "first_name" field.

func (*UserUpdate) SetIsBot

func (uu *UserUpdate) SetIsBot(b bool) *UserUpdate

SetIsBot sets the "is_bot" field.

func (*UserUpdate) SetLastName

func (uu *UserUpdate) SetLastName(s string) *UserUpdate

SetLastName sets the "last_name" field.

func (*UserUpdate) SetNillableFirstName

func (uu *UserUpdate) SetNillableFirstName(s *string) *UserUpdate

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*UserUpdate) SetNillableIsBot

func (uu *UserUpdate) SetNillableIsBot(b *bool) *UserUpdate

SetNillableIsBot sets the "is_bot" field if the given value is not nil.

func (*UserUpdate) SetNillableLastName

func (uu *UserUpdate) SetNillableLastName(s *string) *UserUpdate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*UserUpdate) SetNillableUserName

func (uu *UserUpdate) SetNillableUserName(s *string) *UserUpdate

SetNillableUserName sets the "user_name" field if the given value is not nil.

func (*UserUpdate) SetUpdateAt

func (uu *UserUpdate) SetUpdateAt(t time.Time) *UserUpdate

SetUpdateAt sets the "update_at" field.

func (*UserUpdate) SetUserID

func (uu *UserUpdate) SetUserID(i int64) *UserUpdate

SetUserID sets the "user_id" field.

func (*UserUpdate) SetUserName

func (uu *UserUpdate) SetUserName(s string) *UserUpdate

SetUserName sets the "user_name" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

type UserUpdateOne struct {
	// contains filtered or unexported fields
}

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddUserID

func (uuo *UserUpdateOne) AddUserID(i int64) *UserUpdateOne

AddUserID adds i to the "user_id" field.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecContext

func (c *UserUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpdateOne) Modify

func (uuo *UserUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *UserUpdateOne

Modify adds a statement modifier for attaching custom logic to the UPDATE statement.

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) QueryContext

func (c *UserUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

SaveX is like Save, but panics if an error occurs.

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*UserUpdateOne) SetFirstName

func (uuo *UserUpdateOne) SetFirstName(s string) *UserUpdateOne

SetFirstName sets the "first_name" field.

func (*UserUpdateOne) SetIsBot

func (uuo *UserUpdateOne) SetIsBot(b bool) *UserUpdateOne

SetIsBot sets the "is_bot" field.

func (*UserUpdateOne) SetLastName

func (uuo *UserUpdateOne) SetLastName(s string) *UserUpdateOne

SetLastName sets the "last_name" field.

func (*UserUpdateOne) SetNillableFirstName

func (uuo *UserUpdateOne) SetNillableFirstName(s *string) *UserUpdateOne

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIsBot

func (uuo *UserUpdateOne) SetNillableIsBot(b *bool) *UserUpdateOne

SetNillableIsBot sets the "is_bot" field if the given value is not nil.

func (*UserUpdateOne) SetNillableLastName

func (uuo *UserUpdateOne) SetNillableLastName(s *string) *UserUpdateOne

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*UserUpdateOne) SetNillableUserName

func (uuo *UserUpdateOne) SetNillableUserName(s *string) *UserUpdateOne

SetNillableUserName sets the "user_name" field if the given value is not nil.

func (*UserUpdateOne) SetUpdateAt

func (uuo *UserUpdateOne) SetUpdateAt(t time.Time) *UserUpdateOne

SetUpdateAt sets the "update_at" field.

func (*UserUpdateOne) SetUserID

func (uuo *UserUpdateOne) SetUserID(i int64) *UserUpdateOne

SetUserID sets the "user_id" field.

func (*UserUpdateOne) SetUserName

func (uuo *UserUpdateOne) SetUserName(s string) *UserUpdateOne

SetUserName sets the "user_name" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

type UserUpsert

type UserUpsert struct {
	*sql.UpdateSet
}

UserUpsert is the "OnConflict" setter.

func (*UserUpsert) AddUserID

func (u *UserUpsert) AddUserID(v int64) *UserUpsert

AddUserID adds v to the "user_id" field.

func (*UserUpsert) SetFirstName

func (u *UserUpsert) SetFirstName(v string) *UserUpsert

SetFirstName sets the "first_name" field.

func (*UserUpsert) SetIsBot

func (u *UserUpsert) SetIsBot(v bool) *UserUpsert

SetIsBot sets the "is_bot" field.

func (*UserUpsert) SetLastName

func (u *UserUpsert) SetLastName(v string) *UserUpsert

SetLastName sets the "last_name" field.

func (*UserUpsert) SetUpdateAt

func (u *UserUpsert) SetUpdateAt(v time.Time) *UserUpsert

SetUpdateAt sets the "update_at" field.

func (*UserUpsert) SetUserID

func (u *UserUpsert) SetUserID(v int64) *UserUpsert

SetUserID sets the "user_id" field.

func (*UserUpsert) SetUserName

func (u *UserUpsert) SetUserName(v string) *UserUpsert

SetUserName sets the "user_name" field.

func (*UserUpsert) UpdateFirstName

func (u *UserUpsert) UpdateFirstName() *UserUpsert

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*UserUpsert) UpdateIsBot

func (u *UserUpsert) UpdateIsBot() *UserUpsert

UpdateIsBot sets the "is_bot" field to the value that was provided on create.

func (*UserUpsert) UpdateLastName

func (u *UserUpsert) UpdateLastName() *UserUpsert

UpdateLastName sets the "last_name" field to the value that was provided on create.

func (*UserUpsert) UpdateUpdateAt

func (u *UserUpsert) UpdateUpdateAt() *UserUpsert

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*UserUpsert) UpdateUserID

func (u *UserUpsert) UpdateUserID() *UserUpsert

UpdateUserID sets the "user_id" field to the value that was provided on create.

func (*UserUpsert) UpdateUserName

func (u *UserUpsert) UpdateUserName() *UserUpsert

UpdateUserName sets the "user_name" field to the value that was provided on create.

type UserUpsertBulk

type UserUpsertBulk struct {
	// contains filtered or unexported fields
}

UserUpsertBulk is the builder for "upsert"-ing a bulk of User nodes.

func (*UserUpsertBulk) AddUserID

func (u *UserUpsertBulk) AddUserID(v int64) *UserUpsertBulk

AddUserID adds v to the "user_id" field.

func (*UserUpsertBulk) DoNothing

func (u *UserUpsertBulk) DoNothing() *UserUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertBulk) Exec

func (u *UserUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertBulk) ExecX

func (u *UserUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertBulk) Ignore

func (u *UserUpsertBulk) Ignore() *UserUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*UserUpsertBulk) SetFirstName

func (u *UserUpsertBulk) SetFirstName(v string) *UserUpsertBulk

SetFirstName sets the "first_name" field.

func (*UserUpsertBulk) SetIsBot

func (u *UserUpsertBulk) SetIsBot(v bool) *UserUpsertBulk

SetIsBot sets the "is_bot" field.

func (*UserUpsertBulk) SetLastName

func (u *UserUpsertBulk) SetLastName(v string) *UserUpsertBulk

SetLastName sets the "last_name" field.

func (*UserUpsertBulk) SetUpdateAt

func (u *UserUpsertBulk) SetUpdateAt(v time.Time) *UserUpsertBulk

SetUpdateAt sets the "update_at" field.

func (*UserUpsertBulk) SetUserID

func (u *UserUpsertBulk) SetUserID(v int64) *UserUpsertBulk

SetUserID sets the "user_id" field.

func (*UserUpsertBulk) SetUserName

func (u *UserUpsertBulk) SetUserName(v string) *UserUpsertBulk

SetUserName sets the "user_name" field.

func (*UserUpsertBulk) Update

func (u *UserUpsertBulk) Update(set func(*UserUpsert)) *UserUpsertBulk

Update allows overriding fields `UPDATE` values. See the UserCreateBulk.OnConflict documentation for more info.

func (*UserUpsertBulk) UpdateFirstName

func (u *UserUpsertBulk) UpdateFirstName() *UserUpsertBulk

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateIsBot

func (u *UserUpsertBulk) UpdateIsBot() *UserUpsertBulk

UpdateIsBot sets the "is_bot" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateLastName

func (u *UserUpsertBulk) UpdateLastName() *UserUpsertBulk

UpdateLastName sets the "last_name" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateNewValues

func (u *UserUpsertBulk) UpdateNewValues() *UserUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertBulk) UpdateUpdateAt

func (u *UserUpsertBulk) UpdateUpdateAt() *UserUpsertBulk

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUserID

func (u *UserUpsertBulk) UpdateUserID() *UserUpsertBulk

UpdateUserID sets the "user_id" field to the value that was provided on create.

func (*UserUpsertBulk) UpdateUserName

func (u *UserUpsertBulk) UpdateUserName() *UserUpsertBulk

UpdateUserName sets the "user_name" field to the value that was provided on create.

type UserUpsertOne

type UserUpsertOne struct {
	// contains filtered or unexported fields
}

UserUpsertOne is the builder for "upsert"-ing

one User node.

func (*UserUpsertOne) AddUserID

func (u *UserUpsertOne) AddUserID(v int64) *UserUpsertOne

AddUserID adds v to the "user_id" field.

func (*UserUpsertOne) DoNothing

func (u *UserUpsertOne) DoNothing() *UserUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*UserUpsertOne) Exec

func (u *UserUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpsertOne) ExecX

func (u *UserUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*UserUpsertOne) ID

func (u *UserUpsertOne) ID(ctx context.Context) (id int64, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*UserUpsertOne) IDX

func (u *UserUpsertOne) IDX(ctx context.Context) int64

IDX is like ID, but panics if an error occurs.

func (*UserUpsertOne) Ignore

func (u *UserUpsertOne) Ignore() *UserUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.User.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*UserUpsertOne) SetFirstName

func (u *UserUpsertOne) SetFirstName(v string) *UserUpsertOne

SetFirstName sets the "first_name" field.

func (*UserUpsertOne) SetIsBot

func (u *UserUpsertOne) SetIsBot(v bool) *UserUpsertOne

SetIsBot sets the "is_bot" field.

func (*UserUpsertOne) SetLastName

func (u *UserUpsertOne) SetLastName(v string) *UserUpsertOne

SetLastName sets the "last_name" field.

func (*UserUpsertOne) SetUpdateAt

func (u *UserUpsertOne) SetUpdateAt(v time.Time) *UserUpsertOne

SetUpdateAt sets the "update_at" field.

func (*UserUpsertOne) SetUserID

func (u *UserUpsertOne) SetUserID(v int64) *UserUpsertOne

SetUserID sets the "user_id" field.

func (*UserUpsertOne) SetUserName

func (u *UserUpsertOne) SetUserName(v string) *UserUpsertOne

SetUserName sets the "user_name" field.

func (*UserUpsertOne) Update

func (u *UserUpsertOne) Update(set func(*UserUpsert)) *UserUpsertOne

Update allows overriding fields `UPDATE` values. See the UserCreate.OnConflict documentation for more info.

func (*UserUpsertOne) UpdateFirstName

func (u *UserUpsertOne) UpdateFirstName() *UserUpsertOne

UpdateFirstName sets the "first_name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateIsBot

func (u *UserUpsertOne) UpdateIsBot() *UserUpsertOne

UpdateIsBot sets the "is_bot" field to the value that was provided on create.

func (*UserUpsertOne) UpdateLastName

func (u *UserUpsertOne) UpdateLastName() *UserUpsertOne

UpdateLastName sets the "last_name" field to the value that was provided on create.

func (*UserUpsertOne) UpdateNewValues

func (u *UserUpsertOne) UpdateNewValues() *UserUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.User.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(user.FieldID)
		}),
	).
	Exec(ctx)

func (*UserUpsertOne) UpdateUpdateAt

func (u *UserUpsertOne) UpdateUpdateAt() *UserUpsertOne

UpdateUpdateAt sets the "update_at" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUserID

func (u *UserUpsertOne) UpdateUserID() *UserUpsertOne

UpdateUserID sets the "user_id" field to the value that was provided on create.

func (*UserUpsertOne) UpdateUserName

func (u *UserUpsertOne) UpdateUserName() *UserUpsertOne

UpdateUserName sets the "user_name" field to the value that was provided on create.

type Users

type Users []*User

Users is a parsable slice of User.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL