From f15e294981bb7bfda8aad0136cc7b82d724a2467 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 10 Jun 2022 23:17:41 +1000 Subject: [PATCH] Fix collection load failure on Android Loading a larger collection with V16 enabled was failing in openCollection with error 6410, similar to https://github.com/simolus3/drift/issues/876 --- rslib/src/storage/sqlite.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rslib/src/storage/sqlite.rs b/rslib/src/storage/sqlite.rs index 58e3c2cfe..95a25dd92 100644 --- a/rslib/src/storage/sqlite.rs +++ b/rslib/src/storage/sqlite.rs @@ -49,6 +49,9 @@ fn open_or_create_collection_db(path: &Path) -> Result { db.pragma_update(None, "cache_size", &(-40 * 1024))?; db.pragma_update(None, "legacy_file_format", &false)?; db.pragma_update(None, "journal_mode", &"wal")?; + // Android has no /tmp folder, and fails in the default config. + #[cfg(target_os = "android")] + db.pragma_update(None, "temp_store", &"memory")?; db.set_prepared_statement_cache_capacity(50);