Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Transaction ¶
type Transaction interface { Exec(query string, args ...interface{}) (sql.Result, error) Prepare(query string) (*sql.Stmt, error) Query(query string, args ...interface{}) (*sql.Rows, error) QueryRow(query string, args ...interface{}) *sql.Row }
Transaction is an interface that models the standard transaction in `database/sql`.
To ensure `TxFn` funcs cannot commit or rollback a transaction (which is handled by `WithTransaction`), those methods are not included here.
type TxFn ¶
type TxFn func(Transaction) error
A Txfn is a function that will be called with an initialized `Transaction` object that can be used for executing statements and queries against a database.
Click to show internal directories.
Click to hide internal directories.