db property

Future<Database?> db

Implementation

Future<Database?> get db async {
  _dbMap = _dbMap ?? <String, Database?>{};
  if (_dbMap![_dbModel!.databaseName!] == null) {
    _dbMap![_dbModel!.databaseName!] = await _connectionBase!.openDb();
    await _dbModel!.initializeDB();
    // Unfortunately SQLite doesn't support the ADD CONSTRAINT variant of the ALTER TABLE. Therefore we had to comment line below
    //await _dbModel!.initializeForeignKeys();
  }
  return _dbMap![_dbModel!.databaseName!];
}