diff options
Diffstat (limited to 'testing/pgruntime')
| -rw-r--r-- | testing/pgruntime/connect_test.go | 3 | ||||
| -rw-r--r-- | testing/pgruntime/helpers_test.go | 10 |
2 files changed, 1 insertions, 12 deletions
diff --git a/testing/pgruntime/connect_test.go b/testing/pgruntime/connect_test.go index 4992c7f..f43c6f8 100644 --- a/testing/pgruntime/connect_test.go +++ b/testing/pgruntime/connect_test.go @@ -40,8 +40,7 @@ func TestMultipleConnectionsToSameDB(t *testing.T) { // another connection with ConnectForTest() should truncate all tables and reset all sequences db3, target2 := connector.ConnectForTest(t, defaultBehavior) assert.Equal(t, target, target2) - var count int64 - err = queryRow(ctx, db3, `SELECT COUNT(*) FROM objects`, nil, []any{&count}) + count, err := oblast.SelectOne[int64](ctx, db3, `SELECT COUNT(*) FROM objects`) if assert.ErrEqual(t, err, nil) { assert.Equal(t, count, 0) } diff --git a/testing/pgruntime/helpers_test.go b/testing/pgruntime/helpers_test.go index 835df8b..d8c3cc9 100644 --- a/testing/pgruntime/helpers_test.go +++ b/testing/pgruntime/helpers_test.go @@ -21,13 +21,3 @@ func execQuery(ctx context.Context, db gsql.Handle, query string, args []any) (s result, err := stmt.Exec(ctx, args) return result, errext.WithCleanup(err, "stmt.Close", stmt.Close()) } - -// Convenience function for executing a one-off SQL query returning one row. -func queryRow(ctx context.Context, db gsql.Handle, query string, args, slots []any) error { - stmt, err := db.GSQLPrepare(ctx, query, false) - if err != nil { - return err - } - err = stmt.QueryRow(ctx, args, slots) - return errext.WithCleanup(err, "stmt.Close", stmt.Close()) -} |
