You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kvdb/sqlite: enable incremental auto_vacuum on DB creation
In this commit, we make a change that enables the `auto_vacuum =
incremental` pragma for SQLite databases, but only when the database
file is first created. Incremental auto-vacuum allows SQLite to reclaim
unused space within the database file over time, preventing indefinite
growth.
According to the SQLite documentation, the `auto_vacuum` mode must be
set *before* any tables are created in the database. To achieve this, a
new boolean parameter `isCreate` has been added to the
`NewSqliteBackend` function.
The `createDBDriver` now passes `true` for this parameter, ensuring the
pragma is set during initial database setup. Conversely, `openDBDriver`
passes `false` when opening an existing database, leaving the existing
vacuum mode untouched.
We also, the internal representation of pragma options was refactored to
use a named struct `pragmaOption` for improved clarity.
0 commit comments