aboutsummaryrefslogtreecommitdiff
path: root/pgruntime/helpers.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2026-11-10 00:14:08 +0100
committerStefan Majewsky <majewsky@gmx.net>2026-11-10 00:14:08 +0100
commitca96a116a0e468f6fe9e1701ca90cf734acdef57 (patch)
treebe635c79dc48b8ef010ddd543d94cfb14444eca7 /pgruntime/helpers.go
parentedf487f2e1ff6f392a5b9ddc69a4a44a36ca4985 (diff)
downloadgo-gg-ca96a116a0e468f6fe9e1701ca90cf734acdef57.tar.gz
replace selectOneValue() with oblast.SelectOne()
Diffstat (limited to 'pgruntime/helpers.go')
-rw-r--r--pgruntime/helpers.go14
1 files changed, 0 insertions, 14 deletions
diff --git a/pgruntime/helpers.go b/pgruntime/helpers.go
index 3f4723a..7a7d97e 100644
--- a/pgruntime/helpers.go
+++ b/pgruntime/helpers.go
@@ -33,20 +33,6 @@ func queryRow(ctx context.Context, db gsql.Handle, query string, args, slots []a
return errext.WithCleanup(err, "stmt.Close", stmt.Close())
}
-// Convenience function for executing a one-off SQL query returning one value.
-// TODO: move to gsql
-func selectOneValue[T any](ctx context.Context, db gsql.Handle, query string, args ...any) (T, error) {
- stmt, err := db.GSQLPrepare(ctx, query, false)
- if err != nil {
- var none T
- return none, err
- }
-
- var result T
- err = stmt.QueryRow(ctx, args, []any{&result})
- return result, errext.WithCleanup(err, "stmt.Close", stmt.Close())
-}
-
// Convenience function for preparing an identifier that needs to be inserted into a query verbatim
// (e.g. a database name for CREATE DATABASE).
func quoteIdentifier(name string) string {