@@ -0,0 +1,866 @@
+package de.philipphager.disclosure.database;%0A%0Aimport com.squareup.sqlbrite.BriteDatabase;%0Aimport com.squareup.sqlbrite.SqlBrite;%0Aimport javax.inject.Inject;%0Aimport rx.schedulers.Schedulers;%0A%0Apublic class DatabaseManager %7B%0A  private final DatabaseOpenHelper openHelper;%0A  private final SqlBrite sqlBrite;%0A  private BriteDatabase database;%0A%0A  @Inject public DatabaseManager(DatabaseOpenHelper openHelper, SqlBrite sqlBrite) %7B%0A    this.openHelper = openHelper;%0A    this.sqlBrite = sqlBrite;%0A  %7D%0A%0A  public synchronized BriteDatabase open() %7B%0A    ensureDatabase();%0A    return database;%0A  %7D%0A%0A  public synchronized void close() %7B%0A    if (database != null) %7B%0A      database.close();%0A      database = null;%0A    %7D%0A  %7D%0A%0A  private void ensureDatabase() %7B%0A    if (database == null) %7B%0A      database = sqlBrite.wrapDatabaseHelper(openHelper, Schedulers.io());%0A      ;%0A    %7D%0A  %7D%0A%7D%0A

Add a database manager to manage database instances.