supabase-swift icon indicating copy to clipboard operation
supabase-swift copied to clipboard

Offline Support

Open g3rd opened this issue 2 years ago • 6 comments

Feature request

I am building an application for a user group that spends a majority of their time ouside of a network connection. Having an offline sync or cache would simplify development.

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like

Either a recommened approach to caching or storing data offline or providing some magic behind the scenes to sync offline data.

Describe alternatives you've considered

Manually creating a local database copy with Core Data, Swift Data, or Realm Swift.

Additional context

g3rd avatar Oct 07 '23 01:10 g3rd

I'm not really sure this library should handle this. (A recommended approach and/or more documentation would be great though.) There could be so many ways to implement a local state, as you mentioned SwiftData, Realm, or others. I am currently building an app that uses SwiftData and Supabase, and while it might be nice to have these wrapped up together, its probably better for the choice to be up to the individual app or team since each team may have different priorities.

I'm curious to discuss it further though, this feels like it would be way down the list on things to tackle and require a lot of thought beforehand to do it right.

MadeByDouglas avatar Dec 15 '23 02:12 MadeByDouglas

Firebase has a feature which you can disable cache on initialization of the sdk. This way if the developer is not interested they can easily turn it off

DamilolaDami avatar Jun 19 '24 06:06 DamilolaDami

PowerSync is one option. https://docs.powersync.com/client-sdk-references/swift

dshukertjr avatar Jun 19 '24 13:06 dshukertjr

For my app at least, managing the local state while the user is not connected to a network, then eventually syncing with the server — this isn't something I want the Supabase SDK to handle "automatically". It's not easy to assume exactly how each apps needs to handle this scenario.

262hz avatar Jun 25 '24 07:06 262hz