Skip to content

Commit

Permalink
fix: better documentation for auto_vacuum
Browse files Browse the repository at this point in the history
Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
  • Loading branch information
jasonish and abonander committed May 15, 2024
1 parent 7d5be21 commit fbc253d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sqlx-sqlite/src/options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ impl SqliteConnectOptions {
// https://www.sqlite.org/wal.html#use_of_wal_without_shared_memory
pragmas.insert("locking_mode".into(), None);

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

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

0 comments on commit fbc253d

Please sign in to comment.