Documentation
¶
Index ¶
- Variables
- func Create(ctx context.Context, db *sql.DB, query string, args ...interface{}) (newID uint64, err error)
- func EndTx(tx *sql.Tx, err error) error
- func Exec(ctx context.Context, db *sql.DB, query string, args ...interface{}) (err error)
- func GetRow(ctx context.Context, db *sql.DB, query string, args ...interface{}) *sql.Row
- func New(config Config) (*sql.DB, error)
- func Ping(db *sql.DB) bool
- func RowsClose(rows *sql.Rows, err error) error
- func StoreTx(ctx context.Context, tx *sql.Tx) context.Context
- type Config
- type RowScanner
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoHost occurs when host is not provided in configuration ErrNoHost = errors.New("no host for database connection") // SQLTimeout when running queries SQLTimeout = time.Second * 5 )
Functions ¶
func Create ¶ added in v3.16.0
func Create(ctx context.Context, db *sql.DB, query string, args ...interface{}) (newID uint64, err error)
Create execute query with a RETURNING id
Types ¶
type RowScanner ¶ added in v3.16.0
type RowScanner interface {
Scan(...interface{}) error
}
RowScanner describes scan ability of a row
Click to show internal directories.
Click to hide internal directories.