Documentation ¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type AggregateFunc
- type Client
- func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
- func (c *Client) Close() error
- func (c *Client) Debug() *Client
- func (c *Client) Intercept(interceptors ...Interceptor)
- func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)
- func (c *Client) Ping() error
- func (c *Client) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Guild
- type GuildClient
- func (c *GuildClient) Create() *GuildCreate
- func (c *GuildClient) CreateBulk(builders ...*GuildCreate) *GuildCreateBulk
- func (c *GuildClient) Delete() *GuildDelete
- func (c *GuildClient) DeleteOne(gu *Guild) *GuildDeleteOne
- func (c *GuildClient) DeleteOneID(id snowflake.ID) *GuildDeleteOne
- func (c *GuildClient) Get(ctx context.Context, id snowflake.ID) (*Guild, error)
- func (c *GuildClient) GetX(ctx context.Context, id snowflake.ID) *Guild
- func (c *GuildClient) Hooks() []Hook
- func (c *GuildClient) Intercept(interceptors ...Interceptor)
- func (c *GuildClient) Interceptors() []Interceptor
- func (c *GuildClient) Query() *GuildQuery
- func (c *GuildClient) Update() *GuildUpdate
- func (c *GuildClient) UpdateOne(gu *Guild) *GuildUpdateOne
- func (c *GuildClient) UpdateOneID(id snowflake.ID) *GuildUpdateOne
- func (c *GuildClient) Use(hooks ...Hook)
- type GuildCreate
- func (gc *GuildCreate) Exec(ctx context.Context) error
- func (gc *GuildCreate) ExecX(ctx context.Context)
- func (gc *GuildCreate) Mutation() *GuildMutation
- func (gc *GuildCreate) OnConflict(opts ...sql.ConflictOption) *GuildUpsertOne
- func (gc *GuildCreate) OnConflictColumns(columns ...string) *GuildUpsertOne
- func (gc *GuildCreate) Save(ctx context.Context) (*Guild, error)
- func (gc *GuildCreate) SaveX(ctx context.Context) *Guild
- func (gc *GuildCreate) SetCreatedAt(t time.Time) *GuildCreate
- func (gc *GuildCreate) SetID(s snowflake.ID) *GuildCreate
- func (gc *GuildCreate) SetName(s string) *GuildCreate
- func (gc *GuildCreate) SetNillableCreatedAt(t *time.Time) *GuildCreate
- func (gc *GuildCreate) SetNillablePlayerChannelID(s *snowflake.ID) *GuildCreate
- func (gc *GuildCreate) SetNillablePlayerMessageID(s *snowflake.ID) *GuildCreate
- func (gc *GuildCreate) SetNillableUpdatedAt(t *time.Time) *GuildCreate
- func (gc *GuildCreate) SetPlayerChannelID(s snowflake.ID) *GuildCreate
- func (gc *GuildCreate) SetPlayerMessageID(s snowflake.ID) *GuildCreate
- func (gc *GuildCreate) SetUpdatedAt(t time.Time) *GuildCreate
- type GuildCreateBulk
- func (gcb *GuildCreateBulk) Exec(ctx context.Context) error
- func (gcb *GuildCreateBulk) ExecX(ctx context.Context)
- func (gcb *GuildCreateBulk) OnConflict(opts ...sql.ConflictOption) *GuildUpsertBulk
- func (gcb *GuildCreateBulk) OnConflictColumns(columns ...string) *GuildUpsertBulk
- func (gcb *GuildCreateBulk) Save(ctx context.Context) ([]*Guild, error)
- func (gcb *GuildCreateBulk) SaveX(ctx context.Context) []*Guild
- type GuildDelete
- type GuildDeleteOne
- type GuildGroupBy
- func (ggb *GuildGroupBy) Aggregate(fns ...AggregateFunc) *GuildGroupBy
- func (s *GuildGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *GuildGroupBy) BoolX(ctx context.Context) bool
- func (s *GuildGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *GuildGroupBy) BoolsX(ctx context.Context) []bool
- func (s *GuildGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *GuildGroupBy) Float64X(ctx context.Context) float64
- func (s *GuildGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *GuildGroupBy) Float64sX(ctx context.Context) []float64
- func (s *GuildGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *GuildGroupBy) IntX(ctx context.Context) int
- func (s *GuildGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *GuildGroupBy) IntsX(ctx context.Context) []int
- func (ggb *GuildGroupBy) Scan(ctx context.Context, v any) error
- func (s *GuildGroupBy) ScanX(ctx context.Context, v any)
- func (s *GuildGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *GuildGroupBy) StringX(ctx context.Context) string
- func (s *GuildGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *GuildGroupBy) StringsX(ctx context.Context) []string
- type GuildMutation
- func (m *GuildMutation) AddField(name string, value ent.Value) error
- func (m *GuildMutation) AddPlayerChannelID(s snowflake.ID)
- func (m *GuildMutation) AddPlayerMessageID(s snowflake.ID)
- func (m *GuildMutation) AddedEdges() []string
- func (m *GuildMutation) AddedField(name string) (ent.Value, bool)
- func (m *GuildMutation) AddedFields() []string
- func (m *GuildMutation) AddedIDs(name string) []ent.Value
- func (m *GuildMutation) AddedPlayerChannelID() (r snowflake.ID, exists bool)
- func (m *GuildMutation) AddedPlayerMessageID() (r snowflake.ID, exists bool)
- func (m *GuildMutation) ClearEdge(name string) error
- func (m *GuildMutation) ClearField(name string) error
- func (m *GuildMutation) ClearPlayerChannelID()
- func (m *GuildMutation) ClearPlayerMessageID()
- func (m *GuildMutation) ClearedEdges() []string
- func (m *GuildMutation) ClearedFields() []string
- func (m GuildMutation) Client() *Client
- func (m *GuildMutation) CreatedAt() (r time.Time, exists bool)
- func (m *GuildMutation) EdgeCleared(name string) bool
- func (m *GuildMutation) Field(name string) (ent.Value, bool)
- func (m *GuildMutation) FieldCleared(name string) bool
- func (m *GuildMutation) Fields() []string
- func (m *GuildMutation) ID() (id snowflake.ID, exists bool)
- func (m *GuildMutation) IDs(ctx context.Context) ([]snowflake.ID, error)
- func (m *GuildMutation) Name() (r string, exists bool)
- func (m *GuildMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *GuildMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *GuildMutation) OldName(ctx context.Context) (v string, err error)
- func (m *GuildMutation) OldPlayerChannelID(ctx context.Context) (v *snowflake.ID, err error)
- func (m *GuildMutation) OldPlayerMessageID(ctx context.Context) (v *snowflake.ID, err error)
- func (m *GuildMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)
- func (m *GuildMutation) Op() Op
- func (m *GuildMutation) PlayerChannelID() (r snowflake.ID, exists bool)
- func (m *GuildMutation) PlayerChannelIDCleared() bool
- func (m *GuildMutation) PlayerMessageID() (r snowflake.ID, exists bool)
- func (m *GuildMutation) PlayerMessageIDCleared() bool
- func (m *GuildMutation) RemovedEdges() []string
- func (m *GuildMutation) RemovedIDs(name string) []ent.Value
- func (m *GuildMutation) ResetCreatedAt()
- func (m *GuildMutation) ResetEdge(name string) error
- func (m *GuildMutation) ResetField(name string) error
- func (m *GuildMutation) ResetName()
- func (m *GuildMutation) ResetPlayerChannelID()
- func (m *GuildMutation) ResetPlayerMessageID()
- func (m *GuildMutation) ResetUpdatedAt()
- func (m *GuildMutation) SetCreatedAt(t time.Time)
- func (m *GuildMutation) SetField(name string, value ent.Value) error
- func (m *GuildMutation) SetID(id snowflake.ID)
- func (m *GuildMutation) SetName(s string)
- func (m *GuildMutation) SetOp(op Op)
- func (m *GuildMutation) SetPlayerChannelID(s snowflake.ID)
- func (m *GuildMutation) SetPlayerMessageID(s snowflake.ID)
- func (m *GuildMutation) SetUpdatedAt(t time.Time)
- func (m GuildMutation) Tx() (*Tx, error)
- func (m *GuildMutation) Type() string
- func (m *GuildMutation) UpdatedAt() (r time.Time, exists bool)
- func (m *GuildMutation) Where(ps ...predicate.Guild)
- func (m *GuildMutation) WhereP(ps ...func(*sql.Selector))
- type GuildQuery
- func (gq *GuildQuery) Aggregate(fns ...AggregateFunc) *GuildSelect
- func (gq *GuildQuery) All(ctx context.Context) ([]*Guild, error)
- func (gq *GuildQuery) AllX(ctx context.Context) []*Guild
- func (gq *GuildQuery) Clone() *GuildQuery
- func (gq *GuildQuery) Count(ctx context.Context) (int, error)
- func (gq *GuildQuery) CountX(ctx context.Context) int
- func (gq *GuildQuery) Exist(ctx context.Context) (bool, error)
- func (gq *GuildQuery) ExistX(ctx context.Context) bool
- func (gq *GuildQuery) First(ctx context.Context) (*Guild, error)
- func (gq *GuildQuery) FirstID(ctx context.Context) (id snowflake.ID, err error)
- func (gq *GuildQuery) FirstIDX(ctx context.Context) snowflake.ID
- func (gq *GuildQuery) FirstX(ctx context.Context) *Guild
- func (gq *GuildQuery) GroupBy(field string, fields ...string) *GuildGroupBy
- func (gq *GuildQuery) IDs(ctx context.Context) (ids []snowflake.ID, err error)
- func (gq *GuildQuery) IDsX(ctx context.Context) []snowflake.ID
- func (gq *GuildQuery) Limit(limit int) *GuildQuery
- func (gq *GuildQuery) Offset(offset int) *GuildQuery
- func (gq *GuildQuery) Only(ctx context.Context) (*Guild, error)
- func (gq *GuildQuery) OnlyID(ctx context.Context) (id snowflake.ID, err error)
- func (gq *GuildQuery) OnlyIDX(ctx context.Context) snowflake.ID
- func (gq *GuildQuery) OnlyX(ctx context.Context) *Guild
- func (gq *GuildQuery) Order(o ...OrderFunc) *GuildQuery
- func (gq *GuildQuery) Select(fields ...string) *GuildSelect
- func (gq *GuildQuery) Unique(unique bool) *GuildQuery
- func (gq *GuildQuery) Where(ps ...predicate.Guild) *GuildQuery
- type GuildSelect
- func (gs *GuildSelect) Aggregate(fns ...AggregateFunc) *GuildSelect
- func (s *GuildSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *GuildSelect) BoolX(ctx context.Context) bool
- func (s *GuildSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *GuildSelect) BoolsX(ctx context.Context) []bool
- func (s *GuildSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *GuildSelect) Float64X(ctx context.Context) float64
- func (s *GuildSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *GuildSelect) Float64sX(ctx context.Context) []float64
- func (s *GuildSelect) Int(ctx context.Context) (_ int, err error)
- func (s *GuildSelect) IntX(ctx context.Context) int
- func (s *GuildSelect) Ints(ctx context.Context) ([]int, error)
- func (s *GuildSelect) IntsX(ctx context.Context) []int
- func (gs *GuildSelect) Scan(ctx context.Context, v any) error
- func (s *GuildSelect) ScanX(ctx context.Context, v any)
- func (s *GuildSelect) String(ctx context.Context) (_ string, err error)
- func (s *GuildSelect) StringX(ctx context.Context) string
- func (s *GuildSelect) Strings(ctx context.Context) ([]string, error)
- func (s *GuildSelect) StringsX(ctx context.Context) []string
- type GuildUpdate
- func (gu *GuildUpdate) AddPlayerChannelID(s snowflake.ID) *GuildUpdate
- func (gu *GuildUpdate) AddPlayerMessageID(s snowflake.ID) *GuildUpdate
- func (gu *GuildUpdate) ClearPlayerChannelID() *GuildUpdate
- func (gu *GuildUpdate) ClearPlayerMessageID() *GuildUpdate
- func (gu *GuildUpdate) Exec(ctx context.Context) error
- func (gu *GuildUpdate) ExecX(ctx context.Context)
- func (gu *GuildUpdate) Mutation() *GuildMutation
- func (gu *GuildUpdate) Save(ctx context.Context) (int, error)
- func (gu *GuildUpdate) SaveX(ctx context.Context) int
- func (gu *GuildUpdate) SetCreatedAt(t time.Time) *GuildUpdate
- func (gu *GuildUpdate) SetName(s string) *GuildUpdate
- func (gu *GuildUpdate) SetNillableCreatedAt(t *time.Time) *GuildUpdate
- func (gu *GuildUpdate) SetNillablePlayerChannelID(s *snowflake.ID) *GuildUpdate
- func (gu *GuildUpdate) SetNillablePlayerMessageID(s *snowflake.ID) *GuildUpdate
- func (gu *GuildUpdate) SetPlayerChannelID(s snowflake.ID) *GuildUpdate
- func (gu *GuildUpdate) SetPlayerMessageID(s snowflake.ID) *GuildUpdate
- func (gu *GuildUpdate) SetUpdatedAt(t time.Time) *GuildUpdate
- func (gu *GuildUpdate) Where(ps ...predicate.Guild) *GuildUpdate
- type GuildUpdateOne
- func (guo *GuildUpdateOne) AddPlayerChannelID(s snowflake.ID) *GuildUpdateOne
- func (guo *GuildUpdateOne) AddPlayerMessageID(s snowflake.ID) *GuildUpdateOne
- func (guo *GuildUpdateOne) ClearPlayerChannelID() *GuildUpdateOne
- func (guo *GuildUpdateOne) ClearPlayerMessageID() *GuildUpdateOne
- func (guo *GuildUpdateOne) Exec(ctx context.Context) error
- func (guo *GuildUpdateOne) ExecX(ctx context.Context)
- func (guo *GuildUpdateOne) Mutation() *GuildMutation
- func (guo *GuildUpdateOne) Save(ctx context.Context) (*Guild, error)
- func (guo *GuildUpdateOne) SaveX(ctx context.Context) *Guild
- func (guo *GuildUpdateOne) Select(field string, fields ...string) *GuildUpdateOne
- func (guo *GuildUpdateOne) SetCreatedAt(t time.Time) *GuildUpdateOne
- func (guo *GuildUpdateOne) SetName(s string) *GuildUpdateOne
- func (guo *GuildUpdateOne) SetNillableCreatedAt(t *time.Time) *GuildUpdateOne
- func (guo *GuildUpdateOne) SetNillablePlayerChannelID(s *snowflake.ID) *GuildUpdateOne
- func (guo *GuildUpdateOne) SetNillablePlayerMessageID(s *snowflake.ID) *GuildUpdateOne
- func (guo *GuildUpdateOne) SetPlayerChannelID(s snowflake.ID) *GuildUpdateOne
- func (guo *GuildUpdateOne) SetPlayerMessageID(s snowflake.ID) *GuildUpdateOne
- func (guo *GuildUpdateOne) SetUpdatedAt(t time.Time) *GuildUpdateOne
- func (guo *GuildUpdateOne) Where(ps ...predicate.Guild) *GuildUpdateOne
- type GuildUpsert
- func (u *GuildUpsert) AddPlayerChannelID(v snowflake.ID) *GuildUpsert
- func (u *GuildUpsert) AddPlayerMessageID(v snowflake.ID) *GuildUpsert
- func (u *GuildUpsert) ClearPlayerChannelID() *GuildUpsert
- func (u *GuildUpsert) ClearPlayerMessageID() *GuildUpsert
- func (u *GuildUpsert) SetCreatedAt(v time.Time) *GuildUpsert
- func (u *GuildUpsert) SetName(v string) *GuildUpsert
- func (u *GuildUpsert) SetPlayerChannelID(v snowflake.ID) *GuildUpsert
- func (u *GuildUpsert) SetPlayerMessageID(v snowflake.ID) *GuildUpsert
- func (u *GuildUpsert) SetUpdatedAt(v time.Time) *GuildUpsert
- func (u *GuildUpsert) UpdateCreatedAt() *GuildUpsert
- func (u *GuildUpsert) UpdateName() *GuildUpsert
- func (u *GuildUpsert) UpdatePlayerChannelID() *GuildUpsert
- func (u *GuildUpsert) UpdatePlayerMessageID() *GuildUpsert
- func (u *GuildUpsert) UpdateUpdatedAt() *GuildUpsert
- type GuildUpsertBulk
- func (u *GuildUpsertBulk) AddPlayerChannelID(v snowflake.ID) *GuildUpsertBulk
- func (u *GuildUpsertBulk) AddPlayerMessageID(v snowflake.ID) *GuildUpsertBulk
- func (u *GuildUpsertBulk) ClearPlayerChannelID() *GuildUpsertBulk
- func (u *GuildUpsertBulk) ClearPlayerMessageID() *GuildUpsertBulk
- func (u *GuildUpsertBulk) DoNothing() *GuildUpsertBulk
- func (u *GuildUpsertBulk) Exec(ctx context.Context) error
- func (u *GuildUpsertBulk) ExecX(ctx context.Context)
- func (u *GuildUpsertBulk) Ignore() *GuildUpsertBulk
- func (u *GuildUpsertBulk) SetCreatedAt(v time.Time) *GuildUpsertBulk
- func (u *GuildUpsertBulk) SetName(v string) *GuildUpsertBulk
- func (u *GuildUpsertBulk) SetPlayerChannelID(v snowflake.ID) *GuildUpsertBulk
- func (u *GuildUpsertBulk) SetPlayerMessageID(v snowflake.ID) *GuildUpsertBulk
- func (u *GuildUpsertBulk) SetUpdatedAt(v time.Time) *GuildUpsertBulk
- func (u *GuildUpsertBulk) Update(set func(*GuildUpsert)) *GuildUpsertBulk
- func (u *GuildUpsertBulk) UpdateCreatedAt() *GuildUpsertBulk
- func (u *GuildUpsertBulk) UpdateName() *GuildUpsertBulk
- func (u *GuildUpsertBulk) UpdateNewValues() *GuildUpsertBulk
- func (u *GuildUpsertBulk) UpdatePlayerChannelID() *GuildUpsertBulk
- func (u *GuildUpsertBulk) UpdatePlayerMessageID() *GuildUpsertBulk
- func (u *GuildUpsertBulk) UpdateUpdatedAt() *GuildUpsertBulk
- type GuildUpsertOne
- func (u *GuildUpsertOne) AddPlayerChannelID(v snowflake.ID) *GuildUpsertOne
- func (u *GuildUpsertOne) AddPlayerMessageID(v snowflake.ID) *GuildUpsertOne
- func (u *GuildUpsertOne) ClearPlayerChannelID() *GuildUpsertOne
- func (u *GuildUpsertOne) ClearPlayerMessageID() *GuildUpsertOne
- func (u *GuildUpsertOne) DoNothing() *GuildUpsertOne
- func (u *GuildUpsertOne) Exec(ctx context.Context) error
- func (u *GuildUpsertOne) ExecX(ctx context.Context)
- func (u *GuildUpsertOne) ID(ctx context.Context) (id snowflake.ID, err error)
- func (u *GuildUpsertOne) IDX(ctx context.Context) snowflake.ID
- func (u *GuildUpsertOne) Ignore() *GuildUpsertOne
- func (u *GuildUpsertOne) SetCreatedAt(v time.Time) *GuildUpsertOne
- func (u *GuildUpsertOne) SetName(v string) *GuildUpsertOne
- func (u *GuildUpsertOne) SetPlayerChannelID(v snowflake.ID) *GuildUpsertOne
- func (u *GuildUpsertOne) SetPlayerMessageID(v snowflake.ID) *GuildUpsertOne
- func (u *GuildUpsertOne) SetUpdatedAt(v time.Time) *GuildUpsertOne
- func (u *GuildUpsertOne) Update(set func(*GuildUpsert)) *GuildUpsertOne
- func (u *GuildUpsertOne) UpdateCreatedAt() *GuildUpsertOne
- func (u *GuildUpsertOne) UpdateName() *GuildUpsertOne
- func (u *GuildUpsertOne) UpdateNewValues() *GuildUpsertOne
- func (u *GuildUpsertOne) UpdatePlayerChannelID() *GuildUpsertOne
- func (u *GuildUpsertOne) UpdatePlayerMessageID() *GuildUpsertOne
- func (u *GuildUpsertOne) UpdateUpdatedAt() *GuildUpsertOne
- type Guilds
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeGuild = "Guild" )
Variables ¶
This section is empty.
Functions ¶
func IsConstraintError ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client attached.
Types ¶
type AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
As is a pseudo aggregation function for renaming another other functions with custom names. For example:
GroupBy(field1, field2). Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")). Scan(ctx, &v)
func Count ¶
func Count() AggregateFunc
Count applies the "count" aggregation function on each group.
func Max ¶
func Max(field string) AggregateFunc
Max applies the "max" aggregation function on the given field of each group.
func Mean ¶
func Mean(field string) AggregateFunc
Mean applies the "mean" aggregation function on the given field of each group.
func Min ¶
func Min(field string) AggregateFunc
Min applies the "min" aggregation function on the given field of each group.
func Sum ¶
func Sum(field string) AggregateFunc
Sum applies the "sum" aggregation function on the given field of each group.
type Client ¶
type Client struct { // Schema is the client for creating, migrating and dropping schema. Schema *migrate.Schema // Guild is the client for interacting with the Guild builders. Guild *GuildClient // contains filtered or unexported fields }
Client is the client that holds all ent builders.
func FromContext ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
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) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Guild. Query(). Count(ctx)
func (*Client) Intercept ¶
func (c *Client) Intercept(interceptors ...Interceptor)
Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
type CommitFunc ¶
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.
type CommitHook ¶
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 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 Guild ¶
type Guild struct { // ID of the ent. ID snowflake.ID `json:"id,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // PlayerChannelID holds the value of the "player_channel_id" field. PlayerChannelID *snowflake.ID `json:"player_channel_id,omitempty"` // PlayerMessageID holds the value of the "player_message_id" field. PlayerMessageID *snowflake.ID `json:"player_message_id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // UpdatedAt holds the value of the "updated_at" field. UpdatedAt time.Time `json:"updated_at,omitempty"` // contains filtered or unexported fields }
Guild is the model entity for the Guild schema.
func (*Guild) Unwrap ¶
Unwrap unwraps the Guild 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 (*Guild) Update ¶
func (gu *Guild) Update() *GuildUpdateOne
Update returns a builder for updating this Guild. Note that you need to call Guild.Unwrap() before calling this method if this Guild was returned from a transaction, and the transaction was committed or rolled back.
type GuildClient ¶
type GuildClient struct {
// contains filtered or unexported fields
}
GuildClient is a client for the Guild schema.
func NewGuildClient ¶
func NewGuildClient(c config) *GuildClient
NewGuildClient returns a client for the Guild from the given config.
func (*GuildClient) Create ¶
func (c *GuildClient) Create() *GuildCreate
Create returns a builder for creating a Guild entity.
func (*GuildClient) CreateBulk ¶
func (c *GuildClient) CreateBulk(builders ...*GuildCreate) *GuildCreateBulk
CreateBulk returns a builder for creating a bulk of Guild entities.
func (*GuildClient) Delete ¶
func (c *GuildClient) Delete() *GuildDelete
Delete returns a delete builder for Guild.
func (*GuildClient) DeleteOne ¶
func (c *GuildClient) DeleteOne(gu *Guild) *GuildDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*GuildClient) DeleteOneID ¶
func (c *GuildClient) DeleteOneID(id snowflake.ID) *GuildDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*GuildClient) Intercept ¶
func (c *GuildClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `guild.Intercept(f(g(h())))`.
func (*GuildClient) Interceptors ¶
func (c *GuildClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*GuildClient) Query ¶
func (c *GuildClient) Query() *GuildQuery
Query returns a query builder for Guild.
func (*GuildClient) Update ¶
func (c *GuildClient) Update() *GuildUpdate
Update returns an update builder for Guild.
func (*GuildClient) UpdateOne ¶
func (c *GuildClient) UpdateOne(gu *Guild) *GuildUpdateOne
UpdateOne returns an update builder for the given entity.
func (*GuildClient) UpdateOneID ¶
func (c *GuildClient) UpdateOneID(id snowflake.ID) *GuildUpdateOne
UpdateOneID returns an update builder for the given id.
func (*GuildClient) Use ¶
func (c *GuildClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `guild.Hooks(f(g(h())))`.
type GuildCreate ¶
type GuildCreate struct {
// contains filtered or unexported fields
}
GuildCreate is the builder for creating a Guild entity.
func (*GuildCreate) Exec ¶
func (gc *GuildCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*GuildCreate) ExecX ¶
func (gc *GuildCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GuildCreate) Mutation ¶
func (gc *GuildCreate) Mutation() *GuildMutation
Mutation returns the GuildMutation object of the builder.
func (*GuildCreate) OnConflict ¶
func (gc *GuildCreate) OnConflict(opts ...sql.ConflictOption) *GuildUpsertOne
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Guild.Create(). SetName(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.GuildUpsert) { SetName(v+v). }). Exec(ctx)
func (*GuildCreate) OnConflictColumns ¶
func (gc *GuildCreate) OnConflictColumns(columns ...string) *GuildUpsertOne
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Guild.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
func (*GuildCreate) Save ¶
func (gc *GuildCreate) Save(ctx context.Context) (*Guild, error)
Save creates the Guild in the database.
func (*GuildCreate) SaveX ¶
func (gc *GuildCreate) SaveX(ctx context.Context) *Guild
SaveX calls Save and panics if Save returns an error.
func (*GuildCreate) SetCreatedAt ¶
func (gc *GuildCreate) SetCreatedAt(t time.Time) *GuildCreate
SetCreatedAt sets the "created_at" field.
func (*GuildCreate) SetID ¶
func (gc *GuildCreate) SetID(s snowflake.ID) *GuildCreate
SetID sets the "id" field.
func (*GuildCreate) SetName ¶
func (gc *GuildCreate) SetName(s string) *GuildCreate
SetName sets the "name" field.
func (*GuildCreate) SetNillableCreatedAt ¶
func (gc *GuildCreate) SetNillableCreatedAt(t *time.Time) *GuildCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*GuildCreate) SetNillablePlayerChannelID ¶
func (gc *GuildCreate) SetNillablePlayerChannelID(s *snowflake.ID) *GuildCreate
SetNillablePlayerChannelID sets the "player_channel_id" field if the given value is not nil.
func (*GuildCreate) SetNillablePlayerMessageID ¶
func (gc *GuildCreate) SetNillablePlayerMessageID(s *snowflake.ID) *GuildCreate
SetNillablePlayerMessageID sets the "player_message_id" field if the given value is not nil.
func (*GuildCreate) SetNillableUpdatedAt ¶
func (gc *GuildCreate) SetNillableUpdatedAt(t *time.Time) *GuildCreate
SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
func (*GuildCreate) SetPlayerChannelID ¶
func (gc *GuildCreate) SetPlayerChannelID(s snowflake.ID) *GuildCreate
SetPlayerChannelID sets the "player_channel_id" field.
func (*GuildCreate) SetPlayerMessageID ¶
func (gc *GuildCreate) SetPlayerMessageID(s snowflake.ID) *GuildCreate
SetPlayerMessageID sets the "player_message_id" field.
func (*GuildCreate) SetUpdatedAt ¶
func (gc *GuildCreate) SetUpdatedAt(t time.Time) *GuildCreate
SetUpdatedAt sets the "updated_at" field.
type GuildCreateBulk ¶
type GuildCreateBulk struct {
// contains filtered or unexported fields
}
GuildCreateBulk is the builder for creating many Guild entities in bulk.
func (*GuildCreateBulk) Exec ¶
func (gcb *GuildCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*GuildCreateBulk) ExecX ¶
func (gcb *GuildCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GuildCreateBulk) OnConflict ¶
func (gcb *GuildCreateBulk) OnConflict(opts ...sql.ConflictOption) *GuildUpsertBulk
OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:
client.Guild.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.GuildUpsert) { SetName(v+v). }). Exec(ctx)
func (*GuildCreateBulk) OnConflictColumns ¶
func (gcb *GuildCreateBulk) OnConflictColumns(columns ...string) *GuildUpsertBulk
OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:
client.Guild.Create(). OnConflict(sql.ConflictColumns(columns...)). Exec(ctx)
type GuildDelete ¶
type GuildDelete struct {
// contains filtered or unexported fields
}
GuildDelete is the builder for deleting a Guild entity.
func (*GuildDelete) Exec ¶
func (gd *GuildDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*GuildDelete) ExecX ¶
func (gd *GuildDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*GuildDelete) Where ¶
func (gd *GuildDelete) Where(ps ...predicate.Guild) *GuildDelete
Where appends a list predicates to the GuildDelete builder.
type GuildDeleteOne ¶
type GuildDeleteOne struct {
// contains filtered or unexported fields
}
GuildDeleteOne is the builder for deleting a single Guild entity.
func (*GuildDeleteOne) Exec ¶
func (gdo *GuildDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*GuildDeleteOne) ExecX ¶
func (gdo *GuildDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GuildDeleteOne) Where ¶
func (gdo *GuildDeleteOne) Where(ps ...predicate.Guild) *GuildDeleteOne
Where appends a list predicates to the GuildDelete builder.
type GuildGroupBy ¶
type GuildGroupBy struct {
// contains filtered or unexported fields
}
GuildGroupBy is the group-by builder for Guild entities.
func (*GuildGroupBy) Aggregate ¶
func (ggb *GuildGroupBy) Aggregate(fns ...AggregateFunc) *GuildGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*GuildGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*GuildGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*GuildGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*GuildGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*GuildGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*GuildGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*GuildGroupBy) Scan ¶
func (ggb *GuildGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*GuildGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type GuildMutation ¶
type GuildMutation struct {
// contains filtered or unexported fields
}
GuildMutation represents an operation that mutates the Guild nodes in the graph.
func (*GuildMutation) AddField ¶
func (m *GuildMutation) 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 (*GuildMutation) AddPlayerChannelID ¶
func (m *GuildMutation) AddPlayerChannelID(s snowflake.ID)
AddPlayerChannelID adds s to the "player_channel_id" field.
func (*GuildMutation) AddPlayerMessageID ¶
func (m *GuildMutation) AddPlayerMessageID(s snowflake.ID)
AddPlayerMessageID adds s to the "player_message_id" field.
func (*GuildMutation) AddedEdges ¶
func (m *GuildMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*GuildMutation) AddedField ¶
func (m *GuildMutation) 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 (*GuildMutation) AddedFields ¶
func (m *GuildMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*GuildMutation) AddedIDs ¶
func (m *GuildMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*GuildMutation) AddedPlayerChannelID ¶
func (m *GuildMutation) AddedPlayerChannelID() (r snowflake.ID, exists bool)
AddedPlayerChannelID returns the value that was added to the "player_channel_id" field in this mutation.
func (*GuildMutation) AddedPlayerMessageID ¶
func (m *GuildMutation) AddedPlayerMessageID() (r snowflake.ID, exists bool)
AddedPlayerMessageID returns the value that was added to the "player_message_id" field in this mutation.
func (*GuildMutation) ClearEdge ¶
func (m *GuildMutation) 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 (*GuildMutation) ClearField ¶
func (m *GuildMutation) 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 (*GuildMutation) ClearPlayerChannelID ¶
func (m *GuildMutation) ClearPlayerChannelID()
ClearPlayerChannelID clears the value of the "player_channel_id" field.
func (*GuildMutation) ClearPlayerMessageID ¶
func (m *GuildMutation) ClearPlayerMessageID()
ClearPlayerMessageID clears the value of the "player_message_id" field.
func (*GuildMutation) ClearedEdges ¶
func (m *GuildMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*GuildMutation) ClearedFields ¶
func (m *GuildMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (GuildMutation) Client ¶
func (m GuildMutation) 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 (*GuildMutation) CreatedAt ¶
func (m *GuildMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*GuildMutation) EdgeCleared ¶
func (m *GuildMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*GuildMutation) Field ¶
func (m *GuildMutation) 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 (*GuildMutation) FieldCleared ¶
func (m *GuildMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*GuildMutation) Fields ¶
func (m *GuildMutation) 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 (*GuildMutation) ID ¶
func (m *GuildMutation) ID() (id snowflake.ID, 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 (*GuildMutation) 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 (*GuildMutation) Name ¶
func (m *GuildMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*GuildMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the Guild entity. If the Guild 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 (*GuildMutation) OldField ¶
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 (*GuildMutation) OldName ¶
func (m *GuildMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the Guild entity. If the Guild 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 (*GuildMutation) OldPlayerChannelID ¶
OldPlayerChannelID returns the old "player_channel_id" field's value of the Guild entity. If the Guild 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 (*GuildMutation) OldPlayerMessageID ¶
OldPlayerMessageID returns the old "player_message_id" field's value of the Guild entity. If the Guild 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 (*GuildMutation) OldUpdatedAt ¶
OldUpdatedAt returns the old "updated_at" field's value of the Guild entity. If the Guild 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 (*GuildMutation) PlayerChannelID ¶
func (m *GuildMutation) PlayerChannelID() (r snowflake.ID, exists bool)
PlayerChannelID returns the value of the "player_channel_id" field in the mutation.
func (*GuildMutation) PlayerChannelIDCleared ¶
func (m *GuildMutation) PlayerChannelIDCleared() bool
PlayerChannelIDCleared returns if the "player_channel_id" field was cleared in this mutation.
func (*GuildMutation) PlayerMessageID ¶
func (m *GuildMutation) PlayerMessageID() (r snowflake.ID, exists bool)
PlayerMessageID returns the value of the "player_message_id" field in the mutation.
func (*GuildMutation) PlayerMessageIDCleared ¶
func (m *GuildMutation) PlayerMessageIDCleared() bool
PlayerMessageIDCleared returns if the "player_message_id" field was cleared in this mutation.
func (*GuildMutation) RemovedEdges ¶
func (m *GuildMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*GuildMutation) RemovedIDs ¶
func (m *GuildMutation) 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 (*GuildMutation) ResetCreatedAt ¶
func (m *GuildMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*GuildMutation) ResetEdge ¶
func (m *GuildMutation) 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 (*GuildMutation) ResetField ¶
func (m *GuildMutation) 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 (*GuildMutation) ResetName ¶
func (m *GuildMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*GuildMutation) ResetPlayerChannelID ¶
func (m *GuildMutation) ResetPlayerChannelID()
ResetPlayerChannelID resets all changes to the "player_channel_id" field.
func (*GuildMutation) ResetPlayerMessageID ¶
func (m *GuildMutation) ResetPlayerMessageID()
ResetPlayerMessageID resets all changes to the "player_message_id" field.
func (*GuildMutation) ResetUpdatedAt ¶
func (m *GuildMutation) ResetUpdatedAt()
ResetUpdatedAt resets all changes to the "updated_at" field.
func (*GuildMutation) SetCreatedAt ¶
func (m *GuildMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*GuildMutation) SetField ¶
func (m *GuildMutation) 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 (*GuildMutation) SetID ¶
func (m *GuildMutation) SetID(id snowflake.ID)
SetID sets the value of the id field. Note that this operation is only accepted on creation of Guild entities.
func (*GuildMutation) SetName ¶
func (m *GuildMutation) SetName(s string)
SetName sets the "name" field.
func (*GuildMutation) SetOp ¶
func (m *GuildMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*GuildMutation) SetPlayerChannelID ¶
func (m *GuildMutation) SetPlayerChannelID(s snowflake.ID)
SetPlayerChannelID sets the "player_channel_id" field.
func (*GuildMutation) SetPlayerMessageID ¶
func (m *GuildMutation) SetPlayerMessageID(s snowflake.ID)
SetPlayerMessageID sets the "player_message_id" field.
func (*GuildMutation) SetUpdatedAt ¶
func (m *GuildMutation) SetUpdatedAt(t time.Time)
SetUpdatedAt sets the "updated_at" field.
func (GuildMutation) Tx ¶
func (m GuildMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*GuildMutation) Type ¶
func (m *GuildMutation) Type() string
Type returns the node type of this mutation (Guild).
func (*GuildMutation) UpdatedAt ¶
func (m *GuildMutation) UpdatedAt() (r time.Time, exists bool)
UpdatedAt returns the value of the "updated_at" field in the mutation.
func (*GuildMutation) Where ¶
func (m *GuildMutation) Where(ps ...predicate.Guild)
Where appends a list predicates to the GuildMutation builder.
func (*GuildMutation) WhereP ¶
func (m *GuildMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the GuildMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type GuildQuery ¶
type GuildQuery struct {
// contains filtered or unexported fields
}
GuildQuery is the builder for querying Guild entities.
func (*GuildQuery) Aggregate ¶
func (gq *GuildQuery) Aggregate(fns ...AggregateFunc) *GuildSelect
Aggregate returns a GuildSelect configured with the given aggregations.
func (*GuildQuery) All ¶
func (gq *GuildQuery) All(ctx context.Context) ([]*Guild, error)
All executes the query and returns a list of Guilds.
func (*GuildQuery) AllX ¶
func (gq *GuildQuery) AllX(ctx context.Context) []*Guild
AllX is like All, but panics if an error occurs.
func (*GuildQuery) Clone ¶
func (gq *GuildQuery) Clone() *GuildQuery
Clone returns a duplicate of the GuildQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*GuildQuery) Count ¶
func (gq *GuildQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*GuildQuery) CountX ¶
func (gq *GuildQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*GuildQuery) Exist ¶
func (gq *GuildQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*GuildQuery) ExistX ¶
func (gq *GuildQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*GuildQuery) First ¶
func (gq *GuildQuery) First(ctx context.Context) (*Guild, error)
First returns the first Guild entity from the query. Returns a *NotFoundError when no Guild was found.
func (*GuildQuery) FirstID ¶
FirstID returns the first Guild ID from the query. Returns a *NotFoundError when no Guild ID was found.
func (*GuildQuery) FirstIDX ¶
func (gq *GuildQuery) FirstIDX(ctx context.Context) snowflake.ID
FirstIDX is like FirstID, but panics if an error occurs.
func (*GuildQuery) FirstX ¶
func (gq *GuildQuery) FirstX(ctx context.Context) *Guild
FirstX is like First, but panics if an error occurs.
func (*GuildQuery) GroupBy ¶
func (gq *GuildQuery) GroupBy(field string, fields ...string) *GuildGroupBy
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 { Name string `json:"name,omitempty"` Count int `json:"count,omitempty"` } client.Guild.Query(). GroupBy(guild.FieldName). Aggregate(ent.Count()). Scan(ctx, &v)
func (*GuildQuery) IDsX ¶
func (gq *GuildQuery) IDsX(ctx context.Context) []snowflake.ID
IDsX is like IDs, but panics if an error occurs.
func (*GuildQuery) Limit ¶
func (gq *GuildQuery) Limit(limit int) *GuildQuery
Limit the number of records to be returned by this query.
func (*GuildQuery) Offset ¶
func (gq *GuildQuery) Offset(offset int) *GuildQuery
Offset to start from.
func (*GuildQuery) Only ¶
func (gq *GuildQuery) Only(ctx context.Context) (*Guild, error)
Only returns a single Guild entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Guild entity is found. Returns a *NotFoundError when no Guild entities are found.
func (*GuildQuery) OnlyID ¶
OnlyID is like Only, but returns the only Guild ID in the query. Returns a *NotSingularError when more than one Guild ID is found. Returns a *NotFoundError when no entities are found.
func (*GuildQuery) OnlyIDX ¶
func (gq *GuildQuery) OnlyIDX(ctx context.Context) snowflake.ID
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*GuildQuery) OnlyX ¶
func (gq *GuildQuery) OnlyX(ctx context.Context) *Guild
OnlyX is like Only, but panics if an error occurs.
func (*GuildQuery) Order ¶
func (gq *GuildQuery) Order(o ...OrderFunc) *GuildQuery
Order specifies how the records should be ordered.
func (*GuildQuery) Select ¶
func (gq *GuildQuery) Select(fields ...string) *GuildSelect
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 { Name string `json:"name,omitempty"` } client.Guild.Query(). Select(guild.FieldName). Scan(ctx, &v)
func (*GuildQuery) Unique ¶
func (gq *GuildQuery) Unique(unique bool) *GuildQuery
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 (*GuildQuery) Where ¶
func (gq *GuildQuery) Where(ps ...predicate.Guild) *GuildQuery
Where adds a new predicate for the GuildQuery builder.
type GuildSelect ¶
type GuildSelect struct { *GuildQuery // contains filtered or unexported fields }
GuildSelect is the builder for selecting fields of Guild entities.
func (*GuildSelect) Aggregate ¶
func (gs *GuildSelect) Aggregate(fns ...AggregateFunc) *GuildSelect
Aggregate adds the given aggregation functions to the selector query.
func (*GuildSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*GuildSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*GuildSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*GuildSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*GuildSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*GuildSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*GuildSelect) Scan ¶
func (gs *GuildSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*GuildSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type GuildUpdate ¶
type GuildUpdate struct {
// contains filtered or unexported fields
}
GuildUpdate is the builder for updating Guild entities.
func (*GuildUpdate) AddPlayerChannelID ¶
func (gu *GuildUpdate) AddPlayerChannelID(s snowflake.ID) *GuildUpdate
AddPlayerChannelID adds s to the "player_channel_id" field.
func (*GuildUpdate) AddPlayerMessageID ¶
func (gu *GuildUpdate) AddPlayerMessageID(s snowflake.ID) *GuildUpdate
AddPlayerMessageID adds s to the "player_message_id" field.
func (*GuildUpdate) ClearPlayerChannelID ¶
func (gu *GuildUpdate) ClearPlayerChannelID() *GuildUpdate
ClearPlayerChannelID clears the value of the "player_channel_id" field.
func (*GuildUpdate) ClearPlayerMessageID ¶
func (gu *GuildUpdate) ClearPlayerMessageID() *GuildUpdate
ClearPlayerMessageID clears the value of the "player_message_id" field.
func (*GuildUpdate) Exec ¶
func (gu *GuildUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*GuildUpdate) ExecX ¶
func (gu *GuildUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GuildUpdate) Mutation ¶
func (gu *GuildUpdate) Mutation() *GuildMutation
Mutation returns the GuildMutation object of the builder.
func (*GuildUpdate) Save ¶
func (gu *GuildUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*GuildUpdate) SaveX ¶
func (gu *GuildUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*GuildUpdate) SetCreatedAt ¶
func (gu *GuildUpdate) SetCreatedAt(t time.Time) *GuildUpdate
SetCreatedAt sets the "created_at" field.
func (*GuildUpdate) SetName ¶
func (gu *GuildUpdate) SetName(s string) *GuildUpdate
SetName sets the "name" field.
func (*GuildUpdate) SetNillableCreatedAt ¶
func (gu *GuildUpdate) SetNillableCreatedAt(t *time.Time) *GuildUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*GuildUpdate) SetNillablePlayerChannelID ¶
func (gu *GuildUpdate) SetNillablePlayerChannelID(s *snowflake.ID) *GuildUpdate
SetNillablePlayerChannelID sets the "player_channel_id" field if the given value is not nil.
func (*GuildUpdate) SetNillablePlayerMessageID ¶
func (gu *GuildUpdate) SetNillablePlayerMessageID(s *snowflake.ID) *GuildUpdate
SetNillablePlayerMessageID sets the "player_message_id" field if the given value is not nil.
func (*GuildUpdate) SetPlayerChannelID ¶
func (gu *GuildUpdate) SetPlayerChannelID(s snowflake.ID) *GuildUpdate
SetPlayerChannelID sets the "player_channel_id" field.
func (*GuildUpdate) SetPlayerMessageID ¶
func (gu *GuildUpdate) SetPlayerMessageID(s snowflake.ID) *GuildUpdate
SetPlayerMessageID sets the "player_message_id" field.
func (*GuildUpdate) SetUpdatedAt ¶
func (gu *GuildUpdate) SetUpdatedAt(t time.Time) *GuildUpdate
SetUpdatedAt sets the "updated_at" field.
func (*GuildUpdate) Where ¶
func (gu *GuildUpdate) Where(ps ...predicate.Guild) *GuildUpdate
Where appends a list predicates to the GuildUpdate builder.
type GuildUpdateOne ¶
type GuildUpdateOne struct {
// contains filtered or unexported fields
}
GuildUpdateOne is the builder for updating a single Guild entity.
func (*GuildUpdateOne) AddPlayerChannelID ¶
func (guo *GuildUpdateOne) AddPlayerChannelID(s snowflake.ID) *GuildUpdateOne
AddPlayerChannelID adds s to the "player_channel_id" field.
func (*GuildUpdateOne) AddPlayerMessageID ¶
func (guo *GuildUpdateOne) AddPlayerMessageID(s snowflake.ID) *GuildUpdateOne
AddPlayerMessageID adds s to the "player_message_id" field.
func (*GuildUpdateOne) ClearPlayerChannelID ¶
func (guo *GuildUpdateOne) ClearPlayerChannelID() *GuildUpdateOne
ClearPlayerChannelID clears the value of the "player_channel_id" field.
func (*GuildUpdateOne) ClearPlayerMessageID ¶
func (guo *GuildUpdateOne) ClearPlayerMessageID() *GuildUpdateOne
ClearPlayerMessageID clears the value of the "player_message_id" field.
func (*GuildUpdateOne) Exec ¶
func (guo *GuildUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*GuildUpdateOne) ExecX ¶
func (guo *GuildUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GuildUpdateOne) Mutation ¶
func (guo *GuildUpdateOne) Mutation() *GuildMutation
Mutation returns the GuildMutation object of the builder.
func (*GuildUpdateOne) Save ¶
func (guo *GuildUpdateOne) Save(ctx context.Context) (*Guild, error)
Save executes the query and returns the updated Guild entity.
func (*GuildUpdateOne) SaveX ¶
func (guo *GuildUpdateOne) SaveX(ctx context.Context) *Guild
SaveX is like Save, but panics if an error occurs.
func (*GuildUpdateOne) Select ¶
func (guo *GuildUpdateOne) Select(field string, fields ...string) *GuildUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*GuildUpdateOne) SetCreatedAt ¶
func (guo *GuildUpdateOne) SetCreatedAt(t time.Time) *GuildUpdateOne
SetCreatedAt sets the "created_at" field.
func (*GuildUpdateOne) SetName ¶
func (guo *GuildUpdateOne) SetName(s string) *GuildUpdateOne
SetName sets the "name" field.
func (*GuildUpdateOne) SetNillableCreatedAt ¶
func (guo *GuildUpdateOne) SetNillableCreatedAt(t *time.Time) *GuildUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*GuildUpdateOne) SetNillablePlayerChannelID ¶
func (guo *GuildUpdateOne) SetNillablePlayerChannelID(s *snowflake.ID) *GuildUpdateOne
SetNillablePlayerChannelID sets the "player_channel_id" field if the given value is not nil.
func (*GuildUpdateOne) SetNillablePlayerMessageID ¶
func (guo *GuildUpdateOne) SetNillablePlayerMessageID(s *snowflake.ID) *GuildUpdateOne
SetNillablePlayerMessageID sets the "player_message_id" field if the given value is not nil.
func (*GuildUpdateOne) SetPlayerChannelID ¶
func (guo *GuildUpdateOne) SetPlayerChannelID(s snowflake.ID) *GuildUpdateOne
SetPlayerChannelID sets the "player_channel_id" field.
func (*GuildUpdateOne) SetPlayerMessageID ¶
func (guo *GuildUpdateOne) SetPlayerMessageID(s snowflake.ID) *GuildUpdateOne
SetPlayerMessageID sets the "player_message_id" field.
func (*GuildUpdateOne) SetUpdatedAt ¶
func (guo *GuildUpdateOne) SetUpdatedAt(t time.Time) *GuildUpdateOne
SetUpdatedAt sets the "updated_at" field.
func (*GuildUpdateOne) Where ¶
func (guo *GuildUpdateOne) Where(ps ...predicate.Guild) *GuildUpdateOne
Where appends a list predicates to the GuildUpdate builder.
type GuildUpsert ¶
GuildUpsert is the "OnConflict" setter.
func (*GuildUpsert) AddPlayerChannelID ¶
func (u *GuildUpsert) AddPlayerChannelID(v snowflake.ID) *GuildUpsert
AddPlayerChannelID adds v to the "player_channel_id" field.
func (*GuildUpsert) AddPlayerMessageID ¶
func (u *GuildUpsert) AddPlayerMessageID(v snowflake.ID) *GuildUpsert
AddPlayerMessageID adds v to the "player_message_id" field.
func (*GuildUpsert) ClearPlayerChannelID ¶
func (u *GuildUpsert) ClearPlayerChannelID() *GuildUpsert
ClearPlayerChannelID clears the value of the "player_channel_id" field.
func (*GuildUpsert) ClearPlayerMessageID ¶
func (u *GuildUpsert) ClearPlayerMessageID() *GuildUpsert
ClearPlayerMessageID clears the value of the "player_message_id" field.
func (*GuildUpsert) SetCreatedAt ¶
func (u *GuildUpsert) SetCreatedAt(v time.Time) *GuildUpsert
SetCreatedAt sets the "created_at" field.
func (*GuildUpsert) SetName ¶
func (u *GuildUpsert) SetName(v string) *GuildUpsert
SetName sets the "name" field.
func (*GuildUpsert) SetPlayerChannelID ¶
func (u *GuildUpsert) SetPlayerChannelID(v snowflake.ID) *GuildUpsert
SetPlayerChannelID sets the "player_channel_id" field.
func (*GuildUpsert) SetPlayerMessageID ¶
func (u *GuildUpsert) SetPlayerMessageID(v snowflake.ID) *GuildUpsert
SetPlayerMessageID sets the "player_message_id" field.
func (*GuildUpsert) SetUpdatedAt ¶
func (u *GuildUpsert) SetUpdatedAt(v time.Time) *GuildUpsert
SetUpdatedAt sets the "updated_at" field.
func (*GuildUpsert) UpdateCreatedAt ¶
func (u *GuildUpsert) UpdateCreatedAt() *GuildUpsert
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*GuildUpsert) UpdateName ¶
func (u *GuildUpsert) UpdateName() *GuildUpsert
UpdateName sets the "name" field to the value that was provided on create.
func (*GuildUpsert) UpdatePlayerChannelID ¶
func (u *GuildUpsert) UpdatePlayerChannelID() *GuildUpsert
UpdatePlayerChannelID sets the "player_channel_id" field to the value that was provided on create.
func (*GuildUpsert) UpdatePlayerMessageID ¶
func (u *GuildUpsert) UpdatePlayerMessageID() *GuildUpsert
UpdatePlayerMessageID sets the "player_message_id" field to the value that was provided on create.
func (*GuildUpsert) UpdateUpdatedAt ¶
func (u *GuildUpsert) UpdateUpdatedAt() *GuildUpsert
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type GuildUpsertBulk ¶
type GuildUpsertBulk struct {
// contains filtered or unexported fields
}
GuildUpsertBulk is the builder for "upsert"-ing a bulk of Guild nodes.
func (*GuildUpsertBulk) AddPlayerChannelID ¶
func (u *GuildUpsertBulk) AddPlayerChannelID(v snowflake.ID) *GuildUpsertBulk
AddPlayerChannelID adds v to the "player_channel_id" field.
func (*GuildUpsertBulk) AddPlayerMessageID ¶
func (u *GuildUpsertBulk) AddPlayerMessageID(v snowflake.ID) *GuildUpsertBulk
AddPlayerMessageID adds v to the "player_message_id" field.
func (*GuildUpsertBulk) ClearPlayerChannelID ¶
func (u *GuildUpsertBulk) ClearPlayerChannelID() *GuildUpsertBulk
ClearPlayerChannelID clears the value of the "player_channel_id" field.
func (*GuildUpsertBulk) ClearPlayerMessageID ¶
func (u *GuildUpsertBulk) ClearPlayerMessageID() *GuildUpsertBulk
ClearPlayerMessageID clears the value of the "player_message_id" field.
func (*GuildUpsertBulk) DoNothing ¶
func (u *GuildUpsertBulk) DoNothing() *GuildUpsertBulk
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*GuildUpsertBulk) Exec ¶
func (u *GuildUpsertBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*GuildUpsertBulk) ExecX ¶
func (u *GuildUpsertBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GuildUpsertBulk) Ignore ¶
func (u *GuildUpsertBulk) Ignore() *GuildUpsertBulk
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Guild.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*GuildUpsertBulk) SetCreatedAt ¶
func (u *GuildUpsertBulk) SetCreatedAt(v time.Time) *GuildUpsertBulk
SetCreatedAt sets the "created_at" field.
func (*GuildUpsertBulk) SetName ¶
func (u *GuildUpsertBulk) SetName(v string) *GuildUpsertBulk
SetName sets the "name" field.
func (*GuildUpsertBulk) SetPlayerChannelID ¶
func (u *GuildUpsertBulk) SetPlayerChannelID(v snowflake.ID) *GuildUpsertBulk
SetPlayerChannelID sets the "player_channel_id" field.
func (*GuildUpsertBulk) SetPlayerMessageID ¶
func (u *GuildUpsertBulk) SetPlayerMessageID(v snowflake.ID) *GuildUpsertBulk
SetPlayerMessageID sets the "player_message_id" field.
func (*GuildUpsertBulk) SetUpdatedAt ¶
func (u *GuildUpsertBulk) SetUpdatedAt(v time.Time) *GuildUpsertBulk
SetUpdatedAt sets the "updated_at" field.
func (*GuildUpsertBulk) Update ¶
func (u *GuildUpsertBulk) Update(set func(*GuildUpsert)) *GuildUpsertBulk
Update allows overriding fields `UPDATE` values. See the GuildCreateBulk.OnConflict documentation for more info.
func (*GuildUpsertBulk) UpdateCreatedAt ¶
func (u *GuildUpsertBulk) UpdateCreatedAt() *GuildUpsertBulk
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*GuildUpsertBulk) UpdateName ¶
func (u *GuildUpsertBulk) UpdateName() *GuildUpsertBulk
UpdateName sets the "name" field to the value that was provided on create.
func (*GuildUpsertBulk) UpdateNewValues ¶
func (u *GuildUpsertBulk) UpdateNewValues() *GuildUpsertBulk
UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:
client.Guild.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(guild.FieldID) }), ). Exec(ctx)
func (*GuildUpsertBulk) UpdatePlayerChannelID ¶
func (u *GuildUpsertBulk) UpdatePlayerChannelID() *GuildUpsertBulk
UpdatePlayerChannelID sets the "player_channel_id" field to the value that was provided on create.
func (*GuildUpsertBulk) UpdatePlayerMessageID ¶
func (u *GuildUpsertBulk) UpdatePlayerMessageID() *GuildUpsertBulk
UpdatePlayerMessageID sets the "player_message_id" field to the value that was provided on create.
func (*GuildUpsertBulk) UpdateUpdatedAt ¶
func (u *GuildUpsertBulk) UpdateUpdatedAt() *GuildUpsertBulk
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
type GuildUpsertOne ¶
type GuildUpsertOne struct {
// contains filtered or unexported fields
}
GuildUpsertOne is the builder for "upsert"-ing
one Guild node.
func (*GuildUpsertOne) AddPlayerChannelID ¶
func (u *GuildUpsertOne) AddPlayerChannelID(v snowflake.ID) *GuildUpsertOne
AddPlayerChannelID adds v to the "player_channel_id" field.
func (*GuildUpsertOne) AddPlayerMessageID ¶
func (u *GuildUpsertOne) AddPlayerMessageID(v snowflake.ID) *GuildUpsertOne
AddPlayerMessageID adds v to the "player_message_id" field.
func (*GuildUpsertOne) ClearPlayerChannelID ¶
func (u *GuildUpsertOne) ClearPlayerChannelID() *GuildUpsertOne
ClearPlayerChannelID clears the value of the "player_channel_id" field.
func (*GuildUpsertOne) ClearPlayerMessageID ¶
func (u *GuildUpsertOne) ClearPlayerMessageID() *GuildUpsertOne
ClearPlayerMessageID clears the value of the "player_message_id" field.
func (*GuildUpsertOne) DoNothing ¶
func (u *GuildUpsertOne) DoNothing() *GuildUpsertOne
DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.
func (*GuildUpsertOne) Exec ¶
func (u *GuildUpsertOne) Exec(ctx context.Context) error
Exec executes the query.
func (*GuildUpsertOne) ExecX ¶
func (u *GuildUpsertOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*GuildUpsertOne) IDX ¶
func (u *GuildUpsertOne) IDX(ctx context.Context) snowflake.ID
IDX is like ID, but panics if an error occurs.
func (*GuildUpsertOne) Ignore ¶
func (u *GuildUpsertOne) Ignore() *GuildUpsertOne
Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:
client.Guild.Create(). OnConflict(sql.ResolveWithIgnore()). Exec(ctx)
func (*GuildUpsertOne) SetCreatedAt ¶
func (u *GuildUpsertOne) SetCreatedAt(v time.Time) *GuildUpsertOne
SetCreatedAt sets the "created_at" field.
func (*GuildUpsertOne) SetName ¶
func (u *GuildUpsertOne) SetName(v string) *GuildUpsertOne
SetName sets the "name" field.
func (*GuildUpsertOne) SetPlayerChannelID ¶
func (u *GuildUpsertOne) SetPlayerChannelID(v snowflake.ID) *GuildUpsertOne
SetPlayerChannelID sets the "player_channel_id" field.
func (*GuildUpsertOne) SetPlayerMessageID ¶
func (u *GuildUpsertOne) SetPlayerMessageID(v snowflake.ID) *GuildUpsertOne
SetPlayerMessageID sets the "player_message_id" field.
func (*GuildUpsertOne) SetUpdatedAt ¶
func (u *GuildUpsertOne) SetUpdatedAt(v time.Time) *GuildUpsertOne
SetUpdatedAt sets the "updated_at" field.
func (*GuildUpsertOne) Update ¶
func (u *GuildUpsertOne) Update(set func(*GuildUpsert)) *GuildUpsertOne
Update allows overriding fields `UPDATE` values. See the GuildCreate.OnConflict documentation for more info.
func (*GuildUpsertOne) UpdateCreatedAt ¶
func (u *GuildUpsertOne) UpdateCreatedAt() *GuildUpsertOne
UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
func (*GuildUpsertOne) UpdateName ¶
func (u *GuildUpsertOne) UpdateName() *GuildUpsertOne
UpdateName sets the "name" field to the value that was provided on create.
func (*GuildUpsertOne) UpdateNewValues ¶
func (u *GuildUpsertOne) UpdateNewValues() *GuildUpsertOne
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.Guild.Create(). OnConflict( sql.ResolveWithNewValues(), sql.ResolveWith(func(u *sql.UpdateSet) { u.SetIgnore(guild.FieldID) }), ). Exec(ctx)
func (*GuildUpsertOne) UpdatePlayerChannelID ¶
func (u *GuildUpsertOne) UpdatePlayerChannelID() *GuildUpsertOne
UpdatePlayerChannelID sets the "player_channel_id" field to the value that was provided on create.
func (*GuildUpsertOne) UpdatePlayerMessageID ¶
func (u *GuildUpsertOne) UpdatePlayerMessageID() *GuildUpsertOne
UpdatePlayerMessageID sets the "player_message_id" field to the value that was provided on create.
func (*GuildUpsertOne) UpdateUpdatedAt ¶
func (u *GuildUpsertOne) UpdateUpdatedAt() *GuildUpsertOne
UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
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 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 QuerierFunc ¶
type QuerierFunc = ent.QuerierFunc
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 ¶
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.
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 ¶
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 Tx ¶
type Tx struct { // Guild is the client for interacting with the Guild builders. Guild *GuildClient // contains filtered or unexported fields }
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
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.