From 71d4c873bd12233b585637404115cfea9462c904 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Thu, 30 Apr 2026 00:56:09 +0200 Subject: add ctx arguments to most methods --- oblast.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'oblast.go') diff --git a/oblast.go b/oblast.go index 059911b..ba43798 100644 --- a/oblast.go +++ b/oblast.go @@ -96,6 +96,7 @@ package oblast // import "go.xyrillian.de/oblast" import ( + "context" "database/sql" "database/sql/driver" "fmt" @@ -134,10 +135,10 @@ func StructTagKeyIs(key string) PlanOption { // Handle is an interface for functions providing direct DB access. // It covers methods provided by both *sql.DB and *sql.Tx, thus allowing functions using it to be used both within and outside of transactions. type Handle interface { - Exec(query string, args ...any) (sql.Result, error) - Prepare(query string) (*sql.Stmt, error) - Query(query string, args ...any) (*sql.Rows, error) - QueryRow(query string, args ...any) *sql.Row + ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error) + PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) + QueryContext(ctx context.Context, query string, args ...any) (*sql.Rows, error) + QueryRowContext(ctx context.Context, query string, args ...any) *sql.Row } // TODO: investigate if we can extend type Handle to cover types github.com/jackc/pgx.{Conn,Tx} -- cgit v1.2.3