From 7a1a04e2a18b2d20e90dbda11e28122c478138f4 Mon Sep 17 00:00:00 2001 From: gak Date: Wed, 24 Jul 2024 09:55:19 +1000 Subject: [PATCH] wip: see if we use multiple savepoints --- backend/controller/sql/conn.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/controller/sql/conn.go b/backend/controller/sql/conn.go index 3b69110ec9..b1a72ad861 100644 --- a/backend/controller/sql/conn.go +++ b/backend/controller/sql/conn.go @@ -51,6 +51,9 @@ func (t *Tx) Tx() pgx.Tx { return t.tx } func (t *Tx) Begin(ctx context.Context) (*Tx, error) { savepoint := fmt.Sprintf("savepoint_%d", len(t.savepoints)) t.savepoints = append(t.savepoints, savepoint) + if len(t.savepoints) > 1 { + panic("checking if this is used") + } _, err := t.tx.Exec(ctx, `SAVEPOINT `+savepoint) if err != nil { return nil, err