Documentation
¶
Index ¶
- Constants
- Variables
- 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 Users
- type UsersClient
- func (c *UsersClient) Create() *UsersCreate
- func (c *UsersClient) CreateBulk(builders ...*UsersCreate) *UsersCreateBulk
- func (c *UsersClient) Delete() *UsersDelete
- func (c *UsersClient) DeleteOne(u *Users) *UsersDeleteOne
- func (c *UsersClient) DeleteOneID(id int) *UsersDeleteOne
- func (c *UsersClient) Get(ctx context.Context, id int) (*Users, error)
- func (c *UsersClient) GetX(ctx context.Context, id int) *Users
- func (c *UsersClient) Hooks() []Hook
- func (c *UsersClient) Intercept(interceptors ...Interceptor)
- func (c *UsersClient) Interceptors() []Interceptor
- func (c *UsersClient) MapCreateBulk(slice any, setFunc func(*UsersCreate, int)) *UsersCreateBulk
- func (c *UsersClient) Query() *UsersQuery
- func (c *UsersClient) Update() *UsersUpdate
- func (c *UsersClient) UpdateOne(u *Users) *UsersUpdateOne
- func (c *UsersClient) UpdateOneID(id int) *UsersUpdateOne
- func (c *UsersClient) Use(hooks ...Hook)
- type UsersCreate
- func (uc *UsersCreate) Exec(ctx context.Context) error
- func (uc *UsersCreate) ExecX(ctx context.Context)
- func (uc *UsersCreate) Mutation() *UsersMutation
- func (uc *UsersCreate) Save(ctx context.Context) (*Users, error)
- func (uc *UsersCreate) SaveX(ctx context.Context) *Users
- func (uc *UsersCreate) SetBirthdayCount(i int) *UsersCreate
- func (uc *UsersCreate) SetFullName(s string) *UsersCreate
- func (uc *UsersCreate) SetIsPremium(b bool) *UsersCreate
- func (uc *UsersCreate) SetNillableBirthdayCount(i *int) *UsersCreate
- func (uc *UsersCreate) SetNillableIsPremium(b *bool) *UsersCreate
- func (uc *UsersCreate) SetNillableUsername(s *string) *UsersCreate
- func (uc *UsersCreate) SetTelegramID(i int) *UsersCreate
- func (uc *UsersCreate) SetUsername(s string) *UsersCreate
- type UsersCreateBulk
- type UsersDelete
- type UsersDeleteOne
- type UsersGroupBy
- func (ugb *UsersGroupBy) Aggregate(fns ...AggregateFunc) *UsersGroupBy
- func (s *UsersGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UsersGroupBy) BoolX(ctx context.Context) bool
- func (s *UsersGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UsersGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UsersGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UsersGroupBy) Float64X(ctx context.Context) float64
- func (s *UsersGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UsersGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UsersGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UsersGroupBy) IntX(ctx context.Context) int
- func (s *UsersGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UsersGroupBy) IntsX(ctx context.Context) []int
- func (ugb *UsersGroupBy) Scan(ctx context.Context, v any) error
- func (s *UsersGroupBy) ScanX(ctx context.Context, v any)
- func (s *UsersGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UsersGroupBy) StringX(ctx context.Context) string
- func (s *UsersGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UsersGroupBy) StringsX(ctx context.Context) []string
- type UsersMutation
- func (m *UsersMutation) AddBirthdayCount(i int)
- func (m *UsersMutation) AddField(name string, value ent.Value) error
- func (m *UsersMutation) AddTelegramID(i int)
- func (m *UsersMutation) AddedBirthdayCount() (r int, exists bool)
- func (m *UsersMutation) AddedEdges() []string
- func (m *UsersMutation) AddedField(name string) (ent.Value, bool)
- func (m *UsersMutation) AddedFields() []string
- func (m *UsersMutation) AddedIDs(name string) []ent.Value
- func (m *UsersMutation) AddedTelegramID() (r int, exists bool)
- func (m *UsersMutation) BirthdayCount() (r int, exists bool)
- func (m *UsersMutation) ClearEdge(name string) error
- func (m *UsersMutation) ClearField(name string) error
- func (m *UsersMutation) ClearUsername()
- func (m *UsersMutation) ClearedEdges() []string
- func (m *UsersMutation) ClearedFields() []string
- func (m UsersMutation) Client() *Client
- func (m *UsersMutation) EdgeCleared(name string) bool
- func (m *UsersMutation) Field(name string) (ent.Value, bool)
- func (m *UsersMutation) FieldCleared(name string) bool
- func (m *UsersMutation) Fields() []string
- func (m *UsersMutation) FullName() (r string, exists bool)
- func (m *UsersMutation) ID() (id int, exists bool)
- func (m *UsersMutation) IDs(ctx context.Context) ([]int, error)
- func (m *UsersMutation) IsPremium() (r bool, exists bool)
- func (m *UsersMutation) OldBirthdayCount(ctx context.Context) (v int, err error)
- func (m *UsersMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UsersMutation) OldFullName(ctx context.Context) (v string, err error)
- func (m *UsersMutation) OldIsPremium(ctx context.Context) (v bool, err error)
- func (m *UsersMutation) OldTelegramID(ctx context.Context) (v int, err error)
- func (m *UsersMutation) OldUsername(ctx context.Context) (v string, err error)
- func (m *UsersMutation) Op() Op
- func (m *UsersMutation) RemovedEdges() []string
- func (m *UsersMutation) RemovedIDs(name string) []ent.Value
- func (m *UsersMutation) ResetBirthdayCount()
- func (m *UsersMutation) ResetEdge(name string) error
- func (m *UsersMutation) ResetField(name string) error
- func (m *UsersMutation) ResetFullName()
- func (m *UsersMutation) ResetIsPremium()
- func (m *UsersMutation) ResetTelegramID()
- func (m *UsersMutation) ResetUsername()
- func (m *UsersMutation) SetBirthdayCount(i int)
- func (m *UsersMutation) SetField(name string, value ent.Value) error
- func (m *UsersMutation) SetFullName(s string)
- func (m *UsersMutation) SetIsPremium(b bool)
- func (m *UsersMutation) SetOp(op Op)
- func (m *UsersMutation) SetTelegramID(i int)
- func (m *UsersMutation) SetUsername(s string)
- func (m *UsersMutation) TelegramID() (r int, exists bool)
- func (m UsersMutation) Tx() (*Tx, error)
- func (m *UsersMutation) Type() string
- func (m *UsersMutation) Username() (r string, exists bool)
- func (m *UsersMutation) UsernameCleared() bool
- func (m *UsersMutation) Where(ps ...predicate.Users)
- func (m *UsersMutation) WhereP(ps ...func(*sql.Selector))
- type UsersQuery
- func (uq *UsersQuery) Aggregate(fns ...AggregateFunc) *UsersSelect
- func (uq *UsersQuery) All(ctx context.Context) ([]*Users, error)
- func (uq *UsersQuery) AllX(ctx context.Context) []*Users
- func (uq *UsersQuery) Clone() *UsersQuery
- func (uq *UsersQuery) Count(ctx context.Context) (int, error)
- func (uq *UsersQuery) CountX(ctx context.Context) int
- func (uq *UsersQuery) Exist(ctx context.Context) (bool, error)
- func (uq *UsersQuery) ExistX(ctx context.Context) bool
- func (uq *UsersQuery) First(ctx context.Context) (*Users, error)
- func (uq *UsersQuery) FirstID(ctx context.Context) (id int, err error)
- func (uq *UsersQuery) FirstIDX(ctx context.Context) int
- func (uq *UsersQuery) FirstX(ctx context.Context) *Users
- func (uq *UsersQuery) GroupBy(field string, fields ...string) *UsersGroupBy
- func (uq *UsersQuery) IDs(ctx context.Context) (ids []int, err error)
- func (uq *UsersQuery) IDsX(ctx context.Context) []int
- func (uq *UsersQuery) Limit(limit int) *UsersQuery
- func (uq *UsersQuery) Offset(offset int) *UsersQuery
- func (uq *UsersQuery) Only(ctx context.Context) (*Users, error)
- func (uq *UsersQuery) OnlyID(ctx context.Context) (id int, err error)
- func (uq *UsersQuery) OnlyIDX(ctx context.Context) int
- func (uq *UsersQuery) OnlyX(ctx context.Context) *Users
- func (uq *UsersQuery) Order(o ...users.OrderOption) *UsersQuery
- func (uq *UsersQuery) Select(fields ...string) *UsersSelect
- func (uq *UsersQuery) Unique(unique bool) *UsersQuery
- func (uq *UsersQuery) Where(ps ...predicate.Users) *UsersQuery
- type UsersSelect
- func (us *UsersSelect) Aggregate(fns ...AggregateFunc) *UsersSelect
- func (s *UsersSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UsersSelect) BoolX(ctx context.Context) bool
- func (s *UsersSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UsersSelect) BoolsX(ctx context.Context) []bool
- func (s *UsersSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UsersSelect) Float64X(ctx context.Context) float64
- func (s *UsersSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UsersSelect) Float64sX(ctx context.Context) []float64
- func (s *UsersSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UsersSelect) IntX(ctx context.Context) int
- func (s *UsersSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UsersSelect) IntsX(ctx context.Context) []int
- func (us *UsersSelect) Scan(ctx context.Context, v any) error
- func (s *UsersSelect) ScanX(ctx context.Context, v any)
- func (s *UsersSelect) String(ctx context.Context) (_ string, err error)
- func (s *UsersSelect) StringX(ctx context.Context) string
- func (s *UsersSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UsersSelect) StringsX(ctx context.Context) []string
- type UsersSlice
- type UsersUpdate
- func (uu *UsersUpdate) AddBirthdayCount(i int) *UsersUpdate
- func (uu *UsersUpdate) AddTelegramID(i int) *UsersUpdate
- func (uu *UsersUpdate) ClearUsername() *UsersUpdate
- func (uu *UsersUpdate) Exec(ctx context.Context) error
- func (uu *UsersUpdate) ExecX(ctx context.Context)
- func (uu *UsersUpdate) Mutation() *UsersMutation
- func (uu *UsersUpdate) Save(ctx context.Context) (int, error)
- func (uu *UsersUpdate) SaveX(ctx context.Context) int
- func (uu *UsersUpdate) SetBirthdayCount(i int) *UsersUpdate
- func (uu *UsersUpdate) SetFullName(s string) *UsersUpdate
- func (uu *UsersUpdate) SetIsPremium(b bool) *UsersUpdate
- func (uu *UsersUpdate) SetNillableBirthdayCount(i *int) *UsersUpdate
- func (uu *UsersUpdate) SetNillableFullName(s *string) *UsersUpdate
- func (uu *UsersUpdate) SetNillableIsPremium(b *bool) *UsersUpdate
- func (uu *UsersUpdate) SetNillableTelegramID(i *int) *UsersUpdate
- func (uu *UsersUpdate) SetNillableUsername(s *string) *UsersUpdate
- func (uu *UsersUpdate) SetTelegramID(i int) *UsersUpdate
- func (uu *UsersUpdate) SetUsername(s string) *UsersUpdate
- func (uu *UsersUpdate) Where(ps ...predicate.Users) *UsersUpdate
- type UsersUpdateOne
- func (uuo *UsersUpdateOne) AddBirthdayCount(i int) *UsersUpdateOne
- func (uuo *UsersUpdateOne) AddTelegramID(i int) *UsersUpdateOne
- func (uuo *UsersUpdateOne) ClearUsername() *UsersUpdateOne
- func (uuo *UsersUpdateOne) Exec(ctx context.Context) error
- func (uuo *UsersUpdateOne) ExecX(ctx context.Context)
- func (uuo *UsersUpdateOne) Mutation() *UsersMutation
- func (uuo *UsersUpdateOne) Save(ctx context.Context) (*Users, error)
- func (uuo *UsersUpdateOne) SaveX(ctx context.Context) *Users
- func (uuo *UsersUpdateOne) Select(field string, fields ...string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetBirthdayCount(i int) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetFullName(s string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetIsPremium(b bool) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetNillableBirthdayCount(i *int) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetNillableFullName(s *string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetNillableIsPremium(b *bool) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetNillableTelegramID(i *int) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetNillableUsername(s *string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetTelegramID(i int) *UsersUpdateOne
- func (uuo *UsersUpdateOne) SetUsername(s string) *UsersUpdateOne
- func (uuo *UsersUpdateOne) Where(ps ...predicate.Users) *UsersUpdateOne
- 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. TypeUsers = "Users" )
Variables ¶
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")
ErrTxStarted is returned when trying to start a new transaction from a transactional client.
Functions ¶
func 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 // Users is the client for interacting with the Users builders. Users *UsersClient // 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(). Users. 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 { // Users is the client for interacting with the Users builders. Users *UsersClient // 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 Users ¶
type Users struct { // ID of the ent. ID int `json:"id,omitempty"` // TelegramID holds the value of the "telegram_id" field. TelegramID int `json:"telegram_id,omitempty"` // Username holds the value of the "username" field. Username string `json:"username,omitempty"` // FullName holds the value of the "full_name" field. FullName string `json:"full_name,omitempty"` // IsPremium holds the value of the "is_premium" field. IsPremium bool `json:"is_premium,omitempty"` // BirthdayCount holds the value of the "birthday_count" field. BirthdayCount int `json:"birthday_count,omitempty"` // contains filtered or unexported fields }
Users is the model entity for the Users schema.
func (*Users) Unwrap ¶
Unwrap unwraps the Users 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 (*Users) Update ¶
func (u *Users) Update() *UsersUpdateOne
Update returns a builder for updating this Users. Note that you need to call Users.Unwrap() before calling this method if this Users was returned from a transaction, and the transaction was committed or rolled back.
type UsersClient ¶
type UsersClient struct {
// contains filtered or unexported fields
}
UsersClient is a client for the Users schema.
func NewUsersClient ¶
func NewUsersClient(c config) *UsersClient
NewUsersClient returns a client for the Users from the given config.
func (*UsersClient) Create ¶
func (c *UsersClient) Create() *UsersCreate
Create returns a builder for creating a Users entity.
func (*UsersClient) CreateBulk ¶
func (c *UsersClient) CreateBulk(builders ...*UsersCreate) *UsersCreateBulk
CreateBulk returns a builder for creating a bulk of Users entities.
func (*UsersClient) Delete ¶
func (c *UsersClient) Delete() *UsersDelete
Delete returns a delete builder for Users.
func (*UsersClient) DeleteOne ¶
func (c *UsersClient) DeleteOne(u *Users) *UsersDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UsersClient) DeleteOneID ¶
func (c *UsersClient) DeleteOneID(id int) *UsersDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UsersClient) GetX ¶
func (c *UsersClient) GetX(ctx context.Context, id int) *Users
GetX is like Get, but panics if an error occurs.
func (*UsersClient) Intercept ¶
func (c *UsersClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `users.Intercept(f(g(h())))`.
func (*UsersClient) Interceptors ¶
func (c *UsersClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UsersClient) MapCreateBulk ¶
func (c *UsersClient) MapCreateBulk(slice any, setFunc func(*UsersCreate, int)) *UsersCreateBulk
MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.
func (*UsersClient) Query ¶
func (c *UsersClient) Query() *UsersQuery
Query returns a query builder for Users.
func (*UsersClient) Update ¶
func (c *UsersClient) Update() *UsersUpdate
Update returns an update builder for Users.
func (*UsersClient) UpdateOne ¶
func (c *UsersClient) UpdateOne(u *Users) *UsersUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UsersClient) UpdateOneID ¶
func (c *UsersClient) UpdateOneID(id int) *UsersUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UsersClient) Use ¶
func (c *UsersClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `users.Hooks(f(g(h())))`.
type UsersCreate ¶
type UsersCreate struct {
// contains filtered or unexported fields
}
UsersCreate is the builder for creating a Users entity.
func (*UsersCreate) Exec ¶
func (uc *UsersCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UsersCreate) ExecX ¶
func (uc *UsersCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UsersCreate) Mutation ¶
func (uc *UsersCreate) Mutation() *UsersMutation
Mutation returns the UsersMutation object of the builder.
func (*UsersCreate) Save ¶
func (uc *UsersCreate) Save(ctx context.Context) (*Users, error)
Save creates the Users in the database.
func (*UsersCreate) SaveX ¶
func (uc *UsersCreate) SaveX(ctx context.Context) *Users
SaveX calls Save and panics if Save returns an error.
func (*UsersCreate) SetBirthdayCount ¶
func (uc *UsersCreate) SetBirthdayCount(i int) *UsersCreate
SetBirthdayCount sets the "birthday_count" field.
func (*UsersCreate) SetFullName ¶
func (uc *UsersCreate) SetFullName(s string) *UsersCreate
SetFullName sets the "full_name" field.
func (*UsersCreate) SetIsPremium ¶
func (uc *UsersCreate) SetIsPremium(b bool) *UsersCreate
SetIsPremium sets the "is_premium" field.
func (*UsersCreate) SetNillableBirthdayCount ¶
func (uc *UsersCreate) SetNillableBirthdayCount(i *int) *UsersCreate
SetNillableBirthdayCount sets the "birthday_count" field if the given value is not nil.
func (*UsersCreate) SetNillableIsPremium ¶
func (uc *UsersCreate) SetNillableIsPremium(b *bool) *UsersCreate
SetNillableIsPremium sets the "is_premium" field if the given value is not nil.
func (*UsersCreate) SetNillableUsername ¶
func (uc *UsersCreate) SetNillableUsername(s *string) *UsersCreate
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UsersCreate) SetTelegramID ¶
func (uc *UsersCreate) SetTelegramID(i int) *UsersCreate
SetTelegramID sets the "telegram_id" field.
func (*UsersCreate) SetUsername ¶
func (uc *UsersCreate) SetUsername(s string) *UsersCreate
SetUsername sets the "username" field.
type UsersCreateBulk ¶
type UsersCreateBulk struct {
// contains filtered or unexported fields
}
UsersCreateBulk is the builder for creating many Users entities in bulk.
func (*UsersCreateBulk) Exec ¶
func (ucb *UsersCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UsersCreateBulk) ExecX ¶
func (ucb *UsersCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
type UsersDelete ¶
type UsersDelete struct {
// contains filtered or unexported fields
}
UsersDelete is the builder for deleting a Users entity.
func (*UsersDelete) Exec ¶
func (ud *UsersDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UsersDelete) ExecX ¶
func (ud *UsersDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UsersDelete) Where ¶
func (ud *UsersDelete) Where(ps ...predicate.Users) *UsersDelete
Where appends a list predicates to the UsersDelete builder.
type UsersDeleteOne ¶
type UsersDeleteOne struct {
// contains filtered or unexported fields
}
UsersDeleteOne is the builder for deleting a single Users entity.
func (*UsersDeleteOne) Exec ¶
func (udo *UsersDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UsersDeleteOne) ExecX ¶
func (udo *UsersDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UsersDeleteOne) Where ¶
func (udo *UsersDeleteOne) Where(ps ...predicate.Users) *UsersDeleteOne
Where appends a list predicates to the UsersDelete builder.
type UsersGroupBy ¶
type UsersGroupBy struct {
// contains filtered or unexported fields
}
UsersGroupBy is the group-by builder for Users entities.
func (*UsersGroupBy) Aggregate ¶
func (ugb *UsersGroupBy) Aggregate(fns ...AggregateFunc) *UsersGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UsersGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UsersGroupBy) Scan ¶
func (ugb *UsersGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UsersGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UsersMutation ¶
type UsersMutation struct {
// contains filtered or unexported fields
}
UsersMutation represents an operation that mutates the Users nodes in the graph.
func (*UsersMutation) AddBirthdayCount ¶
func (m *UsersMutation) AddBirthdayCount(i int)
AddBirthdayCount adds i to the "birthday_count" field.
func (*UsersMutation) AddField ¶
func (m *UsersMutation) 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 (*UsersMutation) AddTelegramID ¶
func (m *UsersMutation) AddTelegramID(i int)
AddTelegramID adds i to the "telegram_id" field.
func (*UsersMutation) AddedBirthdayCount ¶
func (m *UsersMutation) AddedBirthdayCount() (r int, exists bool)
AddedBirthdayCount returns the value that was added to the "birthday_count" field in this mutation.
func (*UsersMutation) AddedEdges ¶
func (m *UsersMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UsersMutation) AddedField ¶
func (m *UsersMutation) 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 (*UsersMutation) AddedFields ¶
func (m *UsersMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UsersMutation) AddedIDs ¶
func (m *UsersMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UsersMutation) AddedTelegramID ¶
func (m *UsersMutation) AddedTelegramID() (r int, exists bool)
AddedTelegramID returns the value that was added to the "telegram_id" field in this mutation.
func (*UsersMutation) BirthdayCount ¶
func (m *UsersMutation) BirthdayCount() (r int, exists bool)
BirthdayCount returns the value of the "birthday_count" field in the mutation.
func (*UsersMutation) ClearEdge ¶
func (m *UsersMutation) 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 (*UsersMutation) ClearField ¶
func (m *UsersMutation) 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 (*UsersMutation) ClearUsername ¶
func (m *UsersMutation) ClearUsername()
ClearUsername clears the value of the "username" field.
func (*UsersMutation) ClearedEdges ¶
func (m *UsersMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UsersMutation) ClearedFields ¶
func (m *UsersMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UsersMutation) Client ¶
func (m UsersMutation) 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 (*UsersMutation) EdgeCleared ¶
func (m *UsersMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UsersMutation) Field ¶
func (m *UsersMutation) 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 (*UsersMutation) FieldCleared ¶
func (m *UsersMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UsersMutation) Fields ¶
func (m *UsersMutation) 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 (*UsersMutation) FullName ¶
func (m *UsersMutation) FullName() (r string, exists bool)
FullName returns the value of the "full_name" field in the mutation.
func (*UsersMutation) ID ¶
func (m *UsersMutation) 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 (*UsersMutation) IDs ¶
func (m *UsersMutation) 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 (*UsersMutation) IsPremium ¶
func (m *UsersMutation) IsPremium() (r bool, exists bool)
IsPremium returns the value of the "is_premium" field in the mutation.
func (*UsersMutation) OldBirthdayCount ¶
func (m *UsersMutation) OldBirthdayCount(ctx context.Context) (v int, err error)
OldBirthdayCount returns the old "birthday_count" field's value of the Users entity. If the Users 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 (*UsersMutation) 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 (*UsersMutation) OldFullName ¶
func (m *UsersMutation) OldFullName(ctx context.Context) (v string, err error)
OldFullName returns the old "full_name" field's value of the Users entity. If the Users 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 (*UsersMutation) OldIsPremium ¶
func (m *UsersMutation) OldIsPremium(ctx context.Context) (v bool, err error)
OldIsPremium returns the old "is_premium" field's value of the Users entity. If the Users 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 (*UsersMutation) OldTelegramID ¶
func (m *UsersMutation) OldTelegramID(ctx context.Context) (v int, err error)
OldTelegramID returns the old "telegram_id" field's value of the Users entity. If the Users 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 (*UsersMutation) OldUsername ¶
func (m *UsersMutation) OldUsername(ctx context.Context) (v string, err error)
OldUsername returns the old "username" field's value of the Users entity. If the Users 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 (*UsersMutation) RemovedEdges ¶
func (m *UsersMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UsersMutation) RemovedIDs ¶
func (m *UsersMutation) 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 (*UsersMutation) ResetBirthdayCount ¶
func (m *UsersMutation) ResetBirthdayCount()
ResetBirthdayCount resets all changes to the "birthday_count" field.
func (*UsersMutation) ResetEdge ¶
func (m *UsersMutation) 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 (*UsersMutation) ResetField ¶
func (m *UsersMutation) 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 (*UsersMutation) ResetFullName ¶
func (m *UsersMutation) ResetFullName()
ResetFullName resets all changes to the "full_name" field.
func (*UsersMutation) ResetIsPremium ¶
func (m *UsersMutation) ResetIsPremium()
ResetIsPremium resets all changes to the "is_premium" field.
func (*UsersMutation) ResetTelegramID ¶
func (m *UsersMutation) ResetTelegramID()
ResetTelegramID resets all changes to the "telegram_id" field.
func (*UsersMutation) ResetUsername ¶
func (m *UsersMutation) ResetUsername()
ResetUsername resets all changes to the "username" field.
func (*UsersMutation) SetBirthdayCount ¶
func (m *UsersMutation) SetBirthdayCount(i int)
SetBirthdayCount sets the "birthday_count" field.
func (*UsersMutation) SetField ¶
func (m *UsersMutation) 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 (*UsersMutation) SetFullName ¶
func (m *UsersMutation) SetFullName(s string)
SetFullName sets the "full_name" field.
func (*UsersMutation) SetIsPremium ¶
func (m *UsersMutation) SetIsPremium(b bool)
SetIsPremium sets the "is_premium" field.
func (*UsersMutation) SetOp ¶
func (m *UsersMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*UsersMutation) SetTelegramID ¶
func (m *UsersMutation) SetTelegramID(i int)
SetTelegramID sets the "telegram_id" field.
func (*UsersMutation) SetUsername ¶
func (m *UsersMutation) SetUsername(s string)
SetUsername sets the "username" field.
func (*UsersMutation) TelegramID ¶
func (m *UsersMutation) TelegramID() (r int, exists bool)
TelegramID returns the value of the "telegram_id" field in the mutation.
func (UsersMutation) Tx ¶
func (m UsersMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UsersMutation) Type ¶
func (m *UsersMutation) Type() string
Type returns the node type of this mutation (Users).
func (*UsersMutation) Username ¶
func (m *UsersMutation) Username() (r string, exists bool)
Username returns the value of the "username" field in the mutation.
func (*UsersMutation) UsernameCleared ¶
func (m *UsersMutation) UsernameCleared() bool
UsernameCleared returns if the "username" field was cleared in this mutation.
func (*UsersMutation) Where ¶
func (m *UsersMutation) Where(ps ...predicate.Users)
Where appends a list predicates to the UsersMutation builder.
func (*UsersMutation) WhereP ¶
func (m *UsersMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UsersMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UsersQuery ¶
type UsersQuery struct {
// contains filtered or unexported fields
}
UsersQuery is the builder for querying Users entities.
func (*UsersQuery) Aggregate ¶
func (uq *UsersQuery) Aggregate(fns ...AggregateFunc) *UsersSelect
Aggregate returns a UsersSelect configured with the given aggregations.
func (*UsersQuery) All ¶
func (uq *UsersQuery) All(ctx context.Context) ([]*Users, error)
All executes the query and returns a list of UsersSlice.
func (*UsersQuery) AllX ¶
func (uq *UsersQuery) AllX(ctx context.Context) []*Users
AllX is like All, but panics if an error occurs.
func (*UsersQuery) Clone ¶
func (uq *UsersQuery) Clone() *UsersQuery
Clone returns a duplicate of the UsersQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UsersQuery) Count ¶
func (uq *UsersQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*UsersQuery) CountX ¶
func (uq *UsersQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*UsersQuery) Exist ¶
func (uq *UsersQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*UsersQuery) ExistX ¶
func (uq *UsersQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*UsersQuery) First ¶
func (uq *UsersQuery) First(ctx context.Context) (*Users, error)
First returns the first Users entity from the query. Returns a *NotFoundError when no Users was found.
func (*UsersQuery) FirstID ¶
func (uq *UsersQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first Users ID from the query. Returns a *NotFoundError when no Users ID was found.
func (*UsersQuery) FirstIDX ¶
func (uq *UsersQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*UsersQuery) FirstX ¶
func (uq *UsersQuery) FirstX(ctx context.Context) *Users
FirstX is like First, but panics if an error occurs.
func (*UsersQuery) GroupBy ¶
func (uq *UsersQuery) GroupBy(field string, fields ...string) *UsersGroupBy
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 { TelegramID int `json:"telegram_id,omitempty"` Count int `json:"count,omitempty"` } client.Users.Query(). GroupBy(users.FieldTelegramID). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UsersQuery) IDs ¶
func (uq *UsersQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of Users IDs.
func (*UsersQuery) IDsX ¶
func (uq *UsersQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*UsersQuery) Limit ¶
func (uq *UsersQuery) Limit(limit int) *UsersQuery
Limit the number of records to be returned by this query.
func (*UsersQuery) Offset ¶
func (uq *UsersQuery) Offset(offset int) *UsersQuery
Offset to start from.
func (*UsersQuery) Only ¶
func (uq *UsersQuery) Only(ctx context.Context) (*Users, error)
Only returns a single Users entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Users entity is found. Returns a *NotFoundError when no Users entities are found.
func (*UsersQuery) OnlyID ¶
func (uq *UsersQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only Users ID in the query. Returns a *NotSingularError when more than one Users ID is found. Returns a *NotFoundError when no entities are found.
func (*UsersQuery) OnlyIDX ¶
func (uq *UsersQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*UsersQuery) OnlyX ¶
func (uq *UsersQuery) OnlyX(ctx context.Context) *Users
OnlyX is like Only, but panics if an error occurs.
func (*UsersQuery) Order ¶
func (uq *UsersQuery) Order(o ...users.OrderOption) *UsersQuery
Order specifies how the records should be ordered.
func (*UsersQuery) Select ¶
func (uq *UsersQuery) Select(fields ...string) *UsersSelect
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 { TelegramID int `json:"telegram_id,omitempty"` } client.Users.Query(). Select(users.FieldTelegramID). Scan(ctx, &v)
func (*UsersQuery) Unique ¶
func (uq *UsersQuery) Unique(unique bool) *UsersQuery
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 (*UsersQuery) Where ¶
func (uq *UsersQuery) Where(ps ...predicate.Users) *UsersQuery
Where adds a new predicate for the UsersQuery builder.
type UsersSelect ¶
type UsersSelect struct { *UsersQuery // contains filtered or unexported fields }
UsersSelect is the builder for selecting fields of Users entities.
func (*UsersSelect) Aggregate ¶
func (us *UsersSelect) Aggregate(fns ...AggregateFunc) *UsersSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UsersSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UsersSelect) Scan ¶
func (us *UsersSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UsersSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UsersUpdate ¶
type UsersUpdate struct {
// contains filtered or unexported fields
}
UsersUpdate is the builder for updating Users entities.
func (*UsersUpdate) AddBirthdayCount ¶
func (uu *UsersUpdate) AddBirthdayCount(i int) *UsersUpdate
AddBirthdayCount adds i to the "birthday_count" field.
func (*UsersUpdate) AddTelegramID ¶
func (uu *UsersUpdate) AddTelegramID(i int) *UsersUpdate
AddTelegramID adds i to the "telegram_id" field.
func (*UsersUpdate) ClearUsername ¶
func (uu *UsersUpdate) ClearUsername() *UsersUpdate
ClearUsername clears the value of the "username" field.
func (*UsersUpdate) Exec ¶
func (uu *UsersUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UsersUpdate) ExecX ¶
func (uu *UsersUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UsersUpdate) Mutation ¶
func (uu *UsersUpdate) Mutation() *UsersMutation
Mutation returns the UsersMutation object of the builder.
func (*UsersUpdate) Save ¶
func (uu *UsersUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UsersUpdate) SaveX ¶
func (uu *UsersUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UsersUpdate) SetBirthdayCount ¶
func (uu *UsersUpdate) SetBirthdayCount(i int) *UsersUpdate
SetBirthdayCount sets the "birthday_count" field.
func (*UsersUpdate) SetFullName ¶
func (uu *UsersUpdate) SetFullName(s string) *UsersUpdate
SetFullName sets the "full_name" field.
func (*UsersUpdate) SetIsPremium ¶
func (uu *UsersUpdate) SetIsPremium(b bool) *UsersUpdate
SetIsPremium sets the "is_premium" field.
func (*UsersUpdate) SetNillableBirthdayCount ¶
func (uu *UsersUpdate) SetNillableBirthdayCount(i *int) *UsersUpdate
SetNillableBirthdayCount sets the "birthday_count" field if the given value is not nil.
func (*UsersUpdate) SetNillableFullName ¶
func (uu *UsersUpdate) SetNillableFullName(s *string) *UsersUpdate
SetNillableFullName sets the "full_name" field if the given value is not nil.
func (*UsersUpdate) SetNillableIsPremium ¶
func (uu *UsersUpdate) SetNillableIsPremium(b *bool) *UsersUpdate
SetNillableIsPremium sets the "is_premium" field if the given value is not nil.
func (*UsersUpdate) SetNillableTelegramID ¶
func (uu *UsersUpdate) SetNillableTelegramID(i *int) *UsersUpdate
SetNillableTelegramID sets the "telegram_id" field if the given value is not nil.
func (*UsersUpdate) SetNillableUsername ¶
func (uu *UsersUpdate) SetNillableUsername(s *string) *UsersUpdate
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UsersUpdate) SetTelegramID ¶
func (uu *UsersUpdate) SetTelegramID(i int) *UsersUpdate
SetTelegramID sets the "telegram_id" field.
func (*UsersUpdate) SetUsername ¶
func (uu *UsersUpdate) SetUsername(s string) *UsersUpdate
SetUsername sets the "username" field.
func (*UsersUpdate) Where ¶
func (uu *UsersUpdate) Where(ps ...predicate.Users) *UsersUpdate
Where appends a list predicates to the UsersUpdate builder.
type UsersUpdateOne ¶
type UsersUpdateOne struct {
// contains filtered or unexported fields
}
UsersUpdateOne is the builder for updating a single Users entity.
func (*UsersUpdateOne) AddBirthdayCount ¶
func (uuo *UsersUpdateOne) AddBirthdayCount(i int) *UsersUpdateOne
AddBirthdayCount adds i to the "birthday_count" field.
func (*UsersUpdateOne) AddTelegramID ¶
func (uuo *UsersUpdateOne) AddTelegramID(i int) *UsersUpdateOne
AddTelegramID adds i to the "telegram_id" field.
func (*UsersUpdateOne) ClearUsername ¶
func (uuo *UsersUpdateOne) ClearUsername() *UsersUpdateOne
ClearUsername clears the value of the "username" field.
func (*UsersUpdateOne) Exec ¶
func (uuo *UsersUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UsersUpdateOne) ExecX ¶
func (uuo *UsersUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UsersUpdateOne) Mutation ¶
func (uuo *UsersUpdateOne) Mutation() *UsersMutation
Mutation returns the UsersMutation object of the builder.
func (*UsersUpdateOne) Save ¶
func (uuo *UsersUpdateOne) Save(ctx context.Context) (*Users, error)
Save executes the query and returns the updated Users entity.
func (*UsersUpdateOne) SaveX ¶
func (uuo *UsersUpdateOne) SaveX(ctx context.Context) *Users
SaveX is like Save, but panics if an error occurs.
func (*UsersUpdateOne) Select ¶
func (uuo *UsersUpdateOne) Select(field string, fields ...string) *UsersUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UsersUpdateOne) SetBirthdayCount ¶
func (uuo *UsersUpdateOne) SetBirthdayCount(i int) *UsersUpdateOne
SetBirthdayCount sets the "birthday_count" field.
func (*UsersUpdateOne) SetFullName ¶
func (uuo *UsersUpdateOne) SetFullName(s string) *UsersUpdateOne
SetFullName sets the "full_name" field.
func (*UsersUpdateOne) SetIsPremium ¶
func (uuo *UsersUpdateOne) SetIsPremium(b bool) *UsersUpdateOne
SetIsPremium sets the "is_premium" field.
func (*UsersUpdateOne) SetNillableBirthdayCount ¶
func (uuo *UsersUpdateOne) SetNillableBirthdayCount(i *int) *UsersUpdateOne
SetNillableBirthdayCount sets the "birthday_count" field if the given value is not nil.
func (*UsersUpdateOne) SetNillableFullName ¶
func (uuo *UsersUpdateOne) SetNillableFullName(s *string) *UsersUpdateOne
SetNillableFullName sets the "full_name" field if the given value is not nil.
func (*UsersUpdateOne) SetNillableIsPremium ¶
func (uuo *UsersUpdateOne) SetNillableIsPremium(b *bool) *UsersUpdateOne
SetNillableIsPremium sets the "is_premium" field if the given value is not nil.
func (*UsersUpdateOne) SetNillableTelegramID ¶
func (uuo *UsersUpdateOne) SetNillableTelegramID(i *int) *UsersUpdateOne
SetNillableTelegramID sets the "telegram_id" field if the given value is not nil.
func (*UsersUpdateOne) SetNillableUsername ¶
func (uuo *UsersUpdateOne) SetNillableUsername(s *string) *UsersUpdateOne
SetNillableUsername sets the "username" field if the given value is not nil.
func (*UsersUpdateOne) SetTelegramID ¶
func (uuo *UsersUpdateOne) SetTelegramID(i int) *UsersUpdateOne
SetTelegramID sets the "telegram_id" field.
func (*UsersUpdateOne) SetUsername ¶
func (uuo *UsersUpdateOne) SetUsername(s string) *UsersUpdateOne
SetUsername sets the "username" field.
func (*UsersUpdateOne) Where ¶
func (uuo *UsersUpdateOne) Where(ps ...predicate.Users) *UsersUpdateOne
Where appends a list predicates to the UsersUpdate builder.
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.