New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OFFSET #6185

Open
cmelchior opened this Issue Sep 24, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@cmelchior
Contributor

cmelchior commented Sep 24, 2018

Followup from #544 and #6126

#6126 introduces support for LIMIT, this makes it possible to do keyed pagination as described in the JetPack pagination documentation (ItemKeyedDataSource):

https://developer.android.com/reference/android/arch/paging/DataSource
https://developer.android.com/reference/android/arch/paging/ItemKeyedDataSource

However, Positional or tiled paging require OFFSET to function correctly:
https://developer.android.com/reference/android/arch/paging/PositionalDataSource

This issue tracks adding OFFSET support to the query language and thus notification system. Some primitive form of OFFSET can already be implemented using the standard List.subList() API: https://docs.oracle.com/javase/7/docs/api/java/util/List.html#subList(int,%20int)

Implementation notes:
OFFSET on a local dataset would be very simple to do, but very hard in Query-based Realms as the device Realm might not have the complete view, meaning the query will have to adjust for potential objects still not synchronized. See the internal design document for further details: https://docs.google.com/document/d/11KAjdw4nxJtv2fq7JPuWhy4tuKOtoyiJlnoOnEEgXUc/edit#heading=h.c3uxob836ny1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment