idbExportDatabase function

Future<Map<String, Object?>> idbExportDatabase(
  1. Database db, {
  2. IdbExportNativeValueEncoder? nativeValueEncoder,
  3. IdbExportOptions? options,
})

export a database in a sdb export format

A native value (IdbNativeValue) cannot be exported as is: the export throws an ArgumentError unless nativeValueEncoder converts or drops it.

options can give the encoding of the custom types (the legacy @ one by default, see IdbExportTypeEncoding) and a native value encoder (overriding nativeValueEncoder).

Implementation

Future<Map<String, Object?>> idbExportDatabase(
  Database db, {
  IdbExportNativeValueEncoder? nativeValueEncoder,
  IdbExportOptions? options,
}) => _idbExportDatabase(
  db,
  options?.nativeValueEncoder ?? nativeValueEncoder,
  (db) => sembast.exportDatabase(db, options: _sembastExportOptions(options)),
);