gotosocial/vendor/github.com/ncruces/go-sqlite3/driver/savepoint.go

41 lines
690 B
Go
Raw Normal View History

package driver
import (
"database/sql"
"time"
"github.com/ncruces/go-sqlite3"
)
// Savepoint establishes a new transaction savepoint.
//
// https://sqlite.org/lang_savepoint.html
func Savepoint(tx *sql.Tx) sqlite3.Savepoint {
var ctx saveptCtx
tx.ExecContext(&ctx, "")
return ctx.Savepoint
}
2024-08-15 00:30:58 +00:00
// A saveptCtx is never canceled, has no values, and has no deadline.
type saveptCtx struct{ sqlite3.Savepoint }
2024-08-15 00:30:58 +00:00
func (*saveptCtx) Deadline() (deadline time.Time, ok bool) {
// notest
return
}
2024-08-15 00:30:58 +00:00
func (*saveptCtx) Done() <-chan struct{} {
// notest
return nil
}
2024-08-15 00:30:58 +00:00
func (*saveptCtx) Err() error {
// notest
return nil
}
2024-08-15 00:30:58 +00:00
func (*saveptCtx) Value(key any) any {
// notest
return nil
}