1package db
2
3import (
4 "context"
5 "database/sql"
6
7 "github.com/jmoiron/sqlx"
8)
9
10// Handler is a database handler.
11type Handler interface {
12 Rebind(string) string
13
14 Select(interface{}, string, ...interface{}) error
15 Get(interface{}, string, ...interface{}) error
16 Queryx(string, ...interface{}) (*sqlx.Rows, error)
17 QueryRowx(string, ...interface{}) *sqlx.Row
18 Exec(string, ...interface{}) (sql.Result, error)
19
20 SelectContext(context.Context, interface{}, string, ...interface{}) error
21 GetContext(context.Context, interface{}, string, ...interface{}) error
22 QueryxContext(context.Context, string, ...interface{}) (*sqlx.Rows, error)
23 QueryRowxContext(context.Context, string, ...interface{}) *sqlx.Row
24 ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
25}