2
0

Resplit Begin and BeginEx

This is in preparation for a Begin / Tx interface that will similate
nested transactions with savepoints.

In addition, this passes the TxOptions struct by value and thereby
removes an allocation.
This commit is contained in:
Jack Christensen
2019-08-17 15:53:55 -05:00
parent f3c703a102
commit c3e41872a8
9 changed files with 44 additions and 35 deletions
+2 -2
View File
@@ -463,7 +463,7 @@ func TestTxSendBatch(t *testing.T) {
);`
mustExec(t, conn, sql)
tx, _ := conn.Begin(context.Background(), nil)
tx, _ := conn.Begin(context.Background())
batch := &pgx.Batch{}
batch.Queue("insert into ledger1(description) values($1) returning id",
[]interface{}{"q1"},
@@ -538,7 +538,7 @@ func TestTxSendBatchRollback(t *testing.T) {
);`
mustExec(t, conn, sql)
tx, _ := conn.Begin(context.Background(), nil)
tx, _ := conn.Begin(context.Background())
batch := &pgx.Batch{}
batch.Queue("insert into ledger1(description) values($1) returning id",
[]interface{}{"q1"},