Open oney opened 4 months ago
I don't have plans right now, but my quick reaction is:
prevCursor
in client-side memory (won't work with a stateless client, but in most cases we're talking about a web app...)limit
- at which point the client can assume that it has reached the end of the list. (Looks like you already have this logic server-side, fine.)I dislike the approach you are taking here (making an additional query to generate the hasPrev value server-side) and suggest delegating this to the client to infer for itself (as described in the first bullet point above).
Next/prev cursors always exist (if not empty) even if there's no next/prev page available at the time of querying
Just curious, why is this a requirement in your system?
Thank you for creating this package! It's very handy for paginating to the next page, but it seems to lack support for the previous page.
I'm using drizzle pagination with tRPC.
My code works, but it's still a bit tedious even with the help of drizzle-pagination. Do you have any plans to support generating
hasNext
,hasPrev
,nextCursor
, andprevCursor
directly or through helper functions?Here's what my code looks like: