certain pragmas revert to original values rather than roundtripping #1518
Details for the issue
What did you do?
Change pragmas on Edit Pragmas tab or via SQL.
What did you expect to see?
What did you see instead?
Original pragma values under both pathways described above. This affects attempts to specify at least
Auto Vacuum = Incremental
Setting Journal Mode = WAL roundtrips successfully.
Useful extra information
The info below often helps, please fill it out if you're able to. :)
What operating system are you using?
What is your DB4S version?
Did you also
Review of the SQLite documentation at https://www.sqlite.org/pragma.html suggests that, in the case of pragma auto_vacuum the DB Browser may not be issuing the subsequent vacuum command required to change pragma to or from none in a database with existing tables. In this case, a workaround for this issue is to execute both the pragma change and vacuum commands in the Execute SQL tab.
Some experimentation with the current SQLite nuget (https://www.nuget.org/packages/System.Data.SQLite.Core/) suggests pragma temp_store may be scoped to a specific connection rather than to the database and therefore non-durable. It also appears auto_vacuum and journal_mode are sensitive to whether SQLite's caller includes them within a transaction. The SQLite documentation appears unclear on these points.
The text was updated successfully, but these errors were encountered:
As a general thought, it's probably worth having a go with the latest nightly build too:
We've done a fair bit of work in the ~year since our last major release, including improvements to how we work with PRAGMAs.
You're right about calling VACUUM after changing the
And finally for
The temp_store, wal_autocheckpoint and synchronous PRAGMAs are only stored for the current database connection but not saved in the database file. So to fully restore the working environment after closing a database, this commit adds these three PRAGMAs to the project file format. See issue #1518.
I have made two changes now:
Cool, thanks for the quick turnaround (though, admittedly, I missed tomorrow's nightly and therefore picked up yesterday's :-p). Thinking about this from a user interface standpoint, maybe the thing to do for clarity would be to add a couple group boxes to the pragmas tab in order to indicate which settings can be persisted in the database and which are saved in the project? At least in my use case, the SQLite browser serves as development tool for maintaining default databases installed as part of another app. In this circumstance the key consideration is whether I need to add code in the app to provide the same connection settings as the browser does when when loading project settings.