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

This commit is contained in:
2024-02-21 16:10:28 +01:00
parent 3cc8dccc63
commit 9e586f7706
6 changed files with 60 additions and 14 deletions

View File

@@ -3,22 +3,11 @@ package sq
import (
"context"
"fmt"
ct "gogs.mikescher.com/BlackForestBytes/goext/cursortoken"
"gogs.mikescher.com/BlackForestBytes/goext/exerr"
"gogs.mikescher.com/BlackForestBytes/goext/langext"
pag "gogs.mikescher.com/BlackForestBytes/goext/pagination"
)
type PaginateFilter interface {
SQL(params PP) (filterClause string, joinClause string, joinTables []string)
Sort() []FilterSort
}
type FilterSort struct {
Field string
Direction ct.SortDirection
}
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) {
prepParams := PP{}