You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working on SQLite db on android in the past. When the database had tens of thousands of records and I needed to show them in a big list (RecyclerView), I could use android pattern, that was always accessing only the "window" of the records, that was currently on the screen.
Basically I was using android Cursor class, changing it's position as necessary and then used custom mapper very similar to mapper present in SQLDelight: https://developer.android.com/reference/android/database/Cursor#moveToPosition(int)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I was working on SQLite db on android in the past. When the database had tens of thousands of records and I needed to show them in a big list (RecyclerView), I could use android pattern, that was always accessing only the "window" of the records, that was currently on the screen.
Basically I was using android Cursor class, changing it's position as necessary and then used custom mapper very similar to mapper present in SQLDelight:
https://developer.android.com/reference/android/database/Cursor#moveToPosition(int)
Is there API, that will allow me doing the similar thing? Accessing cursor at position without having to load the whole queryset into memory as the list?
I found only SqlCursor, but it allows only iterating through, not setting the position:
https://cashapp.github.io/sqldelight/1.x/runtime/com.squareup.sqldelight.db/-sql-cursor/
Or if this whole approach is not valid for SQLDelight, is there some low level high-level performance API for accessing windows of a resultset?
Beta Was this translation helpful? Give feedback.
All reactions