Currently in my iOS app that I’m enabling with a future cloud server with DA.NET, I use sqlite as the storage. Change it to use only DA is out of question by now.
I want to collect the data from a sqlite table and apply the changes to a DA table in the server. But I wonder if I can only send the Deltas without create the DADataTable and fill with all the rows for only send the few changed.
I think in create a empty DADataTable, and add only rows manually for the changed data… but how mark the rows as changed and not as new?
Hm, DADelta is tightly coupled with the DADataTable, and I’m afraid you cannot create its instance manually.
Yes you can maintain DADataTable instance on the client and load data there from the local SQLite database.
But for applying modification silently, you will need to perform following hack:
// fill your table with data (1)
...
// extract the delta
DADelta *delta = [DADelta deltaWithTable:yourTable];
// make all changes there as resolved
for (DADeltaChange *change in [delta changes])
[change setChangeStatus:csResolved];
// commit changes you've made at step (1)
[yourTable processDelta:delta andMergeChanges:YES];
// now your table doesn't have pending changes
// so you can change it as necessary and generate new proper delta for sending to the server