Documentation
¶
Index ¶
- Constants
- func Asc(fields ...string) func(*sql.Selector)
- func Desc(fields ...string) func(*sql.Selector)
- 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) Tx(ctx context.Context) (*Tx, error)
- func (c *Client) Use(hooks ...Hook)
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- 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
- type World
- type WorldClient
- func (c *WorldClient) Create() *WorldCreate
- func (c *WorldClient) CreateBulk(builders ...*WorldCreate) *WorldCreateBulk
- func (c *WorldClient) Delete() *WorldDelete
- func (c *WorldClient) DeleteOne(w *World) *WorldDeleteOne
- func (c *WorldClient) DeleteOneID(id int) *WorldDeleteOne
- func (c *WorldClient) Get(ctx context.Context, id int) (*World, error)
- func (c *WorldClient) GetX(ctx context.Context, id int) *World
- func (c *WorldClient) Hooks() []Hook
- func (c *WorldClient) Intercept(interceptors ...Interceptor)
- func (c *WorldClient) Interceptors() []Interceptor
- func (c *WorldClient) Query() *WorldQuery
- func (c *WorldClient) Update() *WorldUpdate
- func (c *WorldClient) UpdateOne(w *World) *WorldUpdateOne
- func (c *WorldClient) UpdateOneID(id int) *WorldUpdateOne
- func (c *WorldClient) Use(hooks ...Hook)
- type WorldCreate
- func (wc *WorldCreate) Exec(ctx context.Context) error
- func (wc *WorldCreate) ExecX(ctx context.Context)
- func (wc *WorldCreate) Mutation() *WorldMutation
- func (wc *WorldCreate) Save(ctx context.Context) (*World, error)
- func (wc *WorldCreate) SaveX(ctx context.Context) *World
- func (wc *WorldCreate) SetDeletedAt(t time.Time) *WorldCreate
- func (wc *WorldCreate) SetID(i int) *WorldCreate
- func (wc *WorldCreate) SetName(s string) *WorldCreate
- func (wc *WorldCreate) SetNillableDeletedAt(t *time.Time) *WorldCreate
- func (wc *WorldCreate) SetNillablePowerBy(s *string) *WorldCreate
- func (wc *WorldCreate) SetPowerBy(s string) *WorldCreate
- func (wc *WorldCreate) SetTenantID(i int) *WorldCreate
- type WorldCreateBulk
- type WorldDelete
- type WorldDeleteOne
- type WorldFilter
- type WorldGroupBy
- func (wgb *WorldGroupBy) Aggregate(fns ...AggregateFunc) *WorldGroupBy
- func (s *WorldGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *WorldGroupBy) BoolX(ctx context.Context) bool
- func (s *WorldGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *WorldGroupBy) BoolsX(ctx context.Context) []bool
- func (s *WorldGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *WorldGroupBy) Float64X(ctx context.Context) float64
- func (s *WorldGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *WorldGroupBy) Float64sX(ctx context.Context) []float64
- func (s *WorldGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *WorldGroupBy) IntX(ctx context.Context) int
- func (s *WorldGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *WorldGroupBy) IntsX(ctx context.Context) []int
- func (wgb *WorldGroupBy) Scan(ctx context.Context, v any) error
- func (s *WorldGroupBy) ScanX(ctx context.Context, v any)
- func (s *WorldGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *WorldGroupBy) StringX(ctx context.Context) string
- func (s *WorldGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *WorldGroupBy) StringsX(ctx context.Context) []string
- type WorldMutation
- func (m *WorldMutation) AddField(name string, value ent.Value) error
- func (m *WorldMutation) AddTenantID(i int)
- func (m *WorldMutation) AddedEdges() []string
- func (m *WorldMutation) AddedField(name string) (ent.Value, bool)
- func (m *WorldMutation) AddedFields() []string
- func (m *WorldMutation) AddedIDs(name string) []ent.Value
- func (m *WorldMutation) AddedTenantID() (r int, exists bool)
- func (m *WorldMutation) ClearDeletedAt()
- func (m *WorldMutation) ClearEdge(name string) error
- func (m *WorldMutation) ClearField(name string) error
- func (m *WorldMutation) ClearPowerBy()
- func (m *WorldMutation) ClearedEdges() []string
- func (m *WorldMutation) ClearedFields() []string
- func (m WorldMutation) Client() *Client
- func (m *WorldMutation) DeletedAt() (r time.Time, exists bool)
- func (m *WorldMutation) DeletedAtCleared() bool
- func (m *WorldMutation) EdgeCleared(name string) bool
- func (m *WorldMutation) Field(name string) (ent.Value, bool)
- func (m *WorldMutation) FieldCleared(name string) bool
- func (m *WorldMutation) Fields() []string
- func (m *WorldMutation) Filter() *WorldFilter
- func (m *WorldMutation) ID() (id int, exists bool)
- func (m *WorldMutation) IDs(ctx context.Context) ([]int, error)
- func (m *WorldMutation) Name() (r string, exists bool)
- func (m *WorldMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error)
- func (m *WorldMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *WorldMutation) OldName(ctx context.Context) (v string, err error)
- func (m *WorldMutation) OldPowerBy(ctx context.Context) (v string, err error)
- func (m *WorldMutation) OldTenantID(ctx context.Context) (v int, err error)
- func (m *WorldMutation) Op() Op
- func (m *WorldMutation) PowerBy() (r string, exists bool)
- func (m *WorldMutation) PowerByCleared() bool
- func (m *WorldMutation) RemovedEdges() []string
- func (m *WorldMutation) RemovedIDs(name string) []ent.Value
- func (m *WorldMutation) ResetDeletedAt()
- func (m *WorldMutation) ResetEdge(name string) error
- func (m *WorldMutation) ResetField(name string) error
- func (m *WorldMutation) ResetName()
- func (m *WorldMutation) ResetPowerBy()
- func (m *WorldMutation) ResetTenantID()
- func (m *WorldMutation) SetDeletedAt(t time.Time)
- func (m *WorldMutation) SetField(name string, value ent.Value) error
- func (m *WorldMutation) SetID(id int)
- func (m *WorldMutation) SetName(s string)
- func (m *WorldMutation) SetOp(op Op)
- func (m *WorldMutation) SetPowerBy(s string)
- func (m *WorldMutation) SetTenantID(i int)
- func (m *WorldMutation) TenantID() (r int, exists bool)
- func (m WorldMutation) Tx() (*Tx, error)
- func (m *WorldMutation) Type() string
- func (m *WorldMutation) Where(ps ...predicate.World)
- func (m *WorldMutation) WhereP(ps ...func(*sql.Selector))
- type WorldQuery
- func (wq *WorldQuery) Aggregate(fns ...AggregateFunc) *WorldSelect
- func (wq *WorldQuery) All(ctx context.Context) ([]*World, error)
- func (wq *WorldQuery) AllX(ctx context.Context) []*World
- func (wq *WorldQuery) Clone() *WorldQuery
- func (wq *WorldQuery) Count(ctx context.Context) (int, error)
- func (wq *WorldQuery) CountX(ctx context.Context) int
- func (wq *WorldQuery) Exist(ctx context.Context) (bool, error)
- func (wq *WorldQuery) ExistX(ctx context.Context) bool
- func (wq *WorldQuery) Filter() *WorldFilter
- func (wq *WorldQuery) First(ctx context.Context) (*World, error)
- func (wq *WorldQuery) FirstID(ctx context.Context) (id int, err error)
- func (wq *WorldQuery) FirstIDX(ctx context.Context) int
- func (wq *WorldQuery) FirstX(ctx context.Context) *World
- func (wq *WorldQuery) GroupBy(field string, fields ...string) *WorldGroupBy
- func (wq *WorldQuery) IDs(ctx context.Context) (ids []int, err error)
- func (wq *WorldQuery) IDsX(ctx context.Context) []int
- func (wq *WorldQuery) Limit(limit int) *WorldQuery
- func (wq *WorldQuery) Offset(offset int) *WorldQuery
- func (wq *WorldQuery) Only(ctx context.Context) (*World, error)
- func (wq *WorldQuery) OnlyID(ctx context.Context) (id int, err error)
- func (wq *WorldQuery) OnlyIDX(ctx context.Context) int
- func (wq *WorldQuery) OnlyX(ctx context.Context) *World
- func (wq *WorldQuery) Order(o ...world.OrderOption) *WorldQuery
- func (wq *WorldQuery) Select(fields ...string) *WorldSelect
- func (wq *WorldQuery) Unique(unique bool) *WorldQuery
- func (wq *WorldQuery) Where(ps ...predicate.World) *WorldQuery
- type WorldSelect
- func (ws *WorldSelect) Aggregate(fns ...AggregateFunc) *WorldSelect
- func (s *WorldSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *WorldSelect) BoolX(ctx context.Context) bool
- func (s *WorldSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *WorldSelect) BoolsX(ctx context.Context) []bool
- func (s *WorldSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *WorldSelect) Float64X(ctx context.Context) float64
- func (s *WorldSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *WorldSelect) Float64sX(ctx context.Context) []float64
- func (s *WorldSelect) Int(ctx context.Context) (_ int, err error)
- func (s *WorldSelect) IntX(ctx context.Context) int
- func (s *WorldSelect) Ints(ctx context.Context) ([]int, error)
- func (s *WorldSelect) IntsX(ctx context.Context) []int
- func (ws *WorldSelect) Scan(ctx context.Context, v any) error
- func (s *WorldSelect) ScanX(ctx context.Context, v any)
- func (s *WorldSelect) String(ctx context.Context) (_ string, err error)
- func (s *WorldSelect) StringX(ctx context.Context) string
- func (s *WorldSelect) Strings(ctx context.Context) ([]string, error)
- func (s *WorldSelect) StringsX(ctx context.Context) []string
- type WorldUpdate
- func (wu *WorldUpdate) ClearDeletedAt() *WorldUpdate
- func (wu *WorldUpdate) ClearPowerBy() *WorldUpdate
- func (wu *WorldUpdate) Exec(ctx context.Context) error
- func (wu *WorldUpdate) ExecX(ctx context.Context)
- func (wu *WorldUpdate) Mutation() *WorldMutation
- func (wu *WorldUpdate) Save(ctx context.Context) (int, error)
- func (wu *WorldUpdate) SaveX(ctx context.Context) int
- func (wu *WorldUpdate) SetDeletedAt(t time.Time) *WorldUpdate
- func (wu *WorldUpdate) SetName(s string) *WorldUpdate
- func (wu *WorldUpdate) SetNillableDeletedAt(t *time.Time) *WorldUpdate
- func (wu *WorldUpdate) SetNillablePowerBy(s *string) *WorldUpdate
- func (wu *WorldUpdate) SetPowerBy(s string) *WorldUpdate
- func (wu *WorldUpdate) Where(ps ...predicate.World) *WorldUpdate
- type WorldUpdateOne
- func (wuo *WorldUpdateOne) ClearDeletedAt() *WorldUpdateOne
- func (wuo *WorldUpdateOne) ClearPowerBy() *WorldUpdateOne
- func (wuo *WorldUpdateOne) Exec(ctx context.Context) error
- func (wuo *WorldUpdateOne) ExecX(ctx context.Context)
- func (wuo *WorldUpdateOne) Mutation() *WorldMutation
- func (wuo *WorldUpdateOne) Save(ctx context.Context) (*World, error)
- func (wuo *WorldUpdateOne) SaveX(ctx context.Context) *World
- func (wuo *WorldUpdateOne) Select(field string, fields ...string) *WorldUpdateOne
- func (wuo *WorldUpdateOne) SetDeletedAt(t time.Time) *WorldUpdateOne
- func (wuo *WorldUpdateOne) SetName(s string) *WorldUpdateOne
- func (wuo *WorldUpdateOne) SetNillableDeletedAt(t *time.Time) *WorldUpdateOne
- func (wuo *WorldUpdateOne) SetNillablePowerBy(s *string) *WorldUpdateOne
- func (wuo *WorldUpdateOne) SetPowerBy(s string) *WorldUpdateOne
- func (wuo *WorldUpdateOne) Where(ps ...predicate.World) *WorldUpdateOne
- type Worlds
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeWorld = "World" )
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 // World is the client for interacting with the World builders. World *WorldClient // 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(). World. 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 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 OrderFunc ¶
OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.
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 { // World is the client for interacting with the World builders. World *WorldClient // 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.
type World ¶
type World struct { // ID of the ent. ID int `json:"id,omitempty"` // TenantID holds the value of the "tenant_id" field. TenantID int `json:"tenant_id,omitempty"` // DeletedAt holds the value of the "deleted_at" field. DeletedAt time.Time `json:"deleted_at,omitempty"` // Name holds the value of the "name" field. Name string `json:"name,omitempty"` // PowerBy holds the value of the "power_by" field. PowerBy string `json:"power_by,omitempty"` // contains filtered or unexported fields }
World is the model entity for the World schema.
func (*World) Unwrap ¶
Unwrap unwraps the World 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 (*World) Update ¶
func (w *World) Update() *WorldUpdateOne
Update returns a builder for updating this World. Note that you need to call World.Unwrap() before calling this method if this World was returned from a transaction, and the transaction was committed or rolled back.
type WorldClient ¶
type WorldClient struct {
// contains filtered or unexported fields
}
WorldClient is a client for the World schema.
func NewWorldClient ¶
func NewWorldClient(c config) *WorldClient
NewWorldClient returns a client for the World from the given config.
func (*WorldClient) Create ¶
func (c *WorldClient) Create() *WorldCreate
Create returns a builder for creating a World entity.
func (*WorldClient) CreateBulk ¶
func (c *WorldClient) CreateBulk(builders ...*WorldCreate) *WorldCreateBulk
CreateBulk returns a builder for creating a bulk of World entities.
func (*WorldClient) Delete ¶
func (c *WorldClient) Delete() *WorldDelete
Delete returns a delete builder for World.
func (*WorldClient) DeleteOne ¶
func (c *WorldClient) DeleteOne(w *World) *WorldDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*WorldClient) DeleteOneID ¶
func (c *WorldClient) DeleteOneID(id int) *WorldDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*WorldClient) GetX ¶
func (c *WorldClient) GetX(ctx context.Context, id int) *World
GetX is like Get, but panics if an error occurs.
func (*WorldClient) Intercept ¶
func (c *WorldClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `world.Intercept(f(g(h())))`.
func (*WorldClient) Interceptors ¶
func (c *WorldClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*WorldClient) Query ¶
func (c *WorldClient) Query() *WorldQuery
Query returns a query builder for World.
func (*WorldClient) Update ¶
func (c *WorldClient) Update() *WorldUpdate
Update returns an update builder for World.
func (*WorldClient) UpdateOne ¶
func (c *WorldClient) UpdateOne(w *World) *WorldUpdateOne
UpdateOne returns an update builder for the given entity.
func (*WorldClient) UpdateOneID ¶
func (c *WorldClient) UpdateOneID(id int) *WorldUpdateOne
UpdateOneID returns an update builder for the given id.
func (*WorldClient) Use ¶
func (c *WorldClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `world.Hooks(f(g(h())))`.
type WorldCreate ¶
type WorldCreate struct {
// contains filtered or unexported fields
}
WorldCreate is the builder for creating a World entity.
func (*WorldCreate) Exec ¶
func (wc *WorldCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*WorldCreate) ExecX ¶
func (wc *WorldCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WorldCreate) Mutation ¶
func (wc *WorldCreate) Mutation() *WorldMutation
Mutation returns the WorldMutation object of the builder.
func (*WorldCreate) Save ¶
func (wc *WorldCreate) Save(ctx context.Context) (*World, error)
Save creates the World in the database.
func (*WorldCreate) SaveX ¶
func (wc *WorldCreate) SaveX(ctx context.Context) *World
SaveX calls Save and panics if Save returns an error.
func (*WorldCreate) SetDeletedAt ¶
func (wc *WorldCreate) SetDeletedAt(t time.Time) *WorldCreate
SetDeletedAt sets the "deleted_at" field.
func (*WorldCreate) SetID ¶
func (wc *WorldCreate) SetID(i int) *WorldCreate
SetID sets the "id" field.
func (*WorldCreate) SetName ¶
func (wc *WorldCreate) SetName(s string) *WorldCreate
SetName sets the "name" field.
func (*WorldCreate) SetNillableDeletedAt ¶
func (wc *WorldCreate) SetNillableDeletedAt(t *time.Time) *WorldCreate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*WorldCreate) SetNillablePowerBy ¶
func (wc *WorldCreate) SetNillablePowerBy(s *string) *WorldCreate
SetNillablePowerBy sets the "power_by" field if the given value is not nil.
func (*WorldCreate) SetPowerBy ¶
func (wc *WorldCreate) SetPowerBy(s string) *WorldCreate
SetPowerBy sets the "power_by" field.
func (*WorldCreate) SetTenantID ¶
func (wc *WorldCreate) SetTenantID(i int) *WorldCreate
SetTenantID sets the "tenant_id" field.
type WorldCreateBulk ¶
type WorldCreateBulk struct {
// contains filtered or unexported fields
}
WorldCreateBulk is the builder for creating many World entities in bulk.
func (*WorldCreateBulk) Exec ¶
func (wcb *WorldCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*WorldCreateBulk) ExecX ¶
func (wcb *WorldCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type WorldDelete ¶
type WorldDelete struct {
// contains filtered or unexported fields
}
WorldDelete is the builder for deleting a World entity.
func (*WorldDelete) Exec ¶
func (wd *WorldDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*WorldDelete) ExecX ¶
func (wd *WorldDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*WorldDelete) Where ¶
func (wd *WorldDelete) Where(ps ...predicate.World) *WorldDelete
Where appends a list predicates to the WorldDelete builder.
type WorldDeleteOne ¶
type WorldDeleteOne struct {
// contains filtered or unexported fields
}
WorldDeleteOne is the builder for deleting a single World entity.
func (*WorldDeleteOne) Exec ¶
func (wdo *WorldDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*WorldDeleteOne) ExecX ¶
func (wdo *WorldDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WorldDeleteOne) Where ¶
func (wdo *WorldDeleteOne) Where(ps ...predicate.World) *WorldDeleteOne
Where appends a list predicates to the WorldDelete builder.
type WorldFilter ¶
type WorldFilter struct {
// contains filtered or unexported fields
}
WorldFilter provides a generic filtering capability at runtime for WorldQuery.
func (*WorldFilter) Where ¶
func (f *WorldFilter) Where(p entql.P)
Where applies the entql predicate on the query filter.
func (*WorldFilter) WhereDeletedAt ¶
func (f *WorldFilter) WhereDeletedAt(p entql.TimeP)
WhereDeletedAt applies the entql time.Time predicate on the deleted_at field.
func (*WorldFilter) WhereID ¶
func (f *WorldFilter) WhereID(p entql.IntP)
WhereID applies the entql int predicate on the id field.
func (*WorldFilter) WhereName ¶
func (f *WorldFilter) WhereName(p entql.StringP)
WhereName applies the entql string predicate on the name field.
func (*WorldFilter) WherePowerBy ¶
func (f *WorldFilter) WherePowerBy(p entql.StringP)
WherePowerBy applies the entql string predicate on the power_by field.
func (*WorldFilter) WhereTenantID ¶
func (f *WorldFilter) WhereTenantID(p entql.IntP)
WhereTenantID applies the entql int predicate on the tenant_id field.
type WorldGroupBy ¶
type WorldGroupBy struct {
// contains filtered or unexported fields
}
WorldGroupBy is the group-by builder for World entities.
func (*WorldGroupBy) Aggregate ¶
func (wgb *WorldGroupBy) Aggregate(fns ...AggregateFunc) *WorldGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*WorldGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*WorldGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*WorldGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*WorldGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*WorldGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*WorldGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*WorldGroupBy) Scan ¶
func (wgb *WorldGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*WorldGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type WorldMutation ¶
type WorldMutation struct {
// contains filtered or unexported fields
}
WorldMutation represents an operation that mutates the World nodes in the graph.
func (*WorldMutation) AddField ¶
func (m *WorldMutation) 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 (*WorldMutation) AddTenantID ¶
func (m *WorldMutation) AddTenantID(i int)
AddTenantID adds i to the "tenant_id" field.
func (*WorldMutation) AddedEdges ¶
func (m *WorldMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*WorldMutation) AddedField ¶
func (m *WorldMutation) 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 (*WorldMutation) AddedFields ¶
func (m *WorldMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*WorldMutation) AddedIDs ¶
func (m *WorldMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*WorldMutation) AddedTenantID ¶
func (m *WorldMutation) AddedTenantID() (r int, exists bool)
AddedTenantID returns the value that was added to the "tenant_id" field in this mutation.
func (*WorldMutation) ClearDeletedAt ¶
func (m *WorldMutation) ClearDeletedAt()
ClearDeletedAt clears the value of the "deleted_at" field.
func (*WorldMutation) ClearEdge ¶
func (m *WorldMutation) 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 (*WorldMutation) ClearField ¶
func (m *WorldMutation) 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 (*WorldMutation) ClearPowerBy ¶
func (m *WorldMutation) ClearPowerBy()
ClearPowerBy clears the value of the "power_by" field.
func (*WorldMutation) ClearedEdges ¶
func (m *WorldMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*WorldMutation) ClearedFields ¶
func (m *WorldMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (WorldMutation) Client ¶
func (m WorldMutation) 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 (*WorldMutation) DeletedAt ¶
func (m *WorldMutation) DeletedAt() (r time.Time, exists bool)
DeletedAt returns the value of the "deleted_at" field in the mutation.
func (*WorldMutation) DeletedAtCleared ¶
func (m *WorldMutation) DeletedAtCleared() bool
DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.
func (*WorldMutation) EdgeCleared ¶
func (m *WorldMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*WorldMutation) Field ¶
func (m *WorldMutation) 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 (*WorldMutation) FieldCleared ¶
func (m *WorldMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*WorldMutation) Fields ¶
func (m *WorldMutation) 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 (*WorldMutation) Filter ¶
func (m *WorldMutation) Filter() *WorldFilter
Filter returns an entql.Where implementation to apply filters on the WorldMutation builder.
func (*WorldMutation) ID ¶
func (m *WorldMutation) ID() (id int, 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 (*WorldMutation) IDs ¶
func (m *WorldMutation) IDs(ctx context.Context) ([]int, 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 (*WorldMutation) Name ¶
func (m *WorldMutation) Name() (r string, exists bool)
Name returns the value of the "name" field in the mutation.
func (*WorldMutation) OldDeletedAt ¶
OldDeletedAt returns the old "deleted_at" field's value of the World entity. If the World 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 (*WorldMutation) 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 (*WorldMutation) OldName ¶
func (m *WorldMutation) OldName(ctx context.Context) (v string, err error)
OldName returns the old "name" field's value of the World entity. If the World 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 (*WorldMutation) OldPowerBy ¶
func (m *WorldMutation) OldPowerBy(ctx context.Context) (v string, err error)
OldPowerBy returns the old "power_by" field's value of the World entity. If the World 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 (*WorldMutation) OldTenantID ¶
func (m *WorldMutation) OldTenantID(ctx context.Context) (v int, err error)
OldTenantID returns the old "tenant_id" field's value of the World entity. If the World 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 (*WorldMutation) PowerBy ¶
func (m *WorldMutation) PowerBy() (r string, exists bool)
PowerBy returns the value of the "power_by" field in the mutation.
func (*WorldMutation) PowerByCleared ¶
func (m *WorldMutation) PowerByCleared() bool
PowerByCleared returns if the "power_by" field was cleared in this mutation.
func (*WorldMutation) RemovedEdges ¶
func (m *WorldMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*WorldMutation) RemovedIDs ¶
func (m *WorldMutation) 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 (*WorldMutation) ResetDeletedAt ¶
func (m *WorldMutation) ResetDeletedAt()
ResetDeletedAt resets all changes to the "deleted_at" field.
func (*WorldMutation) ResetEdge ¶
func (m *WorldMutation) 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 (*WorldMutation) ResetField ¶
func (m *WorldMutation) 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 (*WorldMutation) ResetName ¶
func (m *WorldMutation) ResetName()
ResetName resets all changes to the "name" field.
func (*WorldMutation) ResetPowerBy ¶
func (m *WorldMutation) ResetPowerBy()
ResetPowerBy resets all changes to the "power_by" field.
func (*WorldMutation) ResetTenantID ¶
func (m *WorldMutation) ResetTenantID()
ResetTenantID resets all changes to the "tenant_id" field.
func (*WorldMutation) SetDeletedAt ¶
func (m *WorldMutation) SetDeletedAt(t time.Time)
SetDeletedAt sets the "deleted_at" field.
func (*WorldMutation) SetField ¶
func (m *WorldMutation) 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 (*WorldMutation) SetID ¶
func (m *WorldMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of World entities.
func (*WorldMutation) SetName ¶
func (m *WorldMutation) SetName(s string)
SetName sets the "name" field.
func (*WorldMutation) SetOp ¶
func (m *WorldMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*WorldMutation) SetPowerBy ¶
func (m *WorldMutation) SetPowerBy(s string)
SetPowerBy sets the "power_by" field.
func (*WorldMutation) SetTenantID ¶
func (m *WorldMutation) SetTenantID(i int)
SetTenantID sets the "tenant_id" field.
func (*WorldMutation) TenantID ¶
func (m *WorldMutation) TenantID() (r int, exists bool)
TenantID returns the value of the "tenant_id" field in the mutation.
func (WorldMutation) Tx ¶
func (m WorldMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*WorldMutation) Type ¶
func (m *WorldMutation) Type() string
Type returns the node type of this mutation (World).
func (*WorldMutation) Where ¶
func (m *WorldMutation) Where(ps ...predicate.World)
Where appends a list predicates to the WorldMutation builder.
func (*WorldMutation) WhereP ¶
func (m *WorldMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the WorldMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type WorldQuery ¶
type WorldQuery struct {
// contains filtered or unexported fields
}
WorldQuery is the builder for querying World entities.
func (*WorldQuery) Aggregate ¶
func (wq *WorldQuery) Aggregate(fns ...AggregateFunc) *WorldSelect
Aggregate returns a WorldSelect configured with the given aggregations.
func (*WorldQuery) All ¶
func (wq *WorldQuery) All(ctx context.Context) ([]*World, error)
All executes the query and returns a list of Worlds.
func (*WorldQuery) AllX ¶
func (wq *WorldQuery) AllX(ctx context.Context) []*World
AllX is like All, but panics if an error occurs.
func (*WorldQuery) Clone ¶
func (wq *WorldQuery) Clone() *WorldQuery
Clone returns a duplicate of the WorldQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*WorldQuery) Count ¶
func (wq *WorldQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*WorldQuery) CountX ¶
func (wq *WorldQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*WorldQuery) Exist ¶
func (wq *WorldQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*WorldQuery) ExistX ¶
func (wq *WorldQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*WorldQuery) Filter ¶
func (wq *WorldQuery) Filter() *WorldFilter
Filter returns a Filter implementation to apply filters on the WorldQuery builder.
func (*WorldQuery) First ¶
func (wq *WorldQuery) First(ctx context.Context) (*World, error)
First returns the first World entity from the query. Returns a *NotFoundError when no World was found.
func (*WorldQuery) FirstID ¶
func (wq *WorldQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first World ID from the query. Returns a *NotFoundError when no World ID was found.
func (*WorldQuery) FirstIDX ¶
func (wq *WorldQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*WorldQuery) FirstX ¶
func (wq *WorldQuery) FirstX(ctx context.Context) *World
FirstX is like First, but panics if an error occurs.
func (*WorldQuery) GroupBy ¶
func (wq *WorldQuery) GroupBy(field string, fields ...string) *WorldGroupBy
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 { TenantID int `json:"tenant_id,omitempty"` Count int `json:"count,omitempty"` } client.World.Query(). GroupBy(world.FieldTenantID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*WorldQuery) IDs ¶
func (wq *WorldQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of World IDs.
func (*WorldQuery) IDsX ¶
func (wq *WorldQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*WorldQuery) Limit ¶
func (wq *WorldQuery) Limit(limit int) *WorldQuery
Limit the number of records to be returned by this query.
func (*WorldQuery) Offset ¶
func (wq *WorldQuery) Offset(offset int) *WorldQuery
Offset to start from.
func (*WorldQuery) Only ¶
func (wq *WorldQuery) Only(ctx context.Context) (*World, error)
Only returns a single World entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one World entity is found. Returns a *NotFoundError when no World entities are found.
func (*WorldQuery) OnlyID ¶
func (wq *WorldQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only World ID in the query. Returns a *NotSingularError when more than one World ID is found. Returns a *NotFoundError when no entities are found.
func (*WorldQuery) OnlyIDX ¶
func (wq *WorldQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*WorldQuery) OnlyX ¶
func (wq *WorldQuery) OnlyX(ctx context.Context) *World
OnlyX is like Only, but panics if an error occurs.
func (*WorldQuery) Order ¶
func (wq *WorldQuery) Order(o ...world.OrderOption) *WorldQuery
Order specifies how the records should be ordered.
func (*WorldQuery) Select ¶
func (wq *WorldQuery) Select(fields ...string) *WorldSelect
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 { TenantID int `json:"tenant_id,omitempty"` } client.World.Query(). Select(world.FieldTenantID). Scan(ctx, &v)
func (*WorldQuery) Unique ¶
func (wq *WorldQuery) Unique(unique bool) *WorldQuery
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 (*WorldQuery) Where ¶
func (wq *WorldQuery) Where(ps ...predicate.World) *WorldQuery
Where adds a new predicate for the WorldQuery builder.
type WorldSelect ¶
type WorldSelect struct { *WorldQuery // contains filtered or unexported fields }
WorldSelect is the builder for selecting fields of World entities.
func (*WorldSelect) Aggregate ¶
func (ws *WorldSelect) Aggregate(fns ...AggregateFunc) *WorldSelect
Aggregate adds the given aggregation functions to the selector query.
func (*WorldSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*WorldSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*WorldSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*WorldSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*WorldSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*WorldSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*WorldSelect) Scan ¶
func (ws *WorldSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*WorldSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type WorldUpdate ¶
type WorldUpdate struct {
// contains filtered or unexported fields
}
WorldUpdate is the builder for updating World entities.
func (*WorldUpdate) ClearDeletedAt ¶
func (wu *WorldUpdate) ClearDeletedAt() *WorldUpdate
ClearDeletedAt clears the value of the "deleted_at" field.
func (*WorldUpdate) ClearPowerBy ¶
func (wu *WorldUpdate) ClearPowerBy() *WorldUpdate
ClearPowerBy clears the value of the "power_by" field.
func (*WorldUpdate) Exec ¶
func (wu *WorldUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*WorldUpdate) ExecX ¶
func (wu *WorldUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WorldUpdate) Mutation ¶
func (wu *WorldUpdate) Mutation() *WorldMutation
Mutation returns the WorldMutation object of the builder.
func (*WorldUpdate) Save ¶
func (wu *WorldUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*WorldUpdate) SaveX ¶
func (wu *WorldUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*WorldUpdate) SetDeletedAt ¶
func (wu *WorldUpdate) SetDeletedAt(t time.Time) *WorldUpdate
SetDeletedAt sets the "deleted_at" field.
func (*WorldUpdate) SetName ¶
func (wu *WorldUpdate) SetName(s string) *WorldUpdate
SetName sets the "name" field.
func (*WorldUpdate) SetNillableDeletedAt ¶
func (wu *WorldUpdate) SetNillableDeletedAt(t *time.Time) *WorldUpdate
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*WorldUpdate) SetNillablePowerBy ¶
func (wu *WorldUpdate) SetNillablePowerBy(s *string) *WorldUpdate
SetNillablePowerBy sets the "power_by" field if the given value is not nil.
func (*WorldUpdate) SetPowerBy ¶
func (wu *WorldUpdate) SetPowerBy(s string) *WorldUpdate
SetPowerBy sets the "power_by" field.
func (*WorldUpdate) Where ¶
func (wu *WorldUpdate) Where(ps ...predicate.World) *WorldUpdate
Where appends a list predicates to the WorldUpdate builder.
type WorldUpdateOne ¶
type WorldUpdateOne struct {
// contains filtered or unexported fields
}
WorldUpdateOne is the builder for updating a single World entity.
func (*WorldUpdateOne) ClearDeletedAt ¶
func (wuo *WorldUpdateOne) ClearDeletedAt() *WorldUpdateOne
ClearDeletedAt clears the value of the "deleted_at" field.
func (*WorldUpdateOne) ClearPowerBy ¶
func (wuo *WorldUpdateOne) ClearPowerBy() *WorldUpdateOne
ClearPowerBy clears the value of the "power_by" field.
func (*WorldUpdateOne) Exec ¶
func (wuo *WorldUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*WorldUpdateOne) ExecX ¶
func (wuo *WorldUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*WorldUpdateOne) Mutation ¶
func (wuo *WorldUpdateOne) Mutation() *WorldMutation
Mutation returns the WorldMutation object of the builder.
func (*WorldUpdateOne) Save ¶
func (wuo *WorldUpdateOne) Save(ctx context.Context) (*World, error)
Save executes the query and returns the updated World entity.
func (*WorldUpdateOne) SaveX ¶
func (wuo *WorldUpdateOne) SaveX(ctx context.Context) *World
SaveX is like Save, but panics if an error occurs.
func (*WorldUpdateOne) Select ¶
func (wuo *WorldUpdateOne) Select(field string, fields ...string) *WorldUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*WorldUpdateOne) SetDeletedAt ¶
func (wuo *WorldUpdateOne) SetDeletedAt(t time.Time) *WorldUpdateOne
SetDeletedAt sets the "deleted_at" field.
func (*WorldUpdateOne) SetName ¶
func (wuo *WorldUpdateOne) SetName(s string) *WorldUpdateOne
SetName sets the "name" field.
func (*WorldUpdateOne) SetNillableDeletedAt ¶
func (wuo *WorldUpdateOne) SetNillableDeletedAt(t *time.Time) *WorldUpdateOne
SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
func (*WorldUpdateOne) SetNillablePowerBy ¶
func (wuo *WorldUpdateOne) SetNillablePowerBy(s *string) *WorldUpdateOne
SetNillablePowerBy sets the "power_by" field if the given value is not nil.
func (*WorldUpdateOne) SetPowerBy ¶
func (wuo *WorldUpdateOne) SetPowerBy(s string) *WorldUpdateOne
SetPowerBy sets the "power_by" field.
func (*WorldUpdateOne) Where ¶
func (wuo *WorldUpdateOne) Where(ps ...predicate.World) *WorldUpdateOne
Where appends a list predicates to the WorldUpdate builder.