couchbase_lite icon indicating copy to clipboard operation
couchbase_lite copied to clipboard

Support batch database operations

Open DustyLamp opened this issue 6 years ago • 2 comments

It would be great to allow for batch operations for efficiency (like avoiding unnecessary change events after saving docs etc..)

The solution would just expose the couchbase lite functionality for batch operations

DustyLamp avatar Nov 06 '19 12:11 DustyLamp

I've been looking into this issue. But because of the way how this function was implemented natively, I find it not feasible to implement it in Dart in the same manner ( by converting a closure in Dart into its Java/Swift equivalent). Please correct me if I am wrong here.

So my suggestion is to provide a variant, in this plugin, that will support only save and delete operations in batch, something like:

inBatch(Operation operation, List<MutableDocument> documents, ConcurrencyControl concurrencyControl)

where the operation argument can only be either SAVE or DELETE.

Any comment would be highly appreciated.

matsunanaro avatar Sep 01 '21 07:09 matsunanaro

I've created this PR to try to fix this issue

matsunanaro avatar Sep 19 '21 12:09 matsunanaro