Documentation
¶
Index ¶
- type Config
- type EnableSqlxTx
- type SQLxTx
- func (sdt *SQLxTx) Commit() error
- func (sdt *SQLxTx) Exec(query string, args ...interface{}) (sql.Result, error)
- func (sdt *SQLxTx) Get(dest interface{}, query string, args ...interface{}) error
- func (sdt *SQLxTx) NamedExec(query string, args interface{}) (sql.Result, error)
- func (sdt *SQLxTx) Rollback() error
- func (sdt *SQLxTx) Select(dest interface{}, query string, args ...interface{}) error
- func (sdt *SQLxTx) TxEnd(txFn func() error, config Config) error
- type SqlxTxInterface
- type SqlxWrapperInterface
- type Transactions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Verbose bool
}
Config used as configuration object for EnableSqlxTx
type EnableSqlxTx ¶
EnableSqlxTx init SqlxTx
func (*EnableSqlxTx) Exec ¶
func (repo *EnableSqlxTx) Exec(txFn func() error) error
Exec receives a callback meant to swap sqlx.DB by sqlx.Tx in runtime it will apply to operation into the callback
type SQLxTx ¶
SQLxTx is wrapper around sqlx.Tx, to change behavior in runtime between sqlx.DB and sqlx.Tx
func (*SQLxTx) Exec ¶
Exec executes a query that doesn't return rows. For example: an INSERT and UPDATE.
func (*SQLxTx) Get ¶
Get within a transaction. Any placeholder parameters are replaced with supplied args. An error is returned if the result set is empty.
func (*SQLxTx) NamedExec ¶
NamedExec within a transaction. Any named placeholder parameters are replaced with fields from arg.
type SqlxTxInterface ¶
SqlxTxInterface exposes a workable interface for SqlxTx
type SqlxWrapperInterface ¶
type SqlxWrapperInterface interface { Select(dest interface{}, query string, args ...interface{}) error Get(dest interface{}, query string, args ...interface{}) error NamedExec(query string, args interface{}) (sql.Result, error) Exec(query string, args ...interface{}) (sql.Result, error) Commit() error Transactions }
SqlxWrapperInterface Wraps sqlx interface