What happens to Expo SQLite pagination when rows are added or deleted between LIMIT/OFFSET pages?
0 reputation · 09 Sept 2020, 09:08 UTC
Goal: Use Expo‑SQLite’s executeSql with LIMIT and OFFSET to paginate a local table while another process may insert or delete rows.
Constraint: The module forwards raw SQL to SQLite without providing snapshot isolation, so OFFSET values are calculated on the live table state.
Uncertainty: It is unclear whether concurrent modifications cause page boundaries to shift, leading to duplicate or missing rows, and whether any built‑in mechanism can mitigate this.
Does Expo‑SQLite expose any isolation level or transaction mode that creates a consistent snapshot for the duration of a paginated query?
Can a developer safely wrap each page fetch in a transaction to prevent shifting offsets, or does that merely serialize writes without solving the issue?
Which strategy—such as keyset pagination, row versioning, or application‑level locking—best guarantees stable page boundaries under concurrent changes?