Nozbe / WatermelonDB

🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
https://watermelondb.dev
MIT License
10.62k stars 600 forks source link

Initiate the db with last synced at? #1842

Open powderham opened 1 month ago

powderham commented 1 month ago

I have a case that might be slightly breaking what sync is for, but want to understand if I can do anything here.

I have a language learning app that comes with a set of words in a json in the bundled code. I also want to be able to sync these with a remote server.

Currently the flow is:

Load all the words from the JSON in to the watermelon db on first load Calls sync for the first time Receives all of the words from the db, since last synchronized at is undefined

I'd like to be able to set this flag in a robust way if possible. Are there any problems with setting it directly, or can something else be done?