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 UserReport
- type UserReportClient
- func (c *UserReportClient) Create() *UserReportCreate
- func (c *UserReportClient) CreateBulk(builders ...*UserReportCreate) *UserReportCreateBulk
- func (c *UserReportClient) Delete() *UserReportDelete
- func (c *UserReportClient) DeleteOne(ur *UserReport) *UserReportDeleteOne
- func (c *UserReportClient) DeleteOneID(id string) *UserReportDeleteOne
- func (c *UserReportClient) Get(ctx context.Context, id string) (*UserReport, error)
- func (c *UserReportClient) GetX(ctx context.Context, id string) *UserReport
- func (c *UserReportClient) Hooks() []Hook
- func (c *UserReportClient) Intercept(interceptors ...Interceptor)
- func (c *UserReportClient) Interceptors() []Interceptor
- func (c *UserReportClient) MapCreateBulk(slice any, setFunc func(*UserReportCreate, int)) *UserReportCreateBulk
- func (c *UserReportClient) Query() *UserReportQuery
- func (c *UserReportClient) Update() *UserReportUpdate
- func (c *UserReportClient) UpdateOne(ur *UserReport) *UserReportUpdateOne
- func (c *UserReportClient) UpdateOneID(id string) *UserReportUpdateOne
- func (c *UserReportClient) Use(hooks ...Hook)
- type UserReportCreate
- func (urc *UserReportCreate) Exec(ctx context.Context) error
- func (urc *UserReportCreate) ExecX(ctx context.Context)
- func (urc *UserReportCreate) Mutation() *UserReportMutation
- func (urc *UserReportCreate) Save(ctx context.Context) (*UserReport, error)
- func (urc *UserReportCreate) SaveX(ctx context.Context) *UserReport
- func (urc *UserReportCreate) SetCreatedAt(t time.Time) *UserReportCreate
- func (urc *UserReportCreate) SetID(s string) *UserReportCreate
- func (urc *UserReportCreate) SetNillableCreatedAt(t *time.Time) *UserReportCreate
- type UserReportCreateBulk
- type UserReportDelete
- type UserReportDeleteOne
- type UserReportGroupBy
- func (urgb *UserReportGroupBy) Aggregate(fns ...AggregateFunc) *UserReportGroupBy
- func (s *UserReportGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserReportGroupBy) BoolX(ctx context.Context) bool
- func (s *UserReportGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *UserReportGroupBy) BoolsX(ctx context.Context) []bool
- func (s *UserReportGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserReportGroupBy) Float64X(ctx context.Context) float64
- func (s *UserReportGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserReportGroupBy) Float64sX(ctx context.Context) []float64
- func (s *UserReportGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *UserReportGroupBy) IntX(ctx context.Context) int
- func (s *UserReportGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *UserReportGroupBy) IntsX(ctx context.Context) []int
- func (urgb *UserReportGroupBy) Scan(ctx context.Context, v any) error
- func (s *UserReportGroupBy) ScanX(ctx context.Context, v any)
- func (s *UserReportGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *UserReportGroupBy) StringX(ctx context.Context) string
- func (s *UserReportGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *UserReportGroupBy) StringsX(ctx context.Context) []string
- type UserReportMutation
- func (m *UserReportMutation) AddField(name string, value ent.Value) error
- func (m *UserReportMutation) AddedEdges() []string
- func (m *UserReportMutation) AddedField(name string) (ent.Value, bool)
- func (m *UserReportMutation) AddedFields() []string
- func (m *UserReportMutation) AddedIDs(name string) []ent.Value
- func (m *UserReportMutation) ClearEdge(name string) error
- func (m *UserReportMutation) ClearField(name string) error
- func (m *UserReportMutation) ClearedEdges() []string
- func (m *UserReportMutation) ClearedFields() []string
- func (m UserReportMutation) Client() *Client
- func (m *UserReportMutation) CreatedAt() (r time.Time, exists bool)
- func (m *UserReportMutation) EdgeCleared(name string) bool
- func (m *UserReportMutation) Field(name string) (ent.Value, bool)
- func (m *UserReportMutation) FieldCleared(name string) bool
- func (m *UserReportMutation) Fields() []string
- func (m *UserReportMutation) ID() (id string, exists bool)
- func (m *UserReportMutation) IDs(ctx context.Context) ([]string, error)
- func (m *UserReportMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *UserReportMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *UserReportMutation) Op() Op
- func (m *UserReportMutation) RemovedEdges() []string
- func (m *UserReportMutation) RemovedIDs(name string) []ent.Value
- func (m *UserReportMutation) ResetCreatedAt()
- func (m *UserReportMutation) ResetEdge(name string) error
- func (m *UserReportMutation) ResetField(name string) error
- func (m *UserReportMutation) SetCreatedAt(t time.Time)
- func (m *UserReportMutation) SetField(name string, value ent.Value) error
- func (m *UserReportMutation) SetID(id string)
- func (m *UserReportMutation) SetOp(op Op)
- func (m UserReportMutation) Tx() (*Tx, error)
- func (m *UserReportMutation) Type() string
- func (m *UserReportMutation) Where(ps ...predicate.UserReport)
- func (m *UserReportMutation) WhereP(ps ...func(*sql.Selector))
- type UserReportQuery
- func (urq *UserReportQuery) Aggregate(fns ...AggregateFunc) *UserReportSelect
- func (urq *UserReportQuery) All(ctx context.Context) ([]*UserReport, error)
- func (urq *UserReportQuery) AllX(ctx context.Context) []*UserReport
- func (urq *UserReportQuery) Clone() *UserReportQuery
- func (urq *UserReportQuery) Count(ctx context.Context) (int, error)
- func (urq *UserReportQuery) CountX(ctx context.Context) int
- func (urq *UserReportQuery) Exist(ctx context.Context) (bool, error)
- func (urq *UserReportQuery) ExistX(ctx context.Context) bool
- func (urq *UserReportQuery) First(ctx context.Context) (*UserReport, error)
- func (urq *UserReportQuery) FirstID(ctx context.Context) (id string, err error)
- func (urq *UserReportQuery) FirstIDX(ctx context.Context) string
- func (urq *UserReportQuery) FirstX(ctx context.Context) *UserReport
- func (urq *UserReportQuery) GroupBy(field string, fields ...string) *UserReportGroupBy
- func (urq *UserReportQuery) IDs(ctx context.Context) (ids []string, err error)
- func (urq *UserReportQuery) IDsX(ctx context.Context) []string
- func (urq *UserReportQuery) Limit(limit int) *UserReportQuery
- func (urq *UserReportQuery) Offset(offset int) *UserReportQuery
- func (urq *UserReportQuery) Only(ctx context.Context) (*UserReport, error)
- func (urq *UserReportQuery) OnlyID(ctx context.Context) (id string, err error)
- func (urq *UserReportQuery) OnlyIDX(ctx context.Context) string
- func (urq *UserReportQuery) OnlyX(ctx context.Context) *UserReport
- func (urq *UserReportQuery) Order(o ...userreport.OrderOption) *UserReportQuery
- func (urq *UserReportQuery) Select(fields ...string) *UserReportSelect
- func (urq *UserReportQuery) Unique(unique bool) *UserReportQuery
- func (urq *UserReportQuery) Where(ps ...predicate.UserReport) *UserReportQuery
- type UserReportSelect
- func (urs *UserReportSelect) Aggregate(fns ...AggregateFunc) *UserReportSelect
- func (s *UserReportSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *UserReportSelect) BoolX(ctx context.Context) bool
- func (s *UserReportSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *UserReportSelect) BoolsX(ctx context.Context) []bool
- func (s *UserReportSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *UserReportSelect) Float64X(ctx context.Context) float64
- func (s *UserReportSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *UserReportSelect) Float64sX(ctx context.Context) []float64
- func (s *UserReportSelect) Int(ctx context.Context) (_ int, err error)
- func (s *UserReportSelect) IntX(ctx context.Context) int
- func (s *UserReportSelect) Ints(ctx context.Context) ([]int, error)
- func (s *UserReportSelect) IntsX(ctx context.Context) []int
- func (urs *UserReportSelect) Scan(ctx context.Context, v any) error
- func (s *UserReportSelect) ScanX(ctx context.Context, v any)
- func (s *UserReportSelect) String(ctx context.Context) (_ string, err error)
- func (s *UserReportSelect) StringX(ctx context.Context) string
- func (s *UserReportSelect) Strings(ctx context.Context) ([]string, error)
- func (s *UserReportSelect) StringsX(ctx context.Context) []string
- type UserReportUpdate
- func (uru *UserReportUpdate) Exec(ctx context.Context) error
- func (uru *UserReportUpdate) ExecX(ctx context.Context)
- func (uru *UserReportUpdate) Mutation() *UserReportMutation
- func (uru *UserReportUpdate) Save(ctx context.Context) (int, error)
- func (uru *UserReportUpdate) SaveX(ctx context.Context) int
- func (uru *UserReportUpdate) Where(ps ...predicate.UserReport) *UserReportUpdate
- type UserReportUpdateOne
- func (uruo *UserReportUpdateOne) Exec(ctx context.Context) error
- func (uruo *UserReportUpdateOne) ExecX(ctx context.Context)
- func (uruo *UserReportUpdateOne) Mutation() *UserReportMutation
- func (uruo *UserReportUpdateOne) Save(ctx context.Context) (*UserReport, error)
- func (uruo *UserReportUpdateOne) SaveX(ctx context.Context) *UserReport
- func (uruo *UserReportUpdateOne) Select(field string, fields ...string) *UserReportUpdateOne
- func (uruo *UserReportUpdateOne) Where(ps ...predicate.UserReport) *UserReportUpdateOne
- type UserReports
- 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. TypeUserReport = "UserReport" )
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 // UserReport is the client for interacting with the UserReport builders. UserReport *UserReportClient // 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(). UserReport. 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 { // UserReport is the client for interacting with the UserReport builders. UserReport *UserReportClient // 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 UserReport ¶
type UserReport struct { // ID of the ent. ID string `json:"id,omitempty"` // CreatedAt holds the value of the "created_at" field. CreatedAt time.Time `json:"created_at,omitempty"` // contains filtered or unexported fields }
UserReport is the model entity for the UserReport schema.
func (*UserReport) String ¶
func (ur *UserReport) String() string
String implements the fmt.Stringer.
func (*UserReport) Unwrap ¶
func (ur *UserReport) Unwrap() *UserReport
Unwrap unwraps the UserReport 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 (*UserReport) Update ¶
func (ur *UserReport) Update() *UserReportUpdateOne
Update returns a builder for updating this UserReport. Note that you need to call UserReport.Unwrap() before calling this method if this UserReport was returned from a transaction, and the transaction was committed or rolled back.
type UserReportClient ¶
type UserReportClient struct {
// contains filtered or unexported fields
}
UserReportClient is a client for the UserReport schema.
func NewUserReportClient ¶
func NewUserReportClient(c config) *UserReportClient
NewUserReportClient returns a client for the UserReport from the given config.
func (*UserReportClient) Create ¶
func (c *UserReportClient) Create() *UserReportCreate
Create returns a builder for creating a UserReport entity.
func (*UserReportClient) CreateBulk ¶
func (c *UserReportClient) CreateBulk(builders ...*UserReportCreate) *UserReportCreateBulk
CreateBulk returns a builder for creating a bulk of UserReport entities.
func (*UserReportClient) Delete ¶
func (c *UserReportClient) Delete() *UserReportDelete
Delete returns a delete builder for UserReport.
func (*UserReportClient) DeleteOne ¶
func (c *UserReportClient) DeleteOne(ur *UserReport) *UserReportDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*UserReportClient) DeleteOneID ¶
func (c *UserReportClient) DeleteOneID(id string) *UserReportDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*UserReportClient) Get ¶
func (c *UserReportClient) Get(ctx context.Context, id string) (*UserReport, error)
Get returns a UserReport entity by its id.
func (*UserReportClient) GetX ¶
func (c *UserReportClient) GetX(ctx context.Context, id string) *UserReport
GetX is like Get, but panics if an error occurs.
func (*UserReportClient) Hooks ¶
func (c *UserReportClient) Hooks() []Hook
Hooks returns the client hooks.
func (*UserReportClient) Intercept ¶
func (c *UserReportClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `userreport.Intercept(f(g(h())))`.
func (*UserReportClient) Interceptors ¶
func (c *UserReportClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*UserReportClient) MapCreateBulk ¶
func (c *UserReportClient) MapCreateBulk(slice any, setFunc func(*UserReportCreate, int)) *UserReportCreateBulk
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 (*UserReportClient) Query ¶
func (c *UserReportClient) Query() *UserReportQuery
Query returns a query builder for UserReport.
func (*UserReportClient) Update ¶
func (c *UserReportClient) Update() *UserReportUpdate
Update returns an update builder for UserReport.
func (*UserReportClient) UpdateOne ¶
func (c *UserReportClient) UpdateOne(ur *UserReport) *UserReportUpdateOne
UpdateOne returns an update builder for the given entity.
func (*UserReportClient) UpdateOneID ¶
func (c *UserReportClient) UpdateOneID(id string) *UserReportUpdateOne
UpdateOneID returns an update builder for the given id.
func (*UserReportClient) Use ¶
func (c *UserReportClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `userreport.Hooks(f(g(h())))`.
type UserReportCreate ¶
type UserReportCreate struct {
// contains filtered or unexported fields
}
UserReportCreate is the builder for creating a UserReport entity.
func (*UserReportCreate) Exec ¶
func (urc *UserReportCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserReportCreate) ExecX ¶
func (urc *UserReportCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserReportCreate) Mutation ¶
func (urc *UserReportCreate) Mutation() *UserReportMutation
Mutation returns the UserReportMutation object of the builder.
func (*UserReportCreate) Save ¶
func (urc *UserReportCreate) Save(ctx context.Context) (*UserReport, error)
Save creates the UserReport in the database.
func (*UserReportCreate) SaveX ¶
func (urc *UserReportCreate) SaveX(ctx context.Context) *UserReport
SaveX calls Save and panics if Save returns an error.
func (*UserReportCreate) SetCreatedAt ¶
func (urc *UserReportCreate) SetCreatedAt(t time.Time) *UserReportCreate
SetCreatedAt sets the "created_at" field.
func (*UserReportCreate) SetID ¶
func (urc *UserReportCreate) SetID(s string) *UserReportCreate
SetID sets the "id" field.
func (*UserReportCreate) SetNillableCreatedAt ¶
func (urc *UserReportCreate) SetNillableCreatedAt(t *time.Time) *UserReportCreate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
type UserReportCreateBulk ¶
type UserReportCreateBulk struct {
// contains filtered or unexported fields
}
UserReportCreateBulk is the builder for creating many UserReport entities in bulk.
func (*UserReportCreateBulk) Exec ¶
func (urcb *UserReportCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*UserReportCreateBulk) ExecX ¶
func (urcb *UserReportCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserReportCreateBulk) Save ¶
func (urcb *UserReportCreateBulk) Save(ctx context.Context) ([]*UserReport, error)
Save creates the UserReport entities in the database.
func (*UserReportCreateBulk) SaveX ¶
func (urcb *UserReportCreateBulk) SaveX(ctx context.Context) []*UserReport
SaveX is like Save, but panics if an error occurs.
type UserReportDelete ¶
type UserReportDelete struct {
// contains filtered or unexported fields
}
UserReportDelete is the builder for deleting a UserReport entity.
func (*UserReportDelete) Exec ¶
func (urd *UserReportDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*UserReportDelete) ExecX ¶
func (urd *UserReportDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*UserReportDelete) Where ¶
func (urd *UserReportDelete) Where(ps ...predicate.UserReport) *UserReportDelete
Where appends a list predicates to the UserReportDelete builder.
type UserReportDeleteOne ¶
type UserReportDeleteOne struct {
// contains filtered or unexported fields
}
UserReportDeleteOne is the builder for deleting a single UserReport entity.
func (*UserReportDeleteOne) Exec ¶
func (urdo *UserReportDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*UserReportDeleteOne) ExecX ¶
func (urdo *UserReportDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserReportDeleteOne) Where ¶
func (urdo *UserReportDeleteOne) Where(ps ...predicate.UserReport) *UserReportDeleteOne
Where appends a list predicates to the UserReportDelete builder.
type UserReportGroupBy ¶
type UserReportGroupBy struct {
// contains filtered or unexported fields
}
UserReportGroupBy is the group-by builder for UserReport entities.
func (*UserReportGroupBy) Aggregate ¶
func (urgb *UserReportGroupBy) Aggregate(fns ...AggregateFunc) *UserReportGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*UserReportGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserReportGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserReportGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserReportGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserReportGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserReportGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserReportGroupBy) Scan ¶
func (urgb *UserReportGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserReportGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserReportMutation ¶
type UserReportMutation struct {
// contains filtered or unexported fields
}
UserReportMutation represents an operation that mutates the UserReport nodes in the graph.
func (*UserReportMutation) AddField ¶
func (m *UserReportMutation) 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 (*UserReportMutation) AddedEdges ¶
func (m *UserReportMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*UserReportMutation) AddedField ¶
func (m *UserReportMutation) 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 (*UserReportMutation) AddedFields ¶
func (m *UserReportMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*UserReportMutation) AddedIDs ¶
func (m *UserReportMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*UserReportMutation) ClearEdge ¶
func (m *UserReportMutation) 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 (*UserReportMutation) ClearField ¶
func (m *UserReportMutation) 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 (*UserReportMutation) ClearedEdges ¶
func (m *UserReportMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*UserReportMutation) ClearedFields ¶
func (m *UserReportMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (UserReportMutation) Client ¶
func (m UserReportMutation) 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 (*UserReportMutation) CreatedAt ¶
func (m *UserReportMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*UserReportMutation) EdgeCleared ¶
func (m *UserReportMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*UserReportMutation) Field ¶
func (m *UserReportMutation) 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 (*UserReportMutation) FieldCleared ¶
func (m *UserReportMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*UserReportMutation) Fields ¶
func (m *UserReportMutation) 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 (*UserReportMutation) ID ¶
func (m *UserReportMutation) ID() (id string, 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 (*UserReportMutation) IDs ¶
func (m *UserReportMutation) IDs(ctx context.Context) ([]string, 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 (*UserReportMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the UserReport entity. If the UserReport 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 (*UserReportMutation) 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 (*UserReportMutation) RemovedEdges ¶
func (m *UserReportMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*UserReportMutation) RemovedIDs ¶
func (m *UserReportMutation) 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 (*UserReportMutation) ResetCreatedAt ¶
func (m *UserReportMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*UserReportMutation) ResetEdge ¶
func (m *UserReportMutation) 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 (*UserReportMutation) ResetField ¶
func (m *UserReportMutation) 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 (*UserReportMutation) SetCreatedAt ¶
func (m *UserReportMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*UserReportMutation) SetField ¶
func (m *UserReportMutation) 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 (*UserReportMutation) SetID ¶
func (m *UserReportMutation) SetID(id string)
SetID sets the value of the id field. Note that this operation is only accepted on creation of UserReport entities.
func (*UserReportMutation) SetOp ¶
func (m *UserReportMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (UserReportMutation) Tx ¶
func (m UserReportMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*UserReportMutation) Type ¶
func (m *UserReportMutation) Type() string
Type returns the node type of this mutation (UserReport).
func (*UserReportMutation) Where ¶
func (m *UserReportMutation) Where(ps ...predicate.UserReport)
Where appends a list predicates to the UserReportMutation builder.
func (*UserReportMutation) WhereP ¶
func (m *UserReportMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the UserReportMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type UserReportQuery ¶
type UserReportQuery struct {
// contains filtered or unexported fields
}
UserReportQuery is the builder for querying UserReport entities.
func (*UserReportQuery) Aggregate ¶
func (urq *UserReportQuery) Aggregate(fns ...AggregateFunc) *UserReportSelect
Aggregate returns a UserReportSelect configured with the given aggregations.
func (*UserReportQuery) All ¶
func (urq *UserReportQuery) All(ctx context.Context) ([]*UserReport, error)
All executes the query and returns a list of UserReports.
func (*UserReportQuery) AllX ¶
func (urq *UserReportQuery) AllX(ctx context.Context) []*UserReport
AllX is like All, but panics if an error occurs.
func (*UserReportQuery) Clone ¶
func (urq *UserReportQuery) Clone() *UserReportQuery
Clone returns a duplicate of the UserReportQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*UserReportQuery) Count ¶
func (urq *UserReportQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*UserReportQuery) CountX ¶
func (urq *UserReportQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*UserReportQuery) Exist ¶
func (urq *UserReportQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*UserReportQuery) ExistX ¶
func (urq *UserReportQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*UserReportQuery) First ¶
func (urq *UserReportQuery) First(ctx context.Context) (*UserReport, error)
First returns the first UserReport entity from the query. Returns a *NotFoundError when no UserReport was found.
func (*UserReportQuery) FirstID ¶
func (urq *UserReportQuery) FirstID(ctx context.Context) (id string, err error)
FirstID returns the first UserReport ID from the query. Returns a *NotFoundError when no UserReport ID was found.
func (*UserReportQuery) FirstIDX ¶
func (urq *UserReportQuery) FirstIDX(ctx context.Context) string
FirstIDX is like FirstID, but panics if an error occurs.
func (*UserReportQuery) FirstX ¶
func (urq *UserReportQuery) FirstX(ctx context.Context) *UserReport
FirstX is like First, but panics if an error occurs.
func (*UserReportQuery) GroupBy ¶
func (urq *UserReportQuery) GroupBy(field string, fields ...string) *UserReportGroupBy
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 { CreatedAt time.Time `json:"created_at,omitempty"` Count int `json:"count,omitempty"` } client.UserReport.Query(). GroupBy(userreport.FieldCreatedAt). Aggregate(ent.Count()). Scan(ctx, &v)
func (*UserReportQuery) IDs ¶
func (urq *UserReportQuery) IDs(ctx context.Context) (ids []string, err error)
IDs executes the query and returns a list of UserReport IDs.
func (*UserReportQuery) IDsX ¶
func (urq *UserReportQuery) IDsX(ctx context.Context) []string
IDsX is like IDs, but panics if an error occurs.
func (*UserReportQuery) Limit ¶
func (urq *UserReportQuery) Limit(limit int) *UserReportQuery
Limit the number of records to be returned by this query.
func (*UserReportQuery) Offset ¶
func (urq *UserReportQuery) Offset(offset int) *UserReportQuery
Offset to start from.
func (*UserReportQuery) Only ¶
func (urq *UserReportQuery) Only(ctx context.Context) (*UserReport, error)
Only returns a single UserReport entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one UserReport entity is found. Returns a *NotFoundError when no UserReport entities are found.
func (*UserReportQuery) OnlyID ¶
func (urq *UserReportQuery) OnlyID(ctx context.Context) (id string, err error)
OnlyID is like Only, but returns the only UserReport ID in the query. Returns a *NotSingularError when more than one UserReport ID is found. Returns a *NotFoundError when no entities are found.
func (*UserReportQuery) OnlyIDX ¶
func (urq *UserReportQuery) OnlyIDX(ctx context.Context) string
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*UserReportQuery) OnlyX ¶
func (urq *UserReportQuery) OnlyX(ctx context.Context) *UserReport
OnlyX is like Only, but panics if an error occurs.
func (*UserReportQuery) Order ¶
func (urq *UserReportQuery) Order(o ...userreport.OrderOption) *UserReportQuery
Order specifies how the records should be ordered.
func (*UserReportQuery) Select ¶
func (urq *UserReportQuery) Select(fields ...string) *UserReportSelect
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 { CreatedAt time.Time `json:"created_at,omitempty"` } client.UserReport.Query(). Select(userreport.FieldCreatedAt). Scan(ctx, &v)
func (*UserReportQuery) Unique ¶
func (urq *UserReportQuery) Unique(unique bool) *UserReportQuery
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 (*UserReportQuery) Where ¶
func (urq *UserReportQuery) Where(ps ...predicate.UserReport) *UserReportQuery
Where adds a new predicate for the UserReportQuery builder.
type UserReportSelect ¶
type UserReportSelect struct { *UserReportQuery // contains filtered or unexported fields }
UserReportSelect is the builder for selecting fields of UserReport entities.
func (*UserReportSelect) Aggregate ¶
func (urs *UserReportSelect) Aggregate(fns ...AggregateFunc) *UserReportSelect
Aggregate adds the given aggregation functions to the selector query.
func (*UserReportSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*UserReportSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*UserReportSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*UserReportSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*UserReportSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*UserReportSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*UserReportSelect) Scan ¶
func (urs *UserReportSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*UserReportSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type UserReportUpdate ¶
type UserReportUpdate struct {
// contains filtered or unexported fields
}
UserReportUpdate is the builder for updating UserReport entities.
func (*UserReportUpdate) Exec ¶
func (uru *UserReportUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*UserReportUpdate) ExecX ¶
func (uru *UserReportUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserReportUpdate) Mutation ¶
func (uru *UserReportUpdate) Mutation() *UserReportMutation
Mutation returns the UserReportMutation object of the builder.
func (*UserReportUpdate) Save ¶
func (uru *UserReportUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*UserReportUpdate) SaveX ¶
func (uru *UserReportUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*UserReportUpdate) Where ¶
func (uru *UserReportUpdate) Where(ps ...predicate.UserReport) *UserReportUpdate
Where appends a list predicates to the UserReportUpdate builder.
type UserReportUpdateOne ¶
type UserReportUpdateOne struct {
// contains filtered or unexported fields
}
UserReportUpdateOne is the builder for updating a single UserReport entity.
func (*UserReportUpdateOne) Exec ¶
func (uruo *UserReportUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*UserReportUpdateOne) ExecX ¶
func (uruo *UserReportUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*UserReportUpdateOne) Mutation ¶
func (uruo *UserReportUpdateOne) Mutation() *UserReportMutation
Mutation returns the UserReportMutation object of the builder.
func (*UserReportUpdateOne) Save ¶
func (uruo *UserReportUpdateOne) Save(ctx context.Context) (*UserReport, error)
Save executes the query and returns the updated UserReport entity.
func (*UserReportUpdateOne) SaveX ¶
func (uruo *UserReportUpdateOne) SaveX(ctx context.Context) *UserReport
SaveX is like Save, but panics if an error occurs.
func (*UserReportUpdateOne) Select ¶
func (uruo *UserReportUpdateOne) Select(field string, fields ...string) *UserReportUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*UserReportUpdateOne) Where ¶
func (uruo *UserReportUpdateOne) Where(ps ...predicate.UserReport) *UserReportUpdateOne
Where appends a list predicates to the UserReportUpdate 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.