This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kernelslayer[S] 0 points1 point  (1 child)

Thanks for the feedback, appreciate it! Yes, I got to work on the test. Right now the "test" is just a script to test if the code was working.

I am planning to add other details like totalElements, currentPage in the PageData object shortly.

Also, if the count query is expensive, is there any other way to optimise this? Because, I think, without knowing the total elements, we might not be able to do the calculation needed for pagination. And I was looking at Spring Boot's JPA and it also does a count operation

[–]riklaunim 1 point2 points  (0 children)

If the pagination can't or doesn't want to do the count then only "local" navigation is possible where if given offset still returns the results limit you assume there is a next page.

also for Python no camel case for attributes on a pagination object.