[Koha-bugs] [Bug 19196] Add pagination helpers

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Sep 23 00:10:39 CEST 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19196

--- Comment #22 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Martin Renvoize from comment #18)
> I really like this.. only minor query would be can we document the decision
> as to why we've chosen to do page based instead of cursor based result
> 'paging'. I'm personally happy to go with either.. but to prevent FUD in
> future developers I think it's worth documenting the decision process so we
> can point to that when someone asks down the line ;)

I think we could implement both pagination methods on a as-needed basis and
there should be no conflict. A new set of helper can be added based on this
work, with proper tests c&p-ed from the ones on this bug.

Regarding the specifics of why I chose to start with page-based results paging,
I'd say:
- It looked pretty *natural* when you look at SQL::Abstract syntax for it.
- It is what Github uses (https://developer.github.com/v3/#pagination) and I
really like its simplicity.
- Cursor based pagination is really harder to implement, and the use cases I'm
tackling wouldn't benefit much from it (i.e. it'ss just vendor orders, not
stuffs that change very often and pagination would become really difficult, in
which case other artifacts would get involved like websockets/server side
events to notify changes).

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list