inBatch abstract method

Future<void> inBatch(
  1. FutureOr<void> fn()
)

Runs a group of database operations in a batch.

Use this when performing bulk write operations like multiple inserts/updates; it saves the overhead of multiple database commits, greatly improving performance.

Calls to inBatch must not be nested.

Any asynchronous tasks launched from inside a inBatch block must finish writing to the database before the inBatch block completes.

Implementation

Future<void> inBatch(FutureOr<void> Function() fn);