v0.0.407 sq.Iterate
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Has been cancelled

This commit is contained in:
2024-03-11 16:40:41 +01:00
parent c1c8c64c76
commit 4a33986b6a
5 changed files with 141 additions and 2 deletions

View File

@@ -9,6 +9,10 @@ import (
)
func Paginate[TData any](ctx context.Context, q Queryable, table string, filter PaginateFilter, scanMode StructScanMode, scanSec StructScanSafety, page int, limit *int) ([]TData, pag.Pagination, error) {
if filter == nil {
filter = NewEmptyPaginateFilter()
}
prepParams := PP{}
sortOrder := filter.Sort()
@@ -90,6 +94,10 @@ func Paginate[TData any](ctx context.Context, q Queryable, table string, filter
}
func Count(ctx context.Context, q Queryable, table string, filter PaginateFilter) (int, error) {
if filter == nil {
filter = NewEmptyPaginateFilter()
}
prepParams := PP{}
filterCond, joinCond, _ := filter.SQL(prepParams)