Small improvements

This commit is contained in:
M66B
2023-12-12 11:58:41 +01:00
parent 56309888ef
commit e4840587a7
10 changed files with 30 additions and 20 deletions

View File

@@ -483,7 +483,8 @@ public abstract class DB extends RoomDatabase {
if (cache_size != null) {
cache_size = -cache_size; // kibibytes
Log.i("Set PRAGMA cache_size=" + cache_size);
try (Cursor cursor = db.query(new SimpleSQLiteQuery("PRAGMA cache_size=" + cache_size + ";"))) {
// TODO CASA
try (Cursor cursor = db.query("PRAGMA cache_size=" + cache_size + ";")) {
cursor.moveToNext(); // required
}
}
@@ -503,7 +504,8 @@ public abstract class DB extends RoomDatabase {
// https://www.sqlite.org/pragma.html
for (String pragma : DB_PRAGMAS)
if (!"compile_options".equals(pragma) || BuildConfig.DEBUG) {
try (Cursor cursor = db.query(new SimpleSQLiteQuery("PRAGMA " + pragma + ";"))) {
// TODO CASA
try (Cursor cursor = db.query("PRAGMA " + pragma + ";")) {
boolean has = false;
while (cursor.moveToNext()) {
has = true;