When I'm pagination querying my data from a PostgreSQL database, each request involves fetching the data in this manner:
let lastNArticles: Article[] = await Article.findAll({
limit: +req.body.count * +req.body.page,
order: [["created_at", "DESC"]],
include: [
User,
{
model: ArticleOwnTags,
include: [ArticleTag],
},
],
});
However, I am only interested in retrieving the last "req.body.count" fetched rows instead of all rows (count * page). Is there a way to configure PostgreSQL to fetch only the desired number of rows (+req.body.count - page size)?