Updated AndroidX sqlite/work

pull/210/head
M66B 2 years ago
parent 0804c62971
commit 428aeac380

@ -365,11 +365,11 @@ dependencies {
def lifecycle_version = "2.5.1" // 2.6.0-alpha03 def lifecycle_version = "2.5.1" // 2.6.0-alpha03
def lifecycle_extensions_version = "2.2.0" def lifecycle_extensions_version = "2.2.0"
def room_version = "2.4.3" // 2.5.0-beta01 def room_version = "2.4.3" // 2.5.0-beta01
def sqlite_version = "2.2.0" // 2.3.0-beta01 def sqlite_version = "2.3.0-beta01"
def requery_version = "3.39.2" def requery_version = "3.39.2"
def paging_version = "2.1.2" // 3.2.0-alpha03 def paging_version = "2.1.2" // 3.2.0-alpha03
def preference_version = "1.2.0" def preference_version = "1.2.0"
def work_version = "2.8.0-alpha04" // 2.8.0-beta01 def work_version = "2.8.0-beta01"
def exif_version = "1.3.5" def exif_version = "1.3.5"
def biometric_version = "1.2.0-alpha05" def biometric_version = "1.2.0-alpha05"
def billingclient_version = "4.1.0" def billingclient_version = "4.1.0"

@ -424,7 +424,7 @@ public abstract class DB extends RoomDatabase {
boolean sqlite_auto_vacuum = prefs.getBoolean("sqlite_auto_vacuum", false); boolean sqlite_auto_vacuum = prefs.getBoolean("sqlite_auto_vacuum", false);
String mode = (sqlite_auto_vacuum ? "FULL" : "INCREMENTAL"); String mode = (sqlite_auto_vacuum ? "FULL" : "INCREMENTAL");
Log.i("Set PRAGMA auto_vacuum=" + mode); Log.i("Set PRAGMA auto_vacuum=" + mode);
try (Cursor cursor = db.query("PRAGMA auto_vacuum=" + mode + ";", null)) { try (Cursor cursor = db.query("PRAGMA auto_vacuum=" + mode + ";")) {
cursor.moveToNext(); // required cursor.moveToNext(); // required
} }
@ -432,12 +432,12 @@ public abstract class DB extends RoomDatabase {
boolean sqlite_sync_extra = prefs.getBoolean("sqlite_sync_extra", true); boolean sqlite_sync_extra = prefs.getBoolean("sqlite_sync_extra", true);
String sync = (sqlite_sync_extra ? "EXTRA" : "NORMAL"); String sync = (sqlite_sync_extra ? "EXTRA" : "NORMAL");
Log.i("Set PRAGMA synchronous=" + sync); Log.i("Set PRAGMA synchronous=" + sync);
try (Cursor cursor = db.query("PRAGMA synchronous=" + sync + ";", null)) { try (Cursor cursor = db.query("PRAGMA synchronous=" + sync + ";")) {
cursor.moveToNext(); // required cursor.moveToNext(); // required
} }
Log.i("Set PRAGMA journal_size_limit=" + DB_JOURNAL_SIZE_LIMIT); 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)) { try (Cursor cursor = db.query("PRAGMA journal_size_limit=" + DB_JOURNAL_SIZE_LIMIT + ";")) {
cursor.moveToNext(); // required cursor.moveToNext(); // required
} }
@ -446,7 +446,7 @@ public abstract class DB extends RoomDatabase {
if (cache_size != null) { if (cache_size != null) {
cache_size = -cache_size; // kibibytes cache_size = -cache_size; // kibibytes
Log.i("Set PRAGMA cache_size=" + cache_size); Log.i("Set PRAGMA cache_size=" + cache_size);
try (Cursor cursor = db.query("PRAGMA cache_size=" + cache_size + ";", null)) { try (Cursor cursor = db.query("PRAGMA cache_size=" + cache_size + ";")) {
cursor.moveToNext(); // required cursor.moveToNext(); // required
} }
} }
@ -454,7 +454,7 @@ public abstract class DB extends RoomDatabase {
// Prevent long running operations from getting an exclusive lock // Prevent long running operations from getting an exclusive lock
// https://www.sqlite.org/pragma.html#pragma_cache_spill // https://www.sqlite.org/pragma.html#pragma_cache_spill
Log.i("Set PRAGMA cache_spill=0"); Log.i("Set PRAGMA cache_spill=0");
try (Cursor cursor = db.query("PRAGMA cache_spill=0;", null)) { try (Cursor cursor = db.query("PRAGMA cache_spill=0;")) {
cursor.moveToNext(); // required cursor.moveToNext(); // required
} }

Loading…
Cancel
Save