mirror of https://github.com/AMT-Cheif/drift.git
Document import/export notes for WAL databases
This commit is contained in:
parent
1a1f53f60d
commit
3e894f9502
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue