Pagination? #1228
Unanswered
ffpetrovic
asked this question in
Q&A
Pagination?
#1228
Replies: 1 comment
-
You could add an offset to the limit so that you'll always watch a fixed-length chunk at a time. const int pageSize = 50;
Selectable<...> yourQuery({int page = 1}) {
return select(yourTable)..limit(pageSize, offset: (page - 1) * pageSize);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I see that that there are potential issues while watching an increasingly large query. What I'm looking for is pagination support (in the UI implementation it's actually a sort of infinite scroll), and I guess I'd go about it by adding a DAO method in the Database class that accepts a parameter for the
LIMIT
part of the query. And so when the user scrolls to get more entries, thisLIMIT
parameter would increase. What if in the end I end up watching a query whose LIMIT is 10000, 50000 or 100000? Are there any optimization steps I can take?Beta Was this translation helpful? Give feedback.
All reactions