2
0

Remove Ex versions of Query and QueryRow

Always require context and prepend options to arguments if necessary.
This commit is contained in:
Jack Christensen
2019-04-10 12:12:22 -05:00
parent b69179cebb
commit 7718ee6207
26 changed files with 217 additions and 353 deletions
+4 -4
View File
@@ -42,7 +42,7 @@ func TestTransactionSuccessfulCommit(t *testing.T) {
}
var n int64
err = conn.QueryRow("select count(*) from foo").Scan(&n)
err = conn.QueryRow(context.Background(), "select count(*) from foo").Scan(&n)
if err != nil {
t.Fatalf("QueryRow Scan failed: %v", err)
}
@@ -88,7 +88,7 @@ func TestTxCommitWhenTxBroken(t *testing.T) {
}
var n int64
err = conn.QueryRow("select count(*) from foo").Scan(&n)
err = conn.QueryRow(context.Background(), "select count(*) from foo").Scan(&n)
if err != nil {
t.Fatalf("QueryRow Scan failed: %v", err)
}
@@ -179,7 +179,7 @@ func TestTransactionSuccessfulRollback(t *testing.T) {
}
var n int64
err = conn.QueryRow("select count(*) from foo").Scan(&n)
err = conn.QueryRow(context.Background(), "select count(*) from foo").Scan(&n)
if err != nil {
t.Fatalf("QueryRow Scan failed: %v", err)
}
@@ -202,7 +202,7 @@ func TestBeginExIsoLevels(t *testing.T) {
}
var level pgx.TxIsoLevel
conn.QueryRow("select current_setting('transaction_isolation')").Scan(&level)
conn.QueryRow(context.Background(), "select current_setting('transaction_isolation')").Scan(&level)
if level != iso {
t.Errorf("Expected to be in isolation level %v but was %v", iso, level)
}