txDriver wraps the given dialect.Tx with a nop dialect.Driver implementation. The idea is to support transactions without adding any extra code to the builders. When a builder calls to driver.Tx(), it gets the same dialect.Tx instance. Commit and Rollback are nop for the internal builders and the us
| 220 | // |
| 221 | // Note that txDriver is not goroutine safe. |
| 222 | type txDriver struct { |
| 223 | // the driver we started the transaction from. |
| 224 | drv dialect.Driver |
| 225 | // tx is the underlying transaction. |
| 226 | tx dialect.Tx |
| 227 | // completion hooks. |
| 228 | mu sync.Mutex |
| 229 | onCommit []CommitHook |
| 230 | onRollback []RollbackHook |
| 231 | } |
| 232 | |
| 233 | // newTx creates a new transactional driver. |
| 234 | func newTx(ctx context.Context, drv dialect.Driver) (*txDriver, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected