Skip to main content

Pagination

Why pagination?

We sometimes make some SQL to list all entities, which might contain lots of data. Instead of sending all of them to our clients, we can paginate them and send the necessary data. It's a common design of modern API servers.

Implement by yourself

You can implement pagination strategies yourself by modifying your SQL. For example, we can use parameters to implement simple offset-based pagination.

SELECT * FROM users
LIMIT {{ context.params.limit }}
OFFSET {{ context.params.offset }}

Auto Pagination

VulcanSQL has implemented some pagination strategies for us, we can use them simply by setting the configuration in API Schema. No SQL modification is required.

Please check the corresponding page for further information about each pagination mode.

ModeDescription
offsetOffset-based pagination e.g. /path?offset=10&limit=100
cursorTBD
keysetTBD