|
|
|
@ -127,6 +127,7 @@ public abstract class DB extends RoomDatabase {
|
|
|
|
|
static final String DB_NAME = "fairemail";
|
|
|
|
|
static final int DEFAULT_QUERY_THREADS = 4; // AndroidX default thread count: 4
|
|
|
|
|
static final int DEFAULT_CACHE_SIZE = 10; // percentage of memory class
|
|
|
|
|
private static final int DB_JOURNAL_SIZE_LIMIT = 1048576; // requery/sqlite-android default
|
|
|
|
|
private static final int DB_CHECKPOINT = 1000; // requery/sqlite-android default
|
|
|
|
|
|
|
|
|
|
private static final String[] DB_TABLES = new String[]{
|
|
|
|
@ -450,6 +451,11 @@ public abstract class DB extends RoomDatabase {
|
|
|
|
|
cursor.moveToNext(); // required
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Log.i("Set PRAGMA journal_size_limit=" + DB_JOURNAL_SIZE_LIMIT);
|
|
|
|
|
try (Cursor cursor = db.query("PRAGMA journal_size_limit=" + DB_JOURNAL_SIZE_LIMIT + ";", null)) {
|
|
|
|
|
cursor.moveToNext(); // required
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// https://www.sqlite.org/pragma.html#pragma_cache_size
|
|
|
|
|
Integer cache_size = getCacheSizeKb(context);
|
|
|
|
|
if (cache_size != null) {
|
|
|
|
|