Releases: Kaltsoon/sequelize-cursor-pagination
Releases · Kaltsoon/sequelize-cursor-pagination
v3.5.1
v3.5.0
Support "lazy evaluation" version of the paginate
function, which can be created using the makePaginateLazy
function:
import { makePaginateLazy } from 'sequelize-cursor-pagination';
Counter.paginateLazy = makePaginateLazy(Counter);
// Same options are supported as with the regular paginate function
const connection = Counter.paginateLazy({
limit: 10,
});
// Only one database query is performed in case we are only insterested in the edges
const edges = await connection.getEdges();
// Otherwise, we can fetch the total count and page info as well
const totalCount = await connection.getTotalCount();
const pageInfo = await connection.getPageInfo();