-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
Loading a larger collection with V16 enabled was failing in openCollection with error 6410, similar to simolus3/drift#876
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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")?; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mikehardy
Contributor
|
||
|
||
db.set_prepared_statement_cache_capacity(50); | ||
|
||
|
I read the linked issue - this looks like the "initial" fix the reporter tried, which worked until data was even larger, and then memory overflows right? doesn't this need a real temp directory
It appears there is an analog to the flutter-specific method getTemporaryDirectory method in the linked issue, and it is in std::env ? https://doc.rust-lang.org/std/env/fn.temp_dir.html#platform-specific-behavior - Android-specific discussion makes me think that might be the best way to make sure we are limited by storage as opposed to memory ?
Or I could be misunderstanding everything