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
@@ -34,7 +34,7 @@ func BenchmarkPointerPointerWithNullValues(b *testing.B) {
lastLoginTime *time.Time
}
err = conn.QueryRow("selectNulls").Scan(
err = conn.QueryRow(context.Background(), "selectNulls").Scan(
&record.id,
&record.userName,
&record.email,
@@ -94,7 +94,7 @@ func BenchmarkPointerPointerWithPresentValues(b *testing.B) {
lastLoginTime *time.Time
}
err = conn.QueryRow("selectNulls").Scan(
err = conn.QueryRow(context.Background(), "selectNulls").Scan(
&record.id,
&record.userName,
&record.email,
@@ -206,7 +206,7 @@ func benchmarkSelectWithLog(b *testing.B, conn *pgx.Conn) {
lastLoginTime time.Time
}
err = conn.QueryRow("test").Scan(
err = conn.QueryRow(context.Background(), "test").Scan(
&record.id,
&record.userName,
&record.email,
@@ -582,7 +582,7 @@ func BenchmarkMultipleQueriesNonBatch(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
for j := 0; j < queryCount; j++ {
rows, err := conn.Query("select n from generate_series(0, 5) n")
rows, err := conn.Query(context.Background(), "select n from generate_series(0, 5) n")
if err != nil {
b.Fatal(err)
}