Document import/export notes for WAL databases

This commit is contained in:
Simon Binder 2024-01-28 11:56:15 +01:00
parent 1a1f53f60d
commit 3e894f9502
2 changed files with 12 additions and 0 deletions

View File

@ -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.

View File

@ -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