mardi 23 décembre 2014

Sync device sqlite database rows to Google Drive

I'm trying to do something that I thought would be fairly common --


Keep a local sqlite database on a user's phone/tablet in sync with a copy that's stored in their Google Drive app folder.


The benefits are obvious -- namely a user can use multiple devices, or replace their only device, and always get the latest database information, without resorting to manual exports/imports.


For an implementation, I see that it would be fairly easy to keep some kind of hashcode and do a full database upload/download whenever something changes -- however that becomes increasingly punitive and inefficient as the database grows.


I was hoping there would be a way to sync singular row-based operations, such as:



  1. Delete this row

  2. Insert this row

  3. Change this row


However, this appears to be non-trivial, if even possible.


What is the recommended approach for syncing row-based sqlite database operations between a device and Google Drive?


Aucun commentaire:

Enregistrer un commentaire