jet/qrm/db.go

16 lines
490 B
Go
Raw Normal View History

package qrm
2019-04-07 09:58:12 +02:00
2019-06-20 12:22:19 +02:00
import (
"context"
"database/sql"
)
2019-04-07 09:58:12 +02:00
// DB is common database interface used by query result mapping
// Both *sql.DB and *sql.Tx implements DB interface
2019-06-23 18:55:57 +02:00
type DB interface {
2019-04-07 09:58:12 +02:00
Exec(query string, args ...interface{}) (sql.Result, error)
2019-06-20 12:22:19 +02:00
ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
2019-04-07 09:58:12 +02:00
Query(query string, args ...interface{}) (*sql.Rows, error)
2019-06-20 12:22:19 +02:00
QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
2019-04-07 09:58:12 +02:00
}