fabriciofx / cactoos-jdbc

Object-Oriented wrapper to JDBC
MIT License
38 stars 9 forks source link

Keyset pagination supprot #100

Open l3r8yJ opened 11 months ago

l3r8yJ commented 11 months ago

it would be nice to have keyset pagination here

fabriciofx commented 11 months ago

Hi @l3r8yJ!

If I undestood correctly, KeySet pagination applies when we have a sequenced column, like numbered id, right? The problem is I don't know it. In my examples (the phonebook) the id is a UUID and this don't apply keyset pagination, right? So, what do you recommend in this case?

l3r8yJ commented 11 months ago

@fabriciofx I'll send a pr later with the implementation. I've implemented this a few times in my work, maybe you'll like it

we don't need to know which field the customer will use for the order (there is also a time-based UUID, for that matter), we can create just a generic solution. Very often records in tables have columns like createdAt, updatedAt, etc.

fabriciofx commented 11 months ago

@l3r8yJ A PR will be welcome! Thanks!