This commit is contained in:
M66B 2019-05-12 18:14:38 +02:00
parent d17dd68f3b
commit edd1d14497
1 changed files with 0 additions and 13 deletions

View File

@ -97,10 +97,6 @@ public abstract class DB extends RoomDatabase {
if (sInstance == null) {
Context context = ctx.getApplicationContext();
sInstance = migrate(context, getBuilder(context));
Log.i("SQLite version=" + exec(sInstance, "SELECT sqlite_version() AS sqlite_version"));
Log.i("SQLite sync=" + exec(sInstance, "PRAGMA synchronous"));
Log.i("SQLite journal=" + exec(sInstance, "PRAGMA journal_mode"));
}
return sInstance;
@ -114,15 +110,6 @@ public abstract class DB extends RoomDatabase {
.setJournalMode(JournalMode.WRITE_AHEAD_LOGGING);
}
private static String exec(DB db, String command) {
try (Cursor cursor = db.query(command, new Object[0])) {
if (cursor != null && cursor.moveToNext())
return cursor.getString(0);
else
return null;
}
}
private static DB migrate(final Context context, RoomDatabase.Builder<DB> builder) {
// https://www.sqlite.org/lang_altertable.html
return builder