appendBatch method
Implementation
Future<int> appendBatch(List<({
WalOp op,
String table,
Map<String, dynamic> payload,
int? txnId,
})> ops) async {
if (_closed) throw StateError('WAL is closed');
int lastLsn = _lsn;
for (final o in ops) {
_lsn++;
final record = WalRecord(
op: o.op,
table: o.table,
payload: o.payload,
lsn: _lsn,
txnId: o.txnId ?? _currentTxnId,
checksum: 0,
);
_bufferRecord(record);
lastLsn = _lsn;
}
await _flush();
_flushedLsn = lastLsn;
return lastLsn;
}