open static method

Opens <path>.lmdb with the library of symbols, which must include NativeSymbols.keyValue.

Implementation

static Future<Result<NativeKeyValueStore, DbError>> open(
  NativeSymbols symbols,
  String path,
) async {
  if (symbols.keyValue == null) {
    return Err(
      DbError(
        DbErrorCode.nativeLibrary,
        'The library was given without its key-value symbols',
      ),
    );
  }

  return (await NativeWorker.openOn(
    symbols,
    path,
    jsonEncode(const {}),
  )).map((open) => NativeKeyValueStore._(open.$1, open.$2));
}