Documentation ¶
Index ¶
- type DB
- func (db *DB) Close() error
- func (db *DB) Conn(ctx context.Context) (*sql.Conn, error)
- func (db *DB) Create(ctx context.Context, stmts []string) error
- func (db *DB) Do(ctx context.Context, f func(tx *Tx) error) error
- func (db *DB) NewTx(ctx context.Context) (*Tx, error)
- func (db *DB) NewUnstartedTx() *Tx
- type Tx
- func (tx *Tx) Commit() error
- func (tx *Tx) CurTime() (time.Time, error)
- func (tx *Tx) Exec(query string, args ...interface{}) (sql.Result, error)
- func (tx *Tx) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (tx *Tx) QueryRow(query string, args ...interface{}) *sql.Row
- func (tx *Tx) Rollback() error
- func (tx *Tx) Start(ctx context.Context) error
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB wraps a sql.DB to add special behaviors based on the db type
func (*DB) NewUnstartedTx ¶
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx wraps a sql.Tx to offer: * apply some statement mutations before executing it * locking around concurrent executions of statements (since the underlying sql driver doesn't support concurrent statements on the same connection/transaction)
Click to show internal directories.
Click to hide internal directories.