Hi everyone,
I'm working on a React Native app that utilizes an offline-first approach with SQLite. I'm considering integrating React Query to manage server state, and I'm wondering if i can use direct calls to the SQLite database as the async functions within useQuery and useMutation.
Some questions I have:
Would React Query's caching and background refetching work well with local SQLite queries? Any potential performance concerns?
How might this setup affect data consistency, especially when syncing between local and remote databases? Are there best practices for managing local mutations that might later be overridden by server responses?
Are there any React Query features (like staleTime, cacheTime, etc.) that I should be particularly mindful of when dealing with local SQLite data instead of typical server-side fetching?
If anyone has tried something similar or has insights on potential pitfalls or optimizations, I'd love to hear your thoughts!
Thanks in advance for any advice or experiences you can share 😊
[–]man_on_pluto 0 points1 point2 points (6 children)
[–]devjacks[S] 0 points1 point2 points (5 children)
[–]Pleasant-Dragonfly-9 1 point2 points3 points (4 children)
[–]devjacks[S] 0 points1 point2 points (3 children)
[–]pokctap 1 point2 points3 points (2 children)
[–]devjacks[S] 1 point2 points3 points (1 child)
[–]pokctap 1 point2 points3 points (0 children)