diff --git a/docs/pages/docs/Examples/existing_databases.md b/docs/pages/docs/Examples/existing_databases.md index 433b33e9..ced32246 100644 --- a/docs/pages/docs/Examples/existing_databases.md +++ b/docs/pages/docs/Examples/existing_databases.md @@ -89,6 +89,16 @@ class MyDatabase extends _$MyDatabase { // ... ``` +### Additional considerations for WAL + +When enabling [write-ahead logging](https://www.sqlite.org/wal.html), sqlite3 won't immediately +store all writes in the main database file. Instead, additional `-wal` and `-shm` files are +created to append new writes that are then periodically synced into the main database file. + +Restoring a WAL database requires copying the `-wal` file as well. +When overwriting an existing WAL database on the device with a database using a different +journaling mode, the `-wal` file should be deleted too. + ## Exporting a database To export a sqlite3 database into a file, you can use the `VACUUM INTO` statement. diff --git a/docs/pages/docs/Platforms/vm.md b/docs/pages/docs/Platforms/vm.md index 825511f1..b866eb4e 100644 --- a/docs/pages/docs/Platforms/vm.md +++ b/docs/pages/docs/Platforms/vm.md @@ -106,6 +106,8 @@ LazyDatabase(() async { }); ``` +Using existing databases is explained in more detail in [this example]({{ '../Examples/existing_databases.md' | pageUrl }}). + ## Used compile options on Android On Android, iOS and macOs, depending on `sqlite3_flutter_libs` will include a custom build of sqlite instead of