diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-04-30 00:56:09 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-04-30 00:56:38 +0200 |
| commit | 71d4c873bd12233b585637404115cfea9462c904 (patch) | |
| tree | eded14e0d5ffad139263154701eb6f115ea6b2bc /oblast.go | |
| parent | 24bfa86b90f7b9bec886af7e3e4f02fee25ce99c (diff) | |
| download | go-oblast-71d4c873bd12233b585637404115cfea9462c904.tar.gz | |
add ctx arguments to most methods
Diffstat (limited to 'oblast.go')
| -rw-r--r-- | oblast.go | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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} |
