Sync Sqlite Database with iCloud?

I have an application that is already in the app store and uses the Sqlite Database. Now I want to make another version that includes iCloud synchronization, now the question is: is there any tutorial or third-party sqlite database synchronization code with iCloud, since I searched a lot, but did not get a useful answer? Thanks in advance.

+4
source share
1 answer

SQLite and iCloud mix poorly. Although iCloud can use the iCloud API to put a SQLite file in iCloud, the file will almost certainly be corrupted. SQLite was not designed with this kind of use in mind, as well as between external log files, uncommitted transactions, etc., Itโ€™s not even a question of whether the file is corrupted only when (and the answer is โ€œvery soonโ€).

Although Core Data can use both SQLite files and iCloud, it does not synchronize the SQLite file. Instead, it has a schema that uses transaction logs to push changes back and forth.

If you want to use your existing data with iCloud, you probably have to do something. I do not know any good reference implementations. Basically, you will need to export data to a different format, as well as detect and import changes from other devices.

+6
source

Source: https://habr.com/ru/post/1500914/


All Articles