From f082ae9a138edd1ee1bcdfc40276013064fbec7e Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Tue, 10 Nov 2026 00:32:16 +0100 Subject: replace execQuery() with new gsql.Exec() helper --- pgruntime/helpers.go | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'pgruntime/helpers.go') diff --git a/pgruntime/helpers.go b/pgruntime/helpers.go index 1b9e11f..d68b920 100644 --- a/pgruntime/helpers.go +++ b/pgruntime/helpers.go @@ -4,25 +4,9 @@ package pgruntime import ( - "context" - "database/sql" "strings" - - "go.xyrillian.de/gg/errext" - "go.xyrillian.de/gg/gsql" ) -// Convenience function for executing a one-off SQL query returning no rows. -// TODO: move to gsql -func execQuery(ctx context.Context, db gsql.Handle, query string, args []any) (sql.Result, error) { - stmt, err := db.GSQLPrepare(ctx, query, false) - if err != nil { - return nil, err - } - result, err := stmt.Exec(ctx, args) - 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 { -- cgit v1.3.1