SaltechSystems / couchbase_lite

Flutter plugin for the Community edition of Couchbase Lite. Couchbase Lite is an embedded lightweight, document-oriented (NoSQL), syncable database engine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support batch database operations

DustyLamp opened this issue · 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

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.

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