mirror of
https://github.com/hanzo-fi/payments.git
synced 2026-10-30 20:31:20 +00:00
15 lines
449 B
Go
15 lines
449 B
Go
package storage
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/hanzo-fi/go-libs/v5/pkg/storage/bun/paginate"
|
|
"github.com/uptrace/bun"
|
|
)
|
|
|
|
func paginateWithOffset[FILTERS any, RETURN any](s *store, ctx context.Context,
|
|
q *paginate.OffsetPaginatedQuery[FILTERS], builders ...func(query *bun.SelectQuery) *bun.SelectQuery) (*paginate.Cursor[RETURN], error) {
|
|
query := s.db.NewSelect()
|
|
return paginate.UsingOffset[FILTERS, RETURN](ctx, query, *q, builders...)
|
|
}
|