v0.0.408
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 3m43s

This commit is contained in:
Mike Schwörer 2024-03-11 16:41:47 +01:00
parent 4a33986b6a
commit 645113d553
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
3 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,5 @@
package goext package goext
const GoextVersion = "0.0.407" const GoextVersion = "0.0.408"
const GoextVersionTimestamp = "2024-03-11T16:40:41+0100" const GoextVersionTimestamp = "2024-03-11T16:41:47+0100"

View File

@ -6,7 +6,7 @@ import (
"gogs.mikescher.com/BlackForestBytes/goext/exerr" "gogs.mikescher.com/BlackForestBytes/goext/exerr"
) )
func Iterate[TData any](ctx context.Context, q Queryable, table string, filter PaginateFilter, scanMode StructScanMode, scanSec StructScanSafety, page int, limit *int, consumer func(v TData) error) (int, error) { func Iterate[TData any](ctx context.Context, q Queryable, table string, filter PaginateFilter, scanMode StructScanMode, scanSec StructScanSafety, page int, limit *int, consumer func(ctx context.Context, v TData) error) (int, error) {
if filter == nil { if filter == nil {
filter = NewEmptyPaginateFilter() filter = NewEmptyPaginateFilter()
} }

View File

@ -334,7 +334,7 @@ func ScanAll[TData any](ctx context.Context, q Queryable, rows *sqlx.Rows, mode
return res, nil return res, nil
} }
func IterateAll[TData any](ctx context.Context, q Queryable, rows *sqlx.Rows, mode StructScanMode, sec StructScanSafety, close bool, consumer func(v TData) error) (int, error) { func IterateAll[TData any](ctx context.Context, q Queryable, rows *sqlx.Rows, mode StructScanMode, sec StructScanSafety, close bool, consumer func(ctx context.Context, v TData) error) (int, error) {
var strscan *StructScanner var strscan *StructScanner
if sec == Safe { if sec == Safe {
@ -370,7 +370,7 @@ func IterateAll[TData any](ctx context.Context, q Queryable, rows *sqlx.Rows, mo
return rcount, err return rcount, err
} }
err = consumer(data) err = consumer(ctx, data)
if err != nil { if err != nil {
return rcount, exerr.Wrap(err, "").Build() return rcount, exerr.Wrap(err, "").Build()
} }
@ -384,7 +384,7 @@ func IterateAll[TData any](ctx context.Context, q Queryable, rows *sqlx.Rows, mo
return rcount, err return rcount, err
} }
err = consumer(data) err = consumer(ctx, data)
if err != nil { if err != nil {
return rcount, exerr.Wrap(err, "").Build() return rcount, exerr.Wrap(err, "").Build()
} }