mirror of https://github.com/AMT-Cheif/drift.git
Also apply temp directory workaround on iOS
This commit is contained in:
parent
ca4e376c8b
commit
a4938abb19
|
@ -53,14 +53,15 @@ LazyDatabase _openConnection() {
|
||||||
// Also work around limitations on old Android versions
|
// Also work around limitations on old Android versions
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
|
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
|
||||||
|
|
||||||
final cachebase = (await getTemporaryDirectory()).path;
|
|
||||||
|
|
||||||
// We can't access /tmp on Android, which sqlite3 would try by default.
|
|
||||||
// Explicitly tell it about the correct temporary directory.
|
|
||||||
sqlite3.tempDirectory = cachebase;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sqlite3 pick a more suitable location for temporary files - the
|
||||||
|
// one from the system may be inaccessible due to sandboxing.
|
||||||
|
final cachebase = (await getTemporaryDirectory()).path;
|
||||||
|
// We can't access /tmp on Android, which sqlite3 would try by default.
|
||||||
|
// Explicitly tell it about the correct temporary directory.
|
||||||
|
sqlite3.tempDirectory = cachebase;
|
||||||
|
|
||||||
return NativeDatabase.createInBackground(file);
|
return NativeDatabase.createInBackground(file);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue