copyDatabase function
Copy a database content to a new database.
Implementation
Future<Database> copyDatabase(
Database srcDatabase, IdbFactory dstFactory, String dstDbName) async {
final dstDatabase = await copySchema(srcDatabase, dstFactory, dstDbName);
for (final storeName in srcDatabase.objectStoreNames) {
await copyStore(srcDatabase, storeName, dstDatabase, storeName);
}
return dstDatabase;
}