summaryrefslogtreecommitdiff
path: root/vendor/github.com/ncruces/go-sqlite3/driver/savepoint.go
blob: 60aa6b99147689a8d3c09559179381dff18a6605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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
}

type saveptCtx struct{ sqlite3.Savepoint }

func (*saveptCtx) Deadline() (deadline time.Time, ok bool) { return }

func (*saveptCtx) Done() <-chan struct{} { return nil }

func (*saveptCtx) Err() error { return nil }

func (*saveptCtx) Value(key any) any { return nil }