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
| 188 | // |
| 189 | // Note that txDriver is not goroutine safe. |
| 190 | type txDriver struct { |
| 191 | // the driver we started the transaction from. |
| 192 | drv dialect.Driver |
| 193 | // tx is the underlying transaction. |
| 194 | tx dialect.Tx |
| 195 | // completion hooks. |
| 196 | mu sync.Mutex |
| 197 | onCommit []CommitHook |
| 198 | onRollback []RollbackHook |
| 199 | } |
| 200 | |
| 201 | // newTx creates a new transactional driver. |
| 202 | func newTx(ctx context.Context, drv dialect.Driver) (*txDriver, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected