saveTableSnapshot method

  1. @override
Future<void> saveTableSnapshot(
  1. String tableName,
  2. List<Map<String, dynamic>> rows
)
override

Implementation

@override
Future<void> saveTableSnapshot(
  String tableName,
  List<Map<String, dynamic>> rows,
) async {
  await _tracked(() async {
    await _ensureInitialized();
    await _locks.getTableLock(tableName).synchronized(() async {
      final file = _tableFile(tableName);
      final json = jsonEncode(rows);
      await _fileStore.atomicWrite(file, json);
      await _fileStore.cleanupBackup(file);
    });
  });
}