sandman
sandman copied to clipboard
Performant pagination
Sandman currently fetches all results in a query set, then applies offsets and limits in memory. It's more efficient to offload pagination to the database. This patch uses the pagination helpers built into Flask-SQLAlchemy to apply offsets and limits in the database. All result sets are now paginated, and pagination metadata are included in JSON responses:
{
resources: [...],
pagination: {
page: 4,
per_page: 20,
count: 100
}
}