This commit is contained in:
adlerhurst
2025-03-18 14:45:54 +01:00
parent df1cc833d3
commit e00ab397e2
24 changed files with 287 additions and 942 deletions

View File

@@ -72,6 +72,14 @@ type Querier interface {
QueryRow(ctx context.Context, stmt string, args ...any) Row
}
func Query[Out any](q Querier, fn func(q Querier) ([]Out, error)) ([]Out, error) {
return fn(q)
}
func QueryRow[Out any](q Querier, fn func(q Querier) (Out, error)) (Out, error) {
return fn(q)
}
type Executor interface {
Exec(ctx context.Context, stmt string, args ...any) error
}