CreatePaginatorOptions
type CreatePaginatorOptions<T, TCursor> = object;Defined in: pagination.ts:120
Possibly-async fetchers with a sync codec — the common case.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
TCursor extends Record<string, unknown> |
Properties
Section titled “Properties”cursor?
Section titled “cursor?”cursor?: PaginatorCursorOptionsSync<T, TCursor>;Defined in: pagination.ts:135
Required for cursor pagination and for cursors in page/offset results.
fetchCursor?
Section titled “fetchCursor?”fetchCursor?: (window) => MaybePromise<PaginationFetchResult<T>>;Defined in: pagination.ts:133
Fetch for cursor requests (keyset SQL via drizzle-cursor, Mongo range
queries…). Fetch up to window.limit rows after/before
window.cursor, flipping sort order when window.direction is
"backward".
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
window |
CursorWindow<TCursor> |
Returns
Section titled “Returns”MaybePromise<PaginationFetchResult<T>>
fetchOffset?
Section titled “fetchOffset?”fetchOffset?: (window) => MaybePromise<PaginationFetchResult<T>>;Defined in: pagination.ts:126
Fetch for page/offset requests (SQL OFFSET, Mongo .skip(), REST
?offset=…). Fetch up to window.limit rows — it includes a one-row
lookahead used to compute hasNextPage, so do not cap it yourself.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
window |
OffsetWindow |
Returns
Section titled “Returns”MaybePromise<PaginationFetchResult<T>>
maxLimit?
Section titled “maxLimit?”maxLimit?: number;Defined in: pagination.ts:137
Hard cap applied to any requested limit/pageSize. Default: no cap.