I use LIMIT and OFFSET in InfluxQL queries to handle pagination.
For example, when measuring with three rows.
> SELECT *::field FROM i2QYtZBVSnuXjLhQhuAV6w; name: i2QYtZBVSnuXjLhQhuAV6w time hello ---- ----- 2018-02-23T18:00:00Z 1000 2018-02-23T18:30:00Z 1200 2018-02-23T19:00:00Z 990
Suppose I read the lines one by one using LIMIT and OFFSET :
> SELECT *::field FROM i2QYtZBVSnuXjLhQhuAV6w LIMIT 1; name: i2QYtZBVSnuXjLhQhuAV6w time hello ---- ----- 2018-02-23T18:00:00Z 1000 > SELECT *::field FROM i2QYtZBVSnuXjLhQhuAV6w LIMIT 1 OFFSET 1; name: i2QYtZBVSnuXjLhQhuAV6w time hello ---- ----- 2018-02-23T18:30:00Z 1200 > SELECT *::field FROM i2QYtZBVSnuXjLhQhuAV6w LIMIT 1 OFFSET 2; name: i2QYtZBVSnuXjLhQhuAV6w time hello ---- ----- 2018-02-23T19:00:00Z 990
Is there any way to find out that after that there is no more data without performing an additional request?
EDIT: My use case generates a βnext page tokenβ for a user-oriented REST API. I would like to avoid giving the user a token that just returns an empty set of strings.
source share