diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-11-10 00:14:08 +0100 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-11-10 00:14:08 +0100 |
| commit | ca96a116a0e468f6fe9e1701ca90cf734acdef57 (patch) | |
| tree | be635c79dc48b8ef010ddd543d94cfb14444eca7 /testing/pgruntime/connect_test.go | |
| parent | edf487f2e1ff6f392a5b9ddc69a4a44a36ca4985 (diff) | |
| download | go-gg-ca96a116a0e468f6fe9e1701ca90cf734acdef57.tar.gz | |
replace selectOneValue() with oblast.SelectOne()
Diffstat (limited to 'testing/pgruntime/connect_test.go')
| -rw-r--r-- | testing/pgruntime/connect_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/testing/pgruntime/connect_test.go b/testing/pgruntime/connect_test.go index 1073791..4992c7f 100644 --- a/testing/pgruntime/connect_test.go +++ b/testing/pgruntime/connect_test.go @@ -7,6 +7,7 @@ import ( "testing" "go.xyrillian.de/gg/assert" + "go.xyrillian.de/gg/oblast" ) func TestMultipleConnectionsToSameDB(t *testing.T) { @@ -31,7 +32,7 @@ func TestMultipleConnectionsToSameDB(t *testing.T) { if err != nil { t.Fatal(err.Error()) } - barID, err := selectOneValue[int64](ctx, db2, `SELECT id FROM objects WHERE name = $1`, "bar") + barID, err := oblast.SelectOne[int64](ctx, db2, `SELECT id FROM objects WHERE name = $1`, "bar") if assert.ErrEqual(t, err, nil) { assert.Equal(t, barID, 2) } @@ -44,7 +45,7 @@ func TestMultipleConnectionsToSameDB(t *testing.T) { if assert.ErrEqual(t, err, nil) { assert.Equal(t, count, 0) } - nextID, err := selectOneValue[int64](ctx, db3, `INSERT INTO objects (name) VALUES ($1) RETURNING id`, "qux") + nextID, err := oblast.SelectOne[int64](ctx, db3, `INSERT INTO objects (name) VALUES ($1) RETURNING id`, "qux") if assert.ErrEqual(t, err, nil) { assert.Equal(t, nextID, 1) // sequence was reset and starts at 1 again } |
