Skip to content

Add settings 'limit' and 'offset'. #16176

@alexey-milovidov

Description

@alexey-milovidov

These settings will act as the separate limit and offset applied to query result
(as if query is put into subquery and additional LIMIT and/or OFFSET is added outside).

They should be implemented by adjusting existing LIMIT and/or OFFSET if any or by adding LIMIT and/or OFFSET if there were not in InterpreterSelectQuery.

Example:

Suppose we have a query:

SELECT * FROM table LIMIT 100 OFFSET 1000

And the setting limit is set to 50 and offset is set to 75.
Then we should execute this query as the following:

SELECT * FROM table LIMIT 25 OFFSET 1075

Use case:

API that allows the user to provide arbitrary queries but wants to apply pagination of the result.
If user did not supply the limit in their query, the settings will allow to paginate the whole result.
If user supplied limit in their query, the settings will allow to paginate within already limited result.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions