Documentation
¶
Index ¶
- func Committed(ctx context.Context, f func(ctx context.Context))
- func Exec(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func IsInTx(ctx context.Context) bool
- func Iter(ctx context.Context, iter mysql.Iterator, query string, args ...interface{}) error
- func Middleware(db DB) func(h http.Handler) http.Handler
- func NewContext(ctx context.Context, db DB) context.Context
- func Prepare(ctx context.Context, query string) (*sql.Stmt, error)
- func Query(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func QueryRow(ctx context.Context, query string, args ...interface{}) *sql.Row
- func RunInTx(ctx context.Context, f func(ctx context.Context) error) error
- func RunInTxOptions(ctx context.Context, opt *mysql.TxOptions, f func(ctx context.Context) error) error
- type DB
- type Queryer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
Middleware injects db into request's context
func NewContext ¶
NewContext creates new context
Types ¶
type Queryer ¶
type Queryer interface { QueryRowContext(context.Context, string, ...interface{}) *sql.Row QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error) ExecContext(context.Context, string, ...interface{}) (sql.Result, error) PrepareContext(context.Context, string) (*sql.Stmt, error) }
Queryer interface
Click to show internal directories.
Click to hide internal directories.