Skip to content

OffsetPage

OffsetPage<T> = object

Defined in: packages/db/src/types.ts:305

A page of results from offset-based pagination.

Includes total counts for rendering page navigation controls.

const page: OffsetPage<Post> = await db.query(posts)
.paginate({ type: "offset", page: 1, limit: 20 })
.run({});
console.log(`Page ${page.page} of ${page.totalPages} (${page.total} total)`);

T

The row type.

items: T[]

Defined in: packages/db/src/types.ts:307

The items on this page.


page: number

Defined in: packages/db/src/types.ts:311

The current 1-based page number.


total: number

Defined in: packages/db/src/types.ts:309

Total number of matching rows across all pages.


totalPages: number

Defined in: packages/db/src/types.ts:313

Total number of pages (computed as Math.ceil(total / limit)).