Documentation
¶
Overview ¶
Package entdriver provides ent driver wrappers.
Index ¶
- type StackDriver
- func (d *StackDriver) BeginTx(ctx context.Context, opts *entsql.TxOptions) (dialect.Tx, error)
- func (d *StackDriver) Exec(ctx context.Context, query string, args, v any) error
- func (d *StackDriver) Query(ctx context.Context, query string, args, v any) error
- func (d *StackDriver) Tx(ctx context.Context) (dialect.Tx, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StackDriver ¶
StackDriver is an ent driver that records the stack of the caller on each database error. The stack holds the repository method that ran the query, so Sentry groups a database failure by the query that failed. Do not run ent's schema API (Schema.Create, Diff, WriteTo) through it: that code casts the result rows to *sql.Rows, which stackRows is not.
func NewStackDriver ¶
func NewStackDriver(driver *entsql.Driver) *StackDriver
NewStackDriver wraps driver so database errors record the caller's stack.
func (*StackDriver) BeginTx ¶
BeginTx starts a transaction with options. The generated ent client calls it through an interface check, so the wrapper must keep it.
Click to show internal directories.
Click to hide internal directories.