function pageOf
pageOf<T>(
rows: T[],
limit: number
): Page<T>

Turns rows fetched with LIMIT limit + 1 into a page. The extra row, when it comes back, is dropped and tells that another page follows, which spares a COUNT(*) over the whole list.

Type Parameters

Parameters

rows: T[]
limit: number

Return Type

Usage

import { pageOf } from "api/lib/pagination.ts";