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