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
+5 -5
View File
@@ -16,7 +16,7 @@ func TestTxExec(t *testing.T) {
require.NoError(t, err)
defer pool.Close()
tx, err := pool.Begin(context.Background(), nil)
tx, err := pool.Begin(context.Background())
require.NoError(t, err)
defer tx.Rollback(context.Background())
@@ -30,7 +30,7 @@ func TestTxQuery(t *testing.T) {
require.NoError(t, err)
defer pool.Close()
tx, err := pool.Begin(context.Background(), nil)
tx, err := pool.Begin(context.Background())
require.NoError(t, err)
defer tx.Rollback(context.Background())
@@ -44,7 +44,7 @@ func TestTxQueryRow(t *testing.T) {
require.NoError(t, err)
defer pool.Close()
tx, err := pool.Begin(context.Background(), nil)
tx, err := pool.Begin(context.Background())
require.NoError(t, err)
defer tx.Rollback(context.Background())
@@ -58,7 +58,7 @@ func TestTxSendBatch(t *testing.T) {
require.NoError(t, err)
defer pool.Close()
tx, err := pool.Begin(context.Background(), nil)
tx, err := pool.Begin(context.Background())
require.NoError(t, err)
defer tx.Rollback(context.Background())
@@ -72,7 +72,7 @@ func TestTxCopyFrom(t *testing.T) {
require.NoError(t, err)
defer pool.Close()
tx, err := pool.Begin(context.Background(), nil)
tx, err := pool.Begin(context.Background())
require.NoError(t, err)
defer tx.Rollback(context.Background())