Skip to content

Commit 1c200bc

Browse files
jasonishabonander
andauthored
fix: better documentation for auto_vacuum
Co-authored-by: Austin Bonander <[email protected]>
1 parent e9fd0ac commit 1c200bc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sqlx-sqlite/src/options/mod.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,10 @@ impl SqliteConnectOptions {
162162
// https://www.sqlite.org/wal.html#use_of_wal_without_shared_memory
163163
pragmas.insert("locking_mode".into(), None);
164164

165-
// The `auto_vacuum` pragma defaults to NONE, but needs to
166-
// come before before `journal_mode`.
165+
// `auto_vacuum` needs to be executed before `journal_mode`, if set.
166+
//
167+
// Otherwise, a change in the `journal_mode` setting appears to mark even an empty database as dirty,
168+
// requiring a `vacuum` command to be executed to actually apply the new `auto_vacuum` setting.
167169
pragmas.insert("auto_vacuum".into(), None);
168170

169171
// Don't set `journal_mode` unless the user requested it.

0 commit comments

Comments
 (0)