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
This commit is contained in:
Damien Elmes 2022-06-10 23:17:41 +10:00
parent 940f1dea06
commit f15e294981

View File

@ -49,6 +49,9 @@ fn open_or_create_collection_db(path: &Path) -> Result<Connection> {
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);