InTx executes a function in a transaction.
If the function returns an error, the transaction is rolled back.
If the function panics, the transaction is rolled back and the panic is re-raised.
If the function returns nil, the transaction is committed.
type TxWrap struct {
// contains filtered or unexported fields
}
TxWrap is a wrapper around sqlx.Tx that adds a context
and redirects calls to methods like Get, Select to GetContext and SelectContext
with the context it wraps.