atomically method
Runs writes in one SQLite transaction: a process killed half-way
through a document's records commits none of them, rather than leaving
the document half-written on disk.
Implementation
@override
Future<void> atomically(Future<void> Function() writes) async {
_open.execute('BEGIN');
try {
await writes();
_open.execute('COMMIT');
} catch (_) {
_open.execute('ROLLBACK');
rethrow;
}
}