v0.0.407 sq.Iterate
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Has been cancelled
Some checks failed
Build Docker and Deploy / Run goext test-suite (push) Has been cancelled
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user