connectToDb method

Future<Db?> connectToDb({
  1. bool force = false,
})

Implementation

Future<Db?> connectToDb({
  bool force = false,
}) async {
  if (_dbConnected && !force) {
    throw DbAlreadyConnectedException();
  }
  DbConnect dbConnect = DbConnect(_app);
  db = await dbConnect.connectAllProvidedDBs(
    setMemoryController: _setMemoryController,
    setMongoDb: _setMongoDb,
  );
  _dbConnected = true;
  return db;
}