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 ErrorReport
- type ErrorReportClient
- func (c *ErrorReportClient) Create() *ErrorReportCreate
- func (c *ErrorReportClient) CreateBulk(builders ...*ErrorReportCreate) *ErrorReportCreateBulk
- func (c *ErrorReportClient) Delete() *ErrorReportDelete
- func (c *ErrorReportClient) DeleteOne(_m *ErrorReport) *ErrorReportDeleteOne
- func (c *ErrorReportClient) DeleteOneID(id int) *ErrorReportDeleteOne
- func (c *ErrorReportClient) Get(ctx context.Context, id int) (*ErrorReport, error)
- func (c *ErrorReportClient) GetX(ctx context.Context, id int) *ErrorReport
- func (c *ErrorReportClient) Hooks() []Hook
- func (c *ErrorReportClient) Intercept(interceptors ...Interceptor)
- func (c *ErrorReportClient) Interceptors() []Interceptor
- func (c *ErrorReportClient) MapCreateBulk(slice any, setFunc func(*ErrorReportCreate, int)) *ErrorReportCreateBulk
- func (c *ErrorReportClient) Query() *ErrorReportQuery
- func (c *ErrorReportClient) Update() *ErrorReportUpdate
- func (c *ErrorReportClient) UpdateOne(_m *ErrorReport) *ErrorReportUpdateOne
- func (c *ErrorReportClient) UpdateOneID(id int) *ErrorReportUpdateOne
- func (c *ErrorReportClient) Use(hooks ...Hook)
- type ErrorReportCreate
- func (_c *ErrorReportCreate) Exec(ctx context.Context) error
- func (_c *ErrorReportCreate) ExecX(ctx context.Context)
- func (_c *ErrorReportCreate) Mutation() *ErrorReportMutation
- func (_c *ErrorReportCreate) Save(ctx context.Context) (*ErrorReport, error)
- func (_c *ErrorReportCreate) SaveX(ctx context.Context) *ErrorReport
- func (_c *ErrorReportCreate) SetClientIP(v string) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetComment(v string) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetCreatedAt(v time.Time) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetID(v int) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetNillableClientIP(v *string) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetNillableComment(v *string) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetNillableResolvedAt(v *time.Time) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetNillableUserAgent(v *string) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetNillableUserID(v *int) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetPageURL(v string) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetResolvedAt(v time.Time) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetSelectedText(v string) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetUserAgent(v string) *ErrorReportCreate
- func (_c *ErrorReportCreate) SetUserID(v int) *ErrorReportCreate
- type ErrorReportCreateBulk
- type ErrorReportDelete
- type ErrorReportDeleteOne
- type ErrorReportGroupBy
- func (_g *ErrorReportGroupBy) Aggregate(fns ...AggregateFunc) *ErrorReportGroupBy
- func (s *ErrorReportGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *ErrorReportGroupBy) BoolX(ctx context.Context) bool
- func (s *ErrorReportGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *ErrorReportGroupBy) BoolsX(ctx context.Context) []bool
- func (s *ErrorReportGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *ErrorReportGroupBy) Float64X(ctx context.Context) float64
- func (s *ErrorReportGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *ErrorReportGroupBy) Float64sX(ctx context.Context) []float64
- func (s *ErrorReportGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *ErrorReportGroupBy) IntX(ctx context.Context) int
- func (s *ErrorReportGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *ErrorReportGroupBy) IntsX(ctx context.Context) []int
- func (_g *ErrorReportGroupBy) Scan(ctx context.Context, v any) error
- func (s *ErrorReportGroupBy) ScanX(ctx context.Context, v any)
- func (s *ErrorReportGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *ErrorReportGroupBy) StringX(ctx context.Context) string
- func (s *ErrorReportGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *ErrorReportGroupBy) StringsX(ctx context.Context) []string
- type ErrorReportMutation
- func (m *ErrorReportMutation) AddField(name string, value ent.Value) error
- func (m *ErrorReportMutation) AddUserID(i int)
- func (m *ErrorReportMutation) AddedEdges() []string
- func (m *ErrorReportMutation) AddedField(name string) (ent.Value, bool)
- func (m *ErrorReportMutation) AddedFields() []string
- func (m *ErrorReportMutation) AddedIDs(name string) []ent.Value
- func (m *ErrorReportMutation) AddedUserID() (r int, exists bool)
- func (m *ErrorReportMutation) ClearClientIP()
- func (m *ErrorReportMutation) ClearComment()
- func (m *ErrorReportMutation) ClearEdge(name string) error
- func (m *ErrorReportMutation) ClearField(name string) error
- func (m *ErrorReportMutation) ClearResolvedAt()
- func (m *ErrorReportMutation) ClearUserAgent()
- func (m *ErrorReportMutation) ClearUserID()
- func (m *ErrorReportMutation) ClearedEdges() []string
- func (m *ErrorReportMutation) ClearedFields() []string
- func (m ErrorReportMutation) Client() *Client
- func (m *ErrorReportMutation) ClientIP() (r string, exists bool)
- func (m *ErrorReportMutation) ClientIPCleared() bool
- func (m *ErrorReportMutation) Comment() (r string, exists bool)
- func (m *ErrorReportMutation) CommentCleared() bool
- func (m *ErrorReportMutation) CreatedAt() (r time.Time, exists bool)
- func (m *ErrorReportMutation) EdgeCleared(name string) bool
- func (m *ErrorReportMutation) Field(name string) (ent.Value, bool)
- func (m *ErrorReportMutation) FieldCleared(name string) bool
- func (m *ErrorReportMutation) Fields() []string
- func (m *ErrorReportMutation) ID() (id int, exists bool)
- func (m *ErrorReportMutation) IDs(ctx context.Context) ([]int, error)
- func (m *ErrorReportMutation) OldClientIP(ctx context.Context) (v *string, err error)
- func (m *ErrorReportMutation) OldComment(ctx context.Context) (v *string, err error)
- func (m *ErrorReportMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *ErrorReportMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *ErrorReportMutation) OldPageURL(ctx context.Context) (v string, err error)
- func (m *ErrorReportMutation) OldResolvedAt(ctx context.Context) (v *time.Time, err error)
- func (m *ErrorReportMutation) OldSelectedText(ctx context.Context) (v string, err error)
- func (m *ErrorReportMutation) OldUserAgent(ctx context.Context) (v *string, err error)
- func (m *ErrorReportMutation) OldUserID(ctx context.Context) (v *int, err error)
- func (m *ErrorReportMutation) Op() Op
- func (m *ErrorReportMutation) PageURL() (r string, exists bool)
- func (m *ErrorReportMutation) RemovedEdges() []string
- func (m *ErrorReportMutation) RemovedIDs(name string) []ent.Value
- func (m *ErrorReportMutation) ResetClientIP()
- func (m *ErrorReportMutation) ResetComment()
- func (m *ErrorReportMutation) ResetCreatedAt()
- func (m *ErrorReportMutation) ResetEdge(name string) error
- func (m *ErrorReportMutation) ResetField(name string) error
- func (m *ErrorReportMutation) ResetPageURL()
- func (m *ErrorReportMutation) ResetResolvedAt()
- func (m *ErrorReportMutation) ResetSelectedText()
- func (m *ErrorReportMutation) ResetUserAgent()
- func (m *ErrorReportMutation) ResetUserID()
- func (m *ErrorReportMutation) ResolvedAt() (r time.Time, exists bool)
- func (m *ErrorReportMutation) ResolvedAtCleared() bool
- func (m *ErrorReportMutation) SelectedText() (r string, exists bool)
- func (m *ErrorReportMutation) SetClientIP(s string)
- func (m *ErrorReportMutation) SetComment(s string)
- func (m *ErrorReportMutation) SetCreatedAt(t time.Time)
- func (m *ErrorReportMutation) SetField(name string, value ent.Value) error
- func (m *ErrorReportMutation) SetID(id int)
- func (m *ErrorReportMutation) SetOp(op Op)
- func (m *ErrorReportMutation) SetPageURL(s string)
- func (m *ErrorReportMutation) SetResolvedAt(t time.Time)
- func (m *ErrorReportMutation) SetSelectedText(s string)
- func (m *ErrorReportMutation) SetUserAgent(s string)
- func (m *ErrorReportMutation) SetUserID(i int)
- func (m ErrorReportMutation) Tx() (*Tx, error)
- func (m *ErrorReportMutation) Type() string
- func (m *ErrorReportMutation) UserAgent() (r string, exists bool)
- func (m *ErrorReportMutation) UserAgentCleared() bool
- func (m *ErrorReportMutation) UserID() (r int, exists bool)
- func (m *ErrorReportMutation) UserIDCleared() bool
- func (m *ErrorReportMutation) Where(ps ...predicate.ErrorReport)
- func (m *ErrorReportMutation) WhereP(ps ...func(*sql.Selector))
- type ErrorReportQuery
- func (_q *ErrorReportQuery) Aggregate(fns ...AggregateFunc) *ErrorReportSelect
- func (_q *ErrorReportQuery) All(ctx context.Context) ([]*ErrorReport, error)
- func (_q *ErrorReportQuery) AllX(ctx context.Context) []*ErrorReport
- func (_q *ErrorReportQuery) Clone() *ErrorReportQuery
- func (_q *ErrorReportQuery) Count(ctx context.Context) (int, error)
- func (_q *ErrorReportQuery) CountX(ctx context.Context) int
- func (_q *ErrorReportQuery) Exist(ctx context.Context) (bool, error)
- func (_q *ErrorReportQuery) ExistX(ctx context.Context) bool
- func (_q *ErrorReportQuery) First(ctx context.Context) (*ErrorReport, error)
- func (_q *ErrorReportQuery) FirstID(ctx context.Context) (id int, err error)
- func (_q *ErrorReportQuery) FirstIDX(ctx context.Context) int
- func (_q *ErrorReportQuery) FirstX(ctx context.Context) *ErrorReport
- func (_q *ErrorReportQuery) GroupBy(field string, fields ...string) *ErrorReportGroupBy
- func (_q *ErrorReportQuery) IDs(ctx context.Context) (ids []int, err error)
- func (_q *ErrorReportQuery) IDsX(ctx context.Context) []int
- func (_q *ErrorReportQuery) Limit(limit int) *ErrorReportQuery
- func (_q *ErrorReportQuery) Offset(offset int) *ErrorReportQuery
- func (_q *ErrorReportQuery) Only(ctx context.Context) (*ErrorReport, error)
- func (_q *ErrorReportQuery) OnlyID(ctx context.Context) (id int, err error)
- func (_q *ErrorReportQuery) OnlyIDX(ctx context.Context) int
- func (_q *ErrorReportQuery) OnlyX(ctx context.Context) *ErrorReport
- func (_q *ErrorReportQuery) Order(o ...errorreport.OrderOption) *ErrorReportQuery
- func (_q *ErrorReportQuery) Select(fields ...string) *ErrorReportSelect
- func (_q *ErrorReportQuery) Unique(unique bool) *ErrorReportQuery
- func (_q *ErrorReportQuery) Where(ps ...predicate.ErrorReport) *ErrorReportQuery
- type ErrorReportSelect
- func (_s *ErrorReportSelect) Aggregate(fns ...AggregateFunc) *ErrorReportSelect
- func (s *ErrorReportSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *ErrorReportSelect) BoolX(ctx context.Context) bool
- func (s *ErrorReportSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *ErrorReportSelect) BoolsX(ctx context.Context) []bool
- func (s *ErrorReportSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *ErrorReportSelect) Float64X(ctx context.Context) float64
- func (s *ErrorReportSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *ErrorReportSelect) Float64sX(ctx context.Context) []float64
- func (s *ErrorReportSelect) Int(ctx context.Context) (_ int, err error)
- func (s *ErrorReportSelect) IntX(ctx context.Context) int
- func (s *ErrorReportSelect) Ints(ctx context.Context) ([]int, error)
- func (s *ErrorReportSelect) IntsX(ctx context.Context) []int
- func (_s *ErrorReportSelect) Scan(ctx context.Context, v any) error
- func (s *ErrorReportSelect) ScanX(ctx context.Context, v any)
- func (s *ErrorReportSelect) String(ctx context.Context) (_ string, err error)
- func (s *ErrorReportSelect) StringX(ctx context.Context) string
- func (s *ErrorReportSelect) Strings(ctx context.Context) ([]string, error)
- func (s *ErrorReportSelect) StringsX(ctx context.Context) []string
- type ErrorReportUpdate
- func (_u *ErrorReportUpdate) AddUserID(v int) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) ClearClientIP() *ErrorReportUpdate
- func (_u *ErrorReportUpdate) ClearComment() *ErrorReportUpdate
- func (_u *ErrorReportUpdate) ClearResolvedAt() *ErrorReportUpdate
- func (_u *ErrorReportUpdate) ClearUserAgent() *ErrorReportUpdate
- func (_u *ErrorReportUpdate) ClearUserID() *ErrorReportUpdate
- func (_u *ErrorReportUpdate) Exec(ctx context.Context) error
- func (_u *ErrorReportUpdate) ExecX(ctx context.Context)
- func (_u *ErrorReportUpdate) Mutation() *ErrorReportMutation
- func (_u *ErrorReportUpdate) Save(ctx context.Context) (int, error)
- func (_u *ErrorReportUpdate) SaveX(ctx context.Context) int
- func (_u *ErrorReportUpdate) SetClientIP(v string) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetComment(v string) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetCreatedAt(v time.Time) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetNillableClientIP(v *string) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetNillableComment(v *string) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetNillableCreatedAt(v *time.Time) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetNillablePageURL(v *string) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetNillableResolvedAt(v *time.Time) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetNillableSelectedText(v *string) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetNillableUserAgent(v *string) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetNillableUserID(v *int) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetPageURL(v string) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetResolvedAt(v time.Time) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetSelectedText(v string) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetUserAgent(v string) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) SetUserID(v int) *ErrorReportUpdate
- func (_u *ErrorReportUpdate) Where(ps ...predicate.ErrorReport) *ErrorReportUpdate
- type ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) AddUserID(v int) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) ClearClientIP() *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) ClearComment() *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) ClearResolvedAt() *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) ClearUserAgent() *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) ClearUserID() *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) Exec(ctx context.Context) error
- func (_u *ErrorReportUpdateOne) ExecX(ctx context.Context)
- func (_u *ErrorReportUpdateOne) Mutation() *ErrorReportMutation
- func (_u *ErrorReportUpdateOne) Save(ctx context.Context) (*ErrorReport, error)
- func (_u *ErrorReportUpdateOne) SaveX(ctx context.Context) *ErrorReport
- func (_u *ErrorReportUpdateOne) Select(field string, fields ...string) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetClientIP(v string) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetComment(v string) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetCreatedAt(v time.Time) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetNillableClientIP(v *string) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetNillableComment(v *string) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetNillableCreatedAt(v *time.Time) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetNillablePageURL(v *string) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetNillableResolvedAt(v *time.Time) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetNillableSelectedText(v *string) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetNillableUserAgent(v *string) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetNillableUserID(v *int) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetPageURL(v string) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetResolvedAt(v time.Time) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetSelectedText(v string) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetUserAgent(v string) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) SetUserID(v int) *ErrorReportUpdateOne
- func (_u *ErrorReportUpdateOne) Where(ps ...predicate.ErrorReport) *ErrorReportUpdateOne
- type ErrorReports
- type Hook
- type InterceptFunc
- type Interceptor
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Querier
- type QuerierFunc
- type Query
- type QueryContext
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type TraverseFunc
- type Traverser
- type Tx
- type ValidationError
- type Value
Constants ¶
const ( // Operation types. OpCreate = ent.OpCreate OpDelete = ent.OpDelete OpDeleteOne = ent.OpDeleteOne OpUpdate = ent.OpUpdate OpUpdateOne = ent.OpUpdateOne // Node types. TypeErrorReport = "ErrorReport" )
Variables ¶
var ErrTxStarted = errors.New("generated: 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(generated.As(generated.Sum(field1), "sum_field1"), (generated.As(generated.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
// ErrorReport is the client for interacting with the ErrorReport builders.
ErrorReport *ErrorReportClient
// 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(). ErrorReport. 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 ErrorReport ¶
type ErrorReport struct {
// ID of the ent.
ID int `json:"id,omitempty"`
// UserID holds the value of the "user_id" field.
UserID *int `json:"user_id,omitempty"`
// PageURL holds the value of the "page_url" field.
PageURL string `json:"page_url,omitempty"`
// SelectedText holds the value of the "selected_text" field.
SelectedText string `json:"selected_text,omitempty"`
// Comment holds the value of the "comment" field.
Comment *string `json:"comment,omitempty"`
// ClientIP holds the value of the "client_ip" field.
ClientIP *string `json:"client_ip,omitempty"`
// UserAgent holds the value of the "user_agent" field.
UserAgent *string `json:"user_agent,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// ResolvedAt holds the value of the "resolved_at" field.
ResolvedAt *time.Time `json:"resolved_at,omitempty"`
// contains filtered or unexported fields
}
ErrorReport is the model entity for the ErrorReport schema.
func (*ErrorReport) String ¶
func (_m *ErrorReport) String() string
String implements the fmt.Stringer.
func (*ErrorReport) Unwrap ¶
func (_m *ErrorReport) Unwrap() *ErrorReport
Unwrap unwraps the ErrorReport 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 (*ErrorReport) Update ¶
func (_m *ErrorReport) Update() *ErrorReportUpdateOne
Update returns a builder for updating this ErrorReport. Note that you need to call ErrorReport.Unwrap() before calling this method if this ErrorReport was returned from a transaction, and the transaction was committed or rolled back.
type ErrorReportClient ¶
type ErrorReportClient struct {
// contains filtered or unexported fields
}
ErrorReportClient is a client for the ErrorReport schema.
func NewErrorReportClient ¶
func NewErrorReportClient(c config) *ErrorReportClient
NewErrorReportClient returns a client for the ErrorReport from the given config.
func (*ErrorReportClient) Create ¶
func (c *ErrorReportClient) Create() *ErrorReportCreate
Create returns a builder for creating a ErrorReport entity.
func (*ErrorReportClient) CreateBulk ¶
func (c *ErrorReportClient) CreateBulk(builders ...*ErrorReportCreate) *ErrorReportCreateBulk
CreateBulk returns a builder for creating a bulk of ErrorReport entities.
func (*ErrorReportClient) Delete ¶
func (c *ErrorReportClient) Delete() *ErrorReportDelete
Delete returns a delete builder for ErrorReport.
func (*ErrorReportClient) DeleteOne ¶
func (c *ErrorReportClient) DeleteOne(_m *ErrorReport) *ErrorReportDeleteOne
DeleteOne returns a builder for deleting the given entity.
func (*ErrorReportClient) DeleteOneID ¶
func (c *ErrorReportClient) DeleteOneID(id int) *ErrorReportDeleteOne
DeleteOneID returns a builder for deleting the given entity by its id.
func (*ErrorReportClient) Get ¶
func (c *ErrorReportClient) Get(ctx context.Context, id int) (*ErrorReport, error)
Get returns a ErrorReport entity by its id.
func (*ErrorReportClient) GetX ¶
func (c *ErrorReportClient) GetX(ctx context.Context, id int) *ErrorReport
GetX is like Get, but panics if an error occurs.
func (*ErrorReportClient) Hooks ¶
func (c *ErrorReportClient) Hooks() []Hook
Hooks returns the client hooks.
func (*ErrorReportClient) Intercept ¶
func (c *ErrorReportClient) Intercept(interceptors ...Interceptor)
Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `errorreport.Intercept(f(g(h())))`.
func (*ErrorReportClient) Interceptors ¶
func (c *ErrorReportClient) Interceptors() []Interceptor
Interceptors returns the client interceptors.
func (*ErrorReportClient) MapCreateBulk ¶
func (c *ErrorReportClient) MapCreateBulk(slice any, setFunc func(*ErrorReportCreate, int)) *ErrorReportCreateBulk
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 (*ErrorReportClient) Query ¶
func (c *ErrorReportClient) Query() *ErrorReportQuery
Query returns a query builder for ErrorReport.
func (*ErrorReportClient) Update ¶
func (c *ErrorReportClient) Update() *ErrorReportUpdate
Update returns an update builder for ErrorReport.
func (*ErrorReportClient) UpdateOne ¶
func (c *ErrorReportClient) UpdateOne(_m *ErrorReport) *ErrorReportUpdateOne
UpdateOne returns an update builder for the given entity.
func (*ErrorReportClient) UpdateOneID ¶
func (c *ErrorReportClient) UpdateOneID(id int) *ErrorReportUpdateOne
UpdateOneID returns an update builder for the given id.
func (*ErrorReportClient) Use ¶
func (c *ErrorReportClient) Use(hooks ...Hook)
Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `errorreport.Hooks(f(g(h())))`.
type ErrorReportCreate ¶
type ErrorReportCreate struct {
// contains filtered or unexported fields
}
ErrorReportCreate is the builder for creating a ErrorReport entity.
func (*ErrorReportCreate) Exec ¶
func (_c *ErrorReportCreate) Exec(ctx context.Context) error
Exec executes the query.
func (*ErrorReportCreate) ExecX ¶
func (_c *ErrorReportCreate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ErrorReportCreate) Mutation ¶
func (_c *ErrorReportCreate) Mutation() *ErrorReportMutation
Mutation returns the ErrorReportMutation object of the builder.
func (*ErrorReportCreate) Save ¶
func (_c *ErrorReportCreate) Save(ctx context.Context) (*ErrorReport, error)
Save creates the ErrorReport in the database.
func (*ErrorReportCreate) SaveX ¶
func (_c *ErrorReportCreate) SaveX(ctx context.Context) *ErrorReport
SaveX calls Save and panics if Save returns an error.
func (*ErrorReportCreate) SetClientIP ¶
func (_c *ErrorReportCreate) SetClientIP(v string) *ErrorReportCreate
SetClientIP sets the "client_ip" field.
func (*ErrorReportCreate) SetComment ¶
func (_c *ErrorReportCreate) SetComment(v string) *ErrorReportCreate
SetComment sets the "comment" field.
func (*ErrorReportCreate) SetCreatedAt ¶
func (_c *ErrorReportCreate) SetCreatedAt(v time.Time) *ErrorReportCreate
SetCreatedAt sets the "created_at" field.
func (*ErrorReportCreate) SetID ¶
func (_c *ErrorReportCreate) SetID(v int) *ErrorReportCreate
SetID sets the "id" field.
func (*ErrorReportCreate) SetNillableClientIP ¶
func (_c *ErrorReportCreate) SetNillableClientIP(v *string) *ErrorReportCreate
SetNillableClientIP sets the "client_ip" field if the given value is not nil.
func (*ErrorReportCreate) SetNillableComment ¶
func (_c *ErrorReportCreate) SetNillableComment(v *string) *ErrorReportCreate
SetNillableComment sets the "comment" field if the given value is not nil.
func (*ErrorReportCreate) SetNillableResolvedAt ¶
func (_c *ErrorReportCreate) SetNillableResolvedAt(v *time.Time) *ErrorReportCreate
SetNillableResolvedAt sets the "resolved_at" field if the given value is not nil.
func (*ErrorReportCreate) SetNillableUserAgent ¶
func (_c *ErrorReportCreate) SetNillableUserAgent(v *string) *ErrorReportCreate
SetNillableUserAgent sets the "user_agent" field if the given value is not nil.
func (*ErrorReportCreate) SetNillableUserID ¶
func (_c *ErrorReportCreate) SetNillableUserID(v *int) *ErrorReportCreate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*ErrorReportCreate) SetPageURL ¶
func (_c *ErrorReportCreate) SetPageURL(v string) *ErrorReportCreate
SetPageURL sets the "page_url" field.
func (*ErrorReportCreate) SetResolvedAt ¶
func (_c *ErrorReportCreate) SetResolvedAt(v time.Time) *ErrorReportCreate
SetResolvedAt sets the "resolved_at" field.
func (*ErrorReportCreate) SetSelectedText ¶
func (_c *ErrorReportCreate) SetSelectedText(v string) *ErrorReportCreate
SetSelectedText sets the "selected_text" field.
func (*ErrorReportCreate) SetUserAgent ¶
func (_c *ErrorReportCreate) SetUserAgent(v string) *ErrorReportCreate
SetUserAgent sets the "user_agent" field.
func (*ErrorReportCreate) SetUserID ¶
func (_c *ErrorReportCreate) SetUserID(v int) *ErrorReportCreate
SetUserID sets the "user_id" field.
type ErrorReportCreateBulk ¶
type ErrorReportCreateBulk struct {
// contains filtered or unexported fields
}
ErrorReportCreateBulk is the builder for creating many ErrorReport entities in bulk.
func (*ErrorReportCreateBulk) Exec ¶
func (_c *ErrorReportCreateBulk) Exec(ctx context.Context) error
Exec executes the query.
func (*ErrorReportCreateBulk) ExecX ¶
func (_c *ErrorReportCreateBulk) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ErrorReportCreateBulk) Save ¶
func (_c *ErrorReportCreateBulk) Save(ctx context.Context) ([]*ErrorReport, error)
Save creates the ErrorReport entities in the database.
func (*ErrorReportCreateBulk) SaveX ¶
func (_c *ErrorReportCreateBulk) SaveX(ctx context.Context) []*ErrorReport
SaveX is like Save, but panics if an error occurs.
type ErrorReportDelete ¶
type ErrorReportDelete struct {
// contains filtered or unexported fields
}
ErrorReportDelete is the builder for deleting a ErrorReport entity.
func (*ErrorReportDelete) Exec ¶
func (_d *ErrorReportDelete) Exec(ctx context.Context) (int, error)
Exec executes the deletion query and returns how many vertices were deleted.
func (*ErrorReportDelete) ExecX ¶
func (_d *ErrorReportDelete) ExecX(ctx context.Context) int
ExecX is like Exec, but panics if an error occurs.
func (*ErrorReportDelete) Where ¶
func (_d *ErrorReportDelete) Where(ps ...predicate.ErrorReport) *ErrorReportDelete
Where appends a list predicates to the ErrorReportDelete builder.
type ErrorReportDeleteOne ¶
type ErrorReportDeleteOne struct {
// contains filtered or unexported fields
}
ErrorReportDeleteOne is the builder for deleting a single ErrorReport entity.
func (*ErrorReportDeleteOne) Exec ¶
func (_d *ErrorReportDeleteOne) Exec(ctx context.Context) error
Exec executes the deletion query.
func (*ErrorReportDeleteOne) ExecX ¶
func (_d *ErrorReportDeleteOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ErrorReportDeleteOne) Where ¶
func (_d *ErrorReportDeleteOne) Where(ps ...predicate.ErrorReport) *ErrorReportDeleteOne
Where appends a list predicates to the ErrorReportDelete builder.
type ErrorReportGroupBy ¶
type ErrorReportGroupBy struct {
// contains filtered or unexported fields
}
ErrorReportGroupBy is the group-by builder for ErrorReport entities.
func (*ErrorReportGroupBy) Aggregate ¶
func (_g *ErrorReportGroupBy) Aggregate(fns ...AggregateFunc) *ErrorReportGroupBy
Aggregate adds the given aggregation functions to the group-by query.
func (*ErrorReportGroupBy) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ErrorReportGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ErrorReportGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ErrorReportGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ErrorReportGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ErrorReportGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ErrorReportGroupBy) Scan ¶
func (_g *ErrorReportGroupBy) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ErrorReportGroupBy) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ErrorReportMutation ¶
type ErrorReportMutation struct {
// contains filtered or unexported fields
}
ErrorReportMutation represents an operation that mutates the ErrorReport nodes in the graph.
func (*ErrorReportMutation) AddField ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) AddUserID ¶
func (m *ErrorReportMutation) AddUserID(i int)
AddUserID adds i to the "user_id" field.
func (*ErrorReportMutation) AddedEdges ¶
func (m *ErrorReportMutation) AddedEdges() []string
AddedEdges returns all edge names that were set/added in this mutation.
func (*ErrorReportMutation) AddedField ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) AddedFields ¶
func (m *ErrorReportMutation) AddedFields() []string
AddedFields returns all numeric fields that were incremented/decremented during this mutation.
func (*ErrorReportMutation) AddedIDs ¶
func (m *ErrorReportMutation) AddedIDs(name string) []ent.Value
AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.
func (*ErrorReportMutation) AddedUserID ¶
func (m *ErrorReportMutation) AddedUserID() (r int, exists bool)
AddedUserID returns the value that was added to the "user_id" field in this mutation.
func (*ErrorReportMutation) ClearClientIP ¶
func (m *ErrorReportMutation) ClearClientIP()
ClearClientIP clears the value of the "client_ip" field.
func (*ErrorReportMutation) ClearComment ¶
func (m *ErrorReportMutation) ClearComment()
ClearComment clears the value of the "comment" field.
func (*ErrorReportMutation) ClearEdge ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) ClearField ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) ClearResolvedAt ¶
func (m *ErrorReportMutation) ClearResolvedAt()
ClearResolvedAt clears the value of the "resolved_at" field.
func (*ErrorReportMutation) ClearUserAgent ¶
func (m *ErrorReportMutation) ClearUserAgent()
ClearUserAgent clears the value of the "user_agent" field.
func (*ErrorReportMutation) ClearUserID ¶
func (m *ErrorReportMutation) ClearUserID()
ClearUserID clears the value of the "user_id" field.
func (*ErrorReportMutation) ClearedEdges ¶
func (m *ErrorReportMutation) ClearedEdges() []string
ClearedEdges returns all edge names that were cleared in this mutation.
func (*ErrorReportMutation) ClearedFields ¶
func (m *ErrorReportMutation) ClearedFields() []string
ClearedFields returns all nullable fields that were cleared during this mutation.
func (ErrorReportMutation) Client ¶
func (m ErrorReportMutation) 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 (*ErrorReportMutation) ClientIP ¶
func (m *ErrorReportMutation) ClientIP() (r string, exists bool)
ClientIP returns the value of the "client_ip" field in the mutation.
func (*ErrorReportMutation) ClientIPCleared ¶
func (m *ErrorReportMutation) ClientIPCleared() bool
ClientIPCleared returns if the "client_ip" field was cleared in this mutation.
func (*ErrorReportMutation) Comment ¶
func (m *ErrorReportMutation) Comment() (r string, exists bool)
Comment returns the value of the "comment" field in the mutation.
func (*ErrorReportMutation) CommentCleared ¶
func (m *ErrorReportMutation) CommentCleared() bool
CommentCleared returns if the "comment" field was cleared in this mutation.
func (*ErrorReportMutation) CreatedAt ¶
func (m *ErrorReportMutation) CreatedAt() (r time.Time, exists bool)
CreatedAt returns the value of the "created_at" field in the mutation.
func (*ErrorReportMutation) EdgeCleared ¶
func (m *ErrorReportMutation) EdgeCleared(name string) bool
EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.
func (*ErrorReportMutation) Field ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) FieldCleared ¶
func (m *ErrorReportMutation) FieldCleared(name string) bool
FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.
func (*ErrorReportMutation) Fields ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) ID ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) IDs ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) OldClientIP ¶
func (m *ErrorReportMutation) OldClientIP(ctx context.Context) (v *string, err error)
OldClientIP returns the old "client_ip" field's value of the ErrorReport entity. If the ErrorReport 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 (*ErrorReportMutation) OldComment ¶
func (m *ErrorReportMutation) OldComment(ctx context.Context) (v *string, err error)
OldComment returns the old "comment" field's value of the ErrorReport entity. If the ErrorReport 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 (*ErrorReportMutation) OldCreatedAt ¶
OldCreatedAt returns the old "created_at" field's value of the ErrorReport entity. If the ErrorReport 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 (*ErrorReportMutation) 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 (*ErrorReportMutation) OldPageURL ¶
func (m *ErrorReportMutation) OldPageURL(ctx context.Context) (v string, err error)
OldPageURL returns the old "page_url" field's value of the ErrorReport entity. If the ErrorReport 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 (*ErrorReportMutation) OldResolvedAt ¶
OldResolvedAt returns the old "resolved_at" field's value of the ErrorReport entity. If the ErrorReport 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 (*ErrorReportMutation) OldSelectedText ¶
func (m *ErrorReportMutation) OldSelectedText(ctx context.Context) (v string, err error)
OldSelectedText returns the old "selected_text" field's value of the ErrorReport entity. If the ErrorReport 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 (*ErrorReportMutation) OldUserAgent ¶
func (m *ErrorReportMutation) OldUserAgent(ctx context.Context) (v *string, err error)
OldUserAgent returns the old "user_agent" field's value of the ErrorReport entity. If the ErrorReport 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 (*ErrorReportMutation) OldUserID ¶
func (m *ErrorReportMutation) OldUserID(ctx context.Context) (v *int, err error)
OldUserID returns the old "user_id" field's value of the ErrorReport entity. If the ErrorReport 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 (*ErrorReportMutation) Op ¶
func (m *ErrorReportMutation) Op() Op
Op returns the operation name.
func (*ErrorReportMutation) PageURL ¶
func (m *ErrorReportMutation) PageURL() (r string, exists bool)
PageURL returns the value of the "page_url" field in the mutation.
func (*ErrorReportMutation) RemovedEdges ¶
func (m *ErrorReportMutation) RemovedEdges() []string
RemovedEdges returns all edge names that were removed in this mutation.
func (*ErrorReportMutation) RemovedIDs ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) ResetClientIP ¶
func (m *ErrorReportMutation) ResetClientIP()
ResetClientIP resets all changes to the "client_ip" field.
func (*ErrorReportMutation) ResetComment ¶
func (m *ErrorReportMutation) ResetComment()
ResetComment resets all changes to the "comment" field.
func (*ErrorReportMutation) ResetCreatedAt ¶
func (m *ErrorReportMutation) ResetCreatedAt()
ResetCreatedAt resets all changes to the "created_at" field.
func (*ErrorReportMutation) ResetEdge ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) ResetField ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) ResetPageURL ¶
func (m *ErrorReportMutation) ResetPageURL()
ResetPageURL resets all changes to the "page_url" field.
func (*ErrorReportMutation) ResetResolvedAt ¶
func (m *ErrorReportMutation) ResetResolvedAt()
ResetResolvedAt resets all changes to the "resolved_at" field.
func (*ErrorReportMutation) ResetSelectedText ¶
func (m *ErrorReportMutation) ResetSelectedText()
ResetSelectedText resets all changes to the "selected_text" field.
func (*ErrorReportMutation) ResetUserAgent ¶
func (m *ErrorReportMutation) ResetUserAgent()
ResetUserAgent resets all changes to the "user_agent" field.
func (*ErrorReportMutation) ResetUserID ¶
func (m *ErrorReportMutation) ResetUserID()
ResetUserID resets all changes to the "user_id" field.
func (*ErrorReportMutation) ResolvedAt ¶
func (m *ErrorReportMutation) ResolvedAt() (r time.Time, exists bool)
ResolvedAt returns the value of the "resolved_at" field in the mutation.
func (*ErrorReportMutation) ResolvedAtCleared ¶
func (m *ErrorReportMutation) ResolvedAtCleared() bool
ResolvedAtCleared returns if the "resolved_at" field was cleared in this mutation.
func (*ErrorReportMutation) SelectedText ¶
func (m *ErrorReportMutation) SelectedText() (r string, exists bool)
SelectedText returns the value of the "selected_text" field in the mutation.
func (*ErrorReportMutation) SetClientIP ¶
func (m *ErrorReportMutation) SetClientIP(s string)
SetClientIP sets the "client_ip" field.
func (*ErrorReportMutation) SetComment ¶
func (m *ErrorReportMutation) SetComment(s string)
SetComment sets the "comment" field.
func (*ErrorReportMutation) SetCreatedAt ¶
func (m *ErrorReportMutation) SetCreatedAt(t time.Time)
SetCreatedAt sets the "created_at" field.
func (*ErrorReportMutation) SetField ¶
func (m *ErrorReportMutation) 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 (*ErrorReportMutation) SetID ¶
func (m *ErrorReportMutation) SetID(id int)
SetID sets the value of the id field. Note that this operation is only accepted on creation of ErrorReport entities.
func (*ErrorReportMutation) SetOp ¶
func (m *ErrorReportMutation) SetOp(op Op)
SetOp allows setting the mutation operation.
func (*ErrorReportMutation) SetPageURL ¶
func (m *ErrorReportMutation) SetPageURL(s string)
SetPageURL sets the "page_url" field.
func (*ErrorReportMutation) SetResolvedAt ¶
func (m *ErrorReportMutation) SetResolvedAt(t time.Time)
SetResolvedAt sets the "resolved_at" field.
func (*ErrorReportMutation) SetSelectedText ¶
func (m *ErrorReportMutation) SetSelectedText(s string)
SetSelectedText sets the "selected_text" field.
func (*ErrorReportMutation) SetUserAgent ¶
func (m *ErrorReportMutation) SetUserAgent(s string)
SetUserAgent sets the "user_agent" field.
func (*ErrorReportMutation) SetUserID ¶
func (m *ErrorReportMutation) SetUserID(i int)
SetUserID sets the "user_id" field.
func (ErrorReportMutation) Tx ¶
func (m ErrorReportMutation) Tx() (*Tx, error)
Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.
func (*ErrorReportMutation) Type ¶
func (m *ErrorReportMutation) Type() string
Type returns the node type of this mutation (ErrorReport).
func (*ErrorReportMutation) UserAgent ¶
func (m *ErrorReportMutation) UserAgent() (r string, exists bool)
UserAgent returns the value of the "user_agent" field in the mutation.
func (*ErrorReportMutation) UserAgentCleared ¶
func (m *ErrorReportMutation) UserAgentCleared() bool
UserAgentCleared returns if the "user_agent" field was cleared in this mutation.
func (*ErrorReportMutation) UserID ¶
func (m *ErrorReportMutation) UserID() (r int, exists bool)
UserID returns the value of the "user_id" field in the mutation.
func (*ErrorReportMutation) UserIDCleared ¶
func (m *ErrorReportMutation) UserIDCleared() bool
UserIDCleared returns if the "user_id" field was cleared in this mutation.
func (*ErrorReportMutation) Where ¶
func (m *ErrorReportMutation) Where(ps ...predicate.ErrorReport)
Where appends a list predicates to the ErrorReportMutation builder.
func (*ErrorReportMutation) WhereP ¶
func (m *ErrorReportMutation) WhereP(ps ...func(*sql.Selector))
WhereP appends storage-level predicates to the ErrorReportMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.
type ErrorReportQuery ¶
type ErrorReportQuery struct {
// contains filtered or unexported fields
}
ErrorReportQuery is the builder for querying ErrorReport entities.
func (*ErrorReportQuery) Aggregate ¶
func (_q *ErrorReportQuery) Aggregate(fns ...AggregateFunc) *ErrorReportSelect
Aggregate returns a ErrorReportSelect configured with the given aggregations.
func (*ErrorReportQuery) All ¶
func (_q *ErrorReportQuery) All(ctx context.Context) ([]*ErrorReport, error)
All executes the query and returns a list of ErrorReports.
func (*ErrorReportQuery) AllX ¶
func (_q *ErrorReportQuery) AllX(ctx context.Context) []*ErrorReport
AllX is like All, but panics if an error occurs.
func (*ErrorReportQuery) Clone ¶
func (_q *ErrorReportQuery) Clone() *ErrorReportQuery
Clone returns a duplicate of the ErrorReportQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.
func (*ErrorReportQuery) Count ¶
func (_q *ErrorReportQuery) Count(ctx context.Context) (int, error)
Count returns the count of the given query.
func (*ErrorReportQuery) CountX ¶
func (_q *ErrorReportQuery) CountX(ctx context.Context) int
CountX is like Count, but panics if an error occurs.
func (*ErrorReportQuery) Exist ¶
func (_q *ErrorReportQuery) Exist(ctx context.Context) (bool, error)
Exist returns true if the query has elements in the graph.
func (*ErrorReportQuery) ExistX ¶
func (_q *ErrorReportQuery) ExistX(ctx context.Context) bool
ExistX is like Exist, but panics if an error occurs.
func (*ErrorReportQuery) First ¶
func (_q *ErrorReportQuery) First(ctx context.Context) (*ErrorReport, error)
First returns the first ErrorReport entity from the query. Returns a *NotFoundError when no ErrorReport was found.
func (*ErrorReportQuery) FirstID ¶
func (_q *ErrorReportQuery) FirstID(ctx context.Context) (id int, err error)
FirstID returns the first ErrorReport ID from the query. Returns a *NotFoundError when no ErrorReport ID was found.
func (*ErrorReportQuery) FirstIDX ¶
func (_q *ErrorReportQuery) FirstIDX(ctx context.Context) int
FirstIDX is like FirstID, but panics if an error occurs.
func (*ErrorReportQuery) FirstX ¶
func (_q *ErrorReportQuery) FirstX(ctx context.Context) *ErrorReport
FirstX is like First, but panics if an error occurs.
func (*ErrorReportQuery) GroupBy ¶
func (_q *ErrorReportQuery) GroupBy(field string, fields ...string) *ErrorReportGroupBy
GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.
Example:
var v []struct {
UserID int `json:"user_id,omitempty"`
Count int `json:"count,omitempty"`
}
client.ErrorReport.Query().
GroupBy(errorreport.FieldUserID).
Aggregate(generated.Count()).
Scan(ctx, &v)
func (*ErrorReportQuery) IDs ¶
func (_q *ErrorReportQuery) IDs(ctx context.Context) (ids []int, err error)
IDs executes the query and returns a list of ErrorReport IDs.
func (*ErrorReportQuery) IDsX ¶
func (_q *ErrorReportQuery) IDsX(ctx context.Context) []int
IDsX is like IDs, but panics if an error occurs.
func (*ErrorReportQuery) Limit ¶
func (_q *ErrorReportQuery) Limit(limit int) *ErrorReportQuery
Limit the number of records to be returned by this query.
func (*ErrorReportQuery) Offset ¶
func (_q *ErrorReportQuery) Offset(offset int) *ErrorReportQuery
Offset to start from.
func (*ErrorReportQuery) Only ¶
func (_q *ErrorReportQuery) Only(ctx context.Context) (*ErrorReport, error)
Only returns a single ErrorReport entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one ErrorReport entity is found. Returns a *NotFoundError when no ErrorReport entities are found.
func (*ErrorReportQuery) OnlyID ¶
func (_q *ErrorReportQuery) OnlyID(ctx context.Context) (id int, err error)
OnlyID is like Only, but returns the only ErrorReport ID in the query. Returns a *NotSingularError when more than one ErrorReport ID is found. Returns a *NotFoundError when no entities are found.
func (*ErrorReportQuery) OnlyIDX ¶
func (_q *ErrorReportQuery) OnlyIDX(ctx context.Context) int
OnlyIDX is like OnlyID, but panics if an error occurs.
func (*ErrorReportQuery) OnlyX ¶
func (_q *ErrorReportQuery) OnlyX(ctx context.Context) *ErrorReport
OnlyX is like Only, but panics if an error occurs.
func (*ErrorReportQuery) Order ¶
func (_q *ErrorReportQuery) Order(o ...errorreport.OrderOption) *ErrorReportQuery
Order specifies how the records should be ordered.
func (*ErrorReportQuery) Select ¶
func (_q *ErrorReportQuery) Select(fields ...string) *ErrorReportSelect
Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.
Example:
var v []struct {
UserID int `json:"user_id,omitempty"`
}
client.ErrorReport.Query().
Select(errorreport.FieldUserID).
Scan(ctx, &v)
func (*ErrorReportQuery) Unique ¶
func (_q *ErrorReportQuery) Unique(unique bool) *ErrorReportQuery
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 (*ErrorReportQuery) Where ¶
func (_q *ErrorReportQuery) Where(ps ...predicate.ErrorReport) *ErrorReportQuery
Where adds a new predicate for the ErrorReportQuery builder.
type ErrorReportSelect ¶
type ErrorReportSelect struct {
*ErrorReportQuery
// contains filtered or unexported fields
}
ErrorReportSelect is the builder for selecting fields of ErrorReport entities.
func (*ErrorReportSelect) Aggregate ¶
func (_s *ErrorReportSelect) Aggregate(fns ...AggregateFunc) *ErrorReportSelect
Aggregate adds the given aggregation functions to the selector query.
func (*ErrorReportSelect) Bool ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*ErrorReportSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*ErrorReportSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*ErrorReportSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*ErrorReportSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*ErrorReportSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
func (*ErrorReportSelect) Scan ¶
func (_s *ErrorReportSelect) Scan(ctx context.Context, v any) error
Scan applies the selector query and scans the result into the given value.
func (*ErrorReportSelect) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
type ErrorReportUpdate ¶
type ErrorReportUpdate struct {
// contains filtered or unexported fields
}
ErrorReportUpdate is the builder for updating ErrorReport entities.
func (*ErrorReportUpdate) AddUserID ¶
func (_u *ErrorReportUpdate) AddUserID(v int) *ErrorReportUpdate
AddUserID adds value to the "user_id" field.
func (*ErrorReportUpdate) ClearClientIP ¶
func (_u *ErrorReportUpdate) ClearClientIP() *ErrorReportUpdate
ClearClientIP clears the value of the "client_ip" field.
func (*ErrorReportUpdate) ClearComment ¶
func (_u *ErrorReportUpdate) ClearComment() *ErrorReportUpdate
ClearComment clears the value of the "comment" field.
func (*ErrorReportUpdate) ClearResolvedAt ¶
func (_u *ErrorReportUpdate) ClearResolvedAt() *ErrorReportUpdate
ClearResolvedAt clears the value of the "resolved_at" field.
func (*ErrorReportUpdate) ClearUserAgent ¶
func (_u *ErrorReportUpdate) ClearUserAgent() *ErrorReportUpdate
ClearUserAgent clears the value of the "user_agent" field.
func (*ErrorReportUpdate) ClearUserID ¶
func (_u *ErrorReportUpdate) ClearUserID() *ErrorReportUpdate
ClearUserID clears the value of the "user_id" field.
func (*ErrorReportUpdate) Exec ¶
func (_u *ErrorReportUpdate) Exec(ctx context.Context) error
Exec executes the query.
func (*ErrorReportUpdate) ExecX ¶
func (_u *ErrorReportUpdate) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ErrorReportUpdate) Mutation ¶
func (_u *ErrorReportUpdate) Mutation() *ErrorReportMutation
Mutation returns the ErrorReportMutation object of the builder.
func (*ErrorReportUpdate) Save ¶
func (_u *ErrorReportUpdate) Save(ctx context.Context) (int, error)
Save executes the query and returns the number of nodes affected by the update operation.
func (*ErrorReportUpdate) SaveX ¶
func (_u *ErrorReportUpdate) SaveX(ctx context.Context) int
SaveX is like Save, but panics if an error occurs.
func (*ErrorReportUpdate) SetClientIP ¶
func (_u *ErrorReportUpdate) SetClientIP(v string) *ErrorReportUpdate
SetClientIP sets the "client_ip" field.
func (*ErrorReportUpdate) SetComment ¶
func (_u *ErrorReportUpdate) SetComment(v string) *ErrorReportUpdate
SetComment sets the "comment" field.
func (*ErrorReportUpdate) SetCreatedAt ¶
func (_u *ErrorReportUpdate) SetCreatedAt(v time.Time) *ErrorReportUpdate
SetCreatedAt sets the "created_at" field.
func (*ErrorReportUpdate) SetNillableClientIP ¶
func (_u *ErrorReportUpdate) SetNillableClientIP(v *string) *ErrorReportUpdate
SetNillableClientIP sets the "client_ip" field if the given value is not nil.
func (*ErrorReportUpdate) SetNillableComment ¶
func (_u *ErrorReportUpdate) SetNillableComment(v *string) *ErrorReportUpdate
SetNillableComment sets the "comment" field if the given value is not nil.
func (*ErrorReportUpdate) SetNillableCreatedAt ¶
func (_u *ErrorReportUpdate) SetNillableCreatedAt(v *time.Time) *ErrorReportUpdate
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ErrorReportUpdate) SetNillablePageURL ¶
func (_u *ErrorReportUpdate) SetNillablePageURL(v *string) *ErrorReportUpdate
SetNillablePageURL sets the "page_url" field if the given value is not nil.
func (*ErrorReportUpdate) SetNillableResolvedAt ¶
func (_u *ErrorReportUpdate) SetNillableResolvedAt(v *time.Time) *ErrorReportUpdate
SetNillableResolvedAt sets the "resolved_at" field if the given value is not nil.
func (*ErrorReportUpdate) SetNillableSelectedText ¶
func (_u *ErrorReportUpdate) SetNillableSelectedText(v *string) *ErrorReportUpdate
SetNillableSelectedText sets the "selected_text" field if the given value is not nil.
func (*ErrorReportUpdate) SetNillableUserAgent ¶
func (_u *ErrorReportUpdate) SetNillableUserAgent(v *string) *ErrorReportUpdate
SetNillableUserAgent sets the "user_agent" field if the given value is not nil.
func (*ErrorReportUpdate) SetNillableUserID ¶
func (_u *ErrorReportUpdate) SetNillableUserID(v *int) *ErrorReportUpdate
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*ErrorReportUpdate) SetPageURL ¶
func (_u *ErrorReportUpdate) SetPageURL(v string) *ErrorReportUpdate
SetPageURL sets the "page_url" field.
func (*ErrorReportUpdate) SetResolvedAt ¶
func (_u *ErrorReportUpdate) SetResolvedAt(v time.Time) *ErrorReportUpdate
SetResolvedAt sets the "resolved_at" field.
func (*ErrorReportUpdate) SetSelectedText ¶
func (_u *ErrorReportUpdate) SetSelectedText(v string) *ErrorReportUpdate
SetSelectedText sets the "selected_text" field.
func (*ErrorReportUpdate) SetUserAgent ¶
func (_u *ErrorReportUpdate) SetUserAgent(v string) *ErrorReportUpdate
SetUserAgent sets the "user_agent" field.
func (*ErrorReportUpdate) SetUserID ¶
func (_u *ErrorReportUpdate) SetUserID(v int) *ErrorReportUpdate
SetUserID sets the "user_id" field.
func (*ErrorReportUpdate) Where ¶
func (_u *ErrorReportUpdate) Where(ps ...predicate.ErrorReport) *ErrorReportUpdate
Where appends a list predicates to the ErrorReportUpdate builder.
type ErrorReportUpdateOne ¶
type ErrorReportUpdateOne struct {
// contains filtered or unexported fields
}
ErrorReportUpdateOne is the builder for updating a single ErrorReport entity.
func (*ErrorReportUpdateOne) AddUserID ¶
func (_u *ErrorReportUpdateOne) AddUserID(v int) *ErrorReportUpdateOne
AddUserID adds value to the "user_id" field.
func (*ErrorReportUpdateOne) ClearClientIP ¶
func (_u *ErrorReportUpdateOne) ClearClientIP() *ErrorReportUpdateOne
ClearClientIP clears the value of the "client_ip" field.
func (*ErrorReportUpdateOne) ClearComment ¶
func (_u *ErrorReportUpdateOne) ClearComment() *ErrorReportUpdateOne
ClearComment clears the value of the "comment" field.
func (*ErrorReportUpdateOne) ClearResolvedAt ¶
func (_u *ErrorReportUpdateOne) ClearResolvedAt() *ErrorReportUpdateOne
ClearResolvedAt clears the value of the "resolved_at" field.
func (*ErrorReportUpdateOne) ClearUserAgent ¶
func (_u *ErrorReportUpdateOne) ClearUserAgent() *ErrorReportUpdateOne
ClearUserAgent clears the value of the "user_agent" field.
func (*ErrorReportUpdateOne) ClearUserID ¶
func (_u *ErrorReportUpdateOne) ClearUserID() *ErrorReportUpdateOne
ClearUserID clears the value of the "user_id" field.
func (*ErrorReportUpdateOne) Exec ¶
func (_u *ErrorReportUpdateOne) Exec(ctx context.Context) error
Exec executes the query on the entity.
func (*ErrorReportUpdateOne) ExecX ¶
func (_u *ErrorReportUpdateOne) ExecX(ctx context.Context)
ExecX is like Exec, but panics if an error occurs.
func (*ErrorReportUpdateOne) Mutation ¶
func (_u *ErrorReportUpdateOne) Mutation() *ErrorReportMutation
Mutation returns the ErrorReportMutation object of the builder.
func (*ErrorReportUpdateOne) Save ¶
func (_u *ErrorReportUpdateOne) Save(ctx context.Context) (*ErrorReport, error)
Save executes the query and returns the updated ErrorReport entity.
func (*ErrorReportUpdateOne) SaveX ¶
func (_u *ErrorReportUpdateOne) SaveX(ctx context.Context) *ErrorReport
SaveX is like Save, but panics if an error occurs.
func (*ErrorReportUpdateOne) Select ¶
func (_u *ErrorReportUpdateOne) Select(field string, fields ...string) *ErrorReportUpdateOne
Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.
func (*ErrorReportUpdateOne) SetClientIP ¶
func (_u *ErrorReportUpdateOne) SetClientIP(v string) *ErrorReportUpdateOne
SetClientIP sets the "client_ip" field.
func (*ErrorReportUpdateOne) SetComment ¶
func (_u *ErrorReportUpdateOne) SetComment(v string) *ErrorReportUpdateOne
SetComment sets the "comment" field.
func (*ErrorReportUpdateOne) SetCreatedAt ¶
func (_u *ErrorReportUpdateOne) SetCreatedAt(v time.Time) *ErrorReportUpdateOne
SetCreatedAt sets the "created_at" field.
func (*ErrorReportUpdateOne) SetNillableClientIP ¶
func (_u *ErrorReportUpdateOne) SetNillableClientIP(v *string) *ErrorReportUpdateOne
SetNillableClientIP sets the "client_ip" field if the given value is not nil.
func (*ErrorReportUpdateOne) SetNillableComment ¶
func (_u *ErrorReportUpdateOne) SetNillableComment(v *string) *ErrorReportUpdateOne
SetNillableComment sets the "comment" field if the given value is not nil.
func (*ErrorReportUpdateOne) SetNillableCreatedAt ¶
func (_u *ErrorReportUpdateOne) SetNillableCreatedAt(v *time.Time) *ErrorReportUpdateOne
SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
func (*ErrorReportUpdateOne) SetNillablePageURL ¶
func (_u *ErrorReportUpdateOne) SetNillablePageURL(v *string) *ErrorReportUpdateOne
SetNillablePageURL sets the "page_url" field if the given value is not nil.
func (*ErrorReportUpdateOne) SetNillableResolvedAt ¶
func (_u *ErrorReportUpdateOne) SetNillableResolvedAt(v *time.Time) *ErrorReportUpdateOne
SetNillableResolvedAt sets the "resolved_at" field if the given value is not nil.
func (*ErrorReportUpdateOne) SetNillableSelectedText ¶
func (_u *ErrorReportUpdateOne) SetNillableSelectedText(v *string) *ErrorReportUpdateOne
SetNillableSelectedText sets the "selected_text" field if the given value is not nil.
func (*ErrorReportUpdateOne) SetNillableUserAgent ¶
func (_u *ErrorReportUpdateOne) SetNillableUserAgent(v *string) *ErrorReportUpdateOne
SetNillableUserAgent sets the "user_agent" field if the given value is not nil.
func (*ErrorReportUpdateOne) SetNillableUserID ¶
func (_u *ErrorReportUpdateOne) SetNillableUserID(v *int) *ErrorReportUpdateOne
SetNillableUserID sets the "user_id" field if the given value is not nil.
func (*ErrorReportUpdateOne) SetPageURL ¶
func (_u *ErrorReportUpdateOne) SetPageURL(v string) *ErrorReportUpdateOne
SetPageURL sets the "page_url" field.
func (*ErrorReportUpdateOne) SetResolvedAt ¶
func (_u *ErrorReportUpdateOne) SetResolvedAt(v time.Time) *ErrorReportUpdateOne
SetResolvedAt sets the "resolved_at" field.
func (*ErrorReportUpdateOne) SetSelectedText ¶
func (_u *ErrorReportUpdateOne) SetSelectedText(v string) *ErrorReportUpdateOne
SetSelectedText sets the "selected_text" field.
func (*ErrorReportUpdateOne) SetUserAgent ¶
func (_u *ErrorReportUpdateOne) SetUserAgent(v string) *ErrorReportUpdateOne
SetUserAgent sets the "user_agent" field.
func (*ErrorReportUpdateOne) SetUserID ¶
func (_u *ErrorReportUpdateOne) SetUserID(v int) *ErrorReportUpdateOne
SetUserID sets the "user_id" field.
func (*ErrorReportUpdateOne) Where ¶
func (_u *ErrorReportUpdateOne) Where(ps ...predicate.ErrorReport) *ErrorReportUpdateOne
Where appends a list predicates to the ErrorReportUpdate builder.
type ErrorReports ¶
type ErrorReports []*ErrorReport
ErrorReports is a parsable slice of ErrorReport.
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.
func (*NotFoundError) Is ¶
func (e *NotFoundError) Is(target error) bool
Is makes errors.Is(err, schemakit.ErrEntityNotFound) true for ent's not-found errors, so the engine recognizes the module's missing record as it does the core's (its handlers answer 404).
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 {
// ErrorReport is the client for interacting with the ErrorReport builders.
ErrorReport *ErrorReportClient
// contains filtered or unexported fields
}
Tx is a transactional client that is created by calling Client.Tx().
func TxFromContext ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
type ValidationError ¶
type ValidationError struct {
Name string // Field or edge name.
// contains filtered or unexported fields
}
ValidationError returns when validating a field or edge fails.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Error implements the error interface.
func (*ValidationError) Unwrap ¶
func (e *ValidationError) Unwrap() error
Unwrap implements the errors.Wrapper interface.