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
| 164 | // |
| 165 | // Note that txDriver is not goroutine safe. |
| 166 | type txDriver struct { |
| 167 | // the driver we started the transaction from. |
| 168 | drv dialect.Driver |
| 169 | // tx is the underlying transaction. |
| 170 | tx dialect.Tx |
| 171 | // completion hooks. |
| 172 | mu sync.Mutex |
| 173 | onCommit []CommitHook |
| 174 | onRollback []RollbackHook |
| 175 | } |
| 176 | |
| 177 | // newTx creates a new transactional driver. |
| 178 | func newTx(ctx context.Context, drv dialect.Driver) (*txDriver, error) { |
nothing calls this directly
no outgoing calls
no test coverage detected