importDatabaseFromFile function

Future<Database> importDatabaseFromFile(
  1. String path,
  2. DatabaseFactory dstFactory,
  3. String dstPath, {
  4. SembastCodec? codec,
  5. List<String>? storeNames,
})

Import database from a file (currently in .jsonl format)

Implementation

Future<Database> importDatabaseFromFile(
    String path, DatabaseFactory dstFactory, String dstPath,
    {SembastCodec? codec, List<String>? storeNames}) async {
  var data = decodeImportAny(await File(path).readAsString());
  return await importDatabaseAny(data, dstFactory, dstPath,
      codec: codec, storeNames: storeNames);
}