databaseMerge function Null safety

Future<void> databaseMerge(
  1. Database db,
  2. {required Database sourceDatabase,
  3. List<String>? storeNames}

Merge a database with an existing source database.

Existing records are removed.

if storeNames is not specified, it handles stores from both the source and destination database.


Future<void> databaseMerge(Database db,
    {required Database sourceDatabase, List<String>? storeNames}) async {
  var names = storeNames ??
  await db.transaction((transaction) async {
    for (var store in names) {
      await txnMergeStore(transaction,
          sourceDatabase: sourceDatabase, storeName: store);