Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Also Ruby: sequel-seek-pagination

https://github.com/chanks/sequel-seek-pagination

I used it just this week to write a Relay Connection paginator for graphql-ruby and Sequel/Postgres. It uses keyset pagination to reliably avoid skipping items and maintain consistent query times.

Backwards pagination was a bit tricky since that’s not natively supported by sequel-seek-pagination. Basically I had to reverse the list order and then filter with the cursor values to get the last N items in a subquery, then reverse that list again to get back the desired sort order.

https://github.com/rmosolgo/graphql-ruby/pull/1014



Thanks. I've added it to the Hall of Fame: http://use-the-index-luke.com/no-offset#frameworks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: