Files
2020-01-15 00:22:34 -08:00

26 lines
437 B
Go
Executable File

package sqlmw
import (
"context"
"database/sql/driver"
)
type wrappedTx struct {
intr Interceptor
ctx context.Context
parent driver.Tx
}
// Compile time validation that our types implement the expected interfaces
var (
_ driver.Tx = wrappedTx{}
)
func (t wrappedTx) Commit() (err error) {
return t.intr.TxCommit(t.ctx, t.parent)
}
func (t wrappedTx) Rollback() (err error) {
return t.intr.TxRollback(t.ctx, t.parent)
}