open static method

Future<WalBinary> open(
  1. String path, {
  2. required VfsAdapter vfs,
})

Implementation

static Future<WalBinary> open(String path, {required VfsAdapter vfs}) async {
  final wal = WalBinary._(path, vfs);

  final exists = await vfs.exists(path);
  if (!exists) {
    // Write file version header
    await vfs.writeAll(path,
        Uint8List.fromList(const Utf8Encoder().convert(_fileVersion)));
  }

  await wal._resumeLsn();
  return wal;
}