Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface {
Begin(ctx context.Context, opts *TxOptions) (Tx, error)
Exec(ctx context.Context, query string, args ...interface{}) (Result, error)
Prepare(ctx context.Context, query string) (Stmt, error)
Query(ctx context.Context, query string, args ...interface{}) (*Rows, error)
QueryRow(ctx context.Context, query string, args ...interface{}) *Row
Close() error
Ping(ctx context.Context) error
}
type Logger ¶ added in v0.1.0
What I would like:
type Logger[L any] interface {
WithField(key string, value interface{}) L
Infoln(args ...interface{})
Infof(format string, args ...interface{})
}
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option sets options such as instumenting the DB with logging.
func WithLogger ¶ added in v0.1.0
WithLogger returns an Option that instruments the DB with logging.
type Tx ¶
type Tx interface {
Exec(ctx context.Context, query string, args ...interface{}) (Result, error)
Prepare(ctx context.Context, query string) (Stmt, error)
Query(ctx context.Context, query string, args ...interface{}) (*Rows, error)
QueryRow(ctx context.Context, query string, args ...interface{}) *Row
Commit() error
Rollback() error
Stmt(ctx context.Context, stmt Stmt) Stmt
}
Click to show internal directories.
Click to hide internal directories.