Documentation ¶
Index ¶
- Variables
- func MustBeginTx(ctx context.Context, db sqlTxBeginner, opts *sql.TxOptions) *sql.Tx
- func MustOpenContext(ctx context.Context, driverName string, dataSourceName string) *sql.DB
- func OpenContext(ctx context.Context, driverName string, dataSourceName string) (*sql.DB, error)
- func ScanRows(rows sqlRows, structTag string, dst interface{}) error
- type NewDBOption
- type QueryerContext
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func MustBeginTx ¶
func MustOpenContext ¶ added in v0.0.57
func OpenContext ¶ added in v0.0.57
Types ¶
type NewDBOption ¶ added in v0.0.57
type NewDBOption interface {
// contains filtered or unexported methods
}
func WithNewDBOptionStructTag ¶ added in v0.0.57
func WithNewDBOptionStructTag(structTag string) NewDBOption
type QueryerContext ¶ added in v0.0.57
type QueryerContext interface { // QueryContext executes a query that returns rows, typically a SELECT. // // The dst must be a pointer. // The args are for any placeholder parameters in the query. QueryContext(ctx context.Context, dst interface{}, query string, args ...interface{}) error // QueryRowContext executes a query that is expected to return at most one row. // It always returns a non-nil value or an error. // // The dst must be a pointer. // The args are for any placeholder parameters in the query. QueryRowContext(ctx context.Context, dst interface{}, query string, args ...interface{}) error }
func NewDB ¶
func NewDB(db sqlQueryerContext, opts ...NewDBOption) QueryerContext
Click to show internal directories.
Click to hide internal directories.