Cursor Pagination Broken
Hii, i am facing an error with cursor pagination where i get this error when i use the cursor to paginate through the
after
and before
fields
this happens when i use filter on JSON nested key character->element
6 Replies
Hi, indeed there is a bug with paginating queries with json filters. We added an internal issue and will follow up.
As development is currently focused on Postgres compatibility and features rather than the REST API, I cannot provide an estimate for fixing the issue. As a workaround you can use SQL https://xata.io/docs/sdk/sql/overview with the
xata.sql
call in the SDK and paginate with OFFSET/LIMIT.
SQL over HTTP
How to access Xata using SQL directly over HTTP
The
SQL
tab in the docs here provides an example statement as well : https://xata.io/docs/sdk/filtering#working-with-json-documentsFiltering records
Use the Xata SDK to filter across APIs for versatile functionality
Ohh I can implement a workaround no worries, I'd rather not change complete pagination
Just wanted to report this
Absolutely thank you for raising this
The reason I am in constant denial of using raw SQL query is because I love xata's cursor pagination, on subsequent calls to
getPaginated
passing cursor retrieves all the filters and sorting from initial query
Makes it a breeze to paginate through
Hii, I know this is not a priority but could someone from the team just send a message in this thread this whenever this is fixed? Thank you!Certainly, we've linked this thread to the internal issue so once that is addressed we will drop a note here 👍