mirror of
https://github.com/ngrok/sqlmw.git
synced 2026-06-16 16:54:29 +00:00
26 lines
437 B
Go
Executable File
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)
|
|
}
|