As far as I understand (I do maintain this library but I'm not its author...), there are two ways how the datastores work:
- a flat-file mode which is used for the ini, xml, json stores - they store the events, contacts etc. in a local file, load the file into internal lists, change or delete some records in these lists and finally write everything back to file.
- a database mode which is used by the bufdataset, sqlite etc stores - they load all records of a specified time frame (DayBuffer) into the internal lists, add or modify the records there and with every modification a flag "Changed" is set. Correspondingly records are marked for deletion. When the data are posted only the records with the "Changed" flag are written which is reset afterwards. Correspondignly those records marked for deletion are deleted from the dataset.
The second mode looks like what you need, but not exactly because after posting (which occurs when the data input dialogs close) the "Changed" and "to-be-deleted" flags are lost - the JSON string would still contain all records (except for the deleted ones).
I probably have to keep all records in memory and write the JSON string only when the datastore disconnects, as it happens now, but include only the changed records. But what to do with those marked for deletion? How do you interact with the REST server if you want to delete records?