refactor: re-order PRAGMA statements (#5140)

The page_size will soon be made configurable with #5135, making this
re-ordering necessary.

When opening SQLite connection, there are specific pragmas set with
commonPragmas.

In particular, PRAGMA journal_mode creates journal file and locks the
page_size; as of this commit, this sets the page size to the default
value of 4096. Coincidentally, the hardcoded page_size was also 4096, so
no issue was noticed.
This commit is contained in:
Vlad
2024-09-20 19:04:10 +01:00
committed by GitHub
parent b6391fe011
commit 0ece395c24

View File

@@ -206,6 +206,12 @@ private:
{
open(*session_, "sqlite", pPath.string());
for (auto const& p : pragma)
{
soci::statement st = session_->prepare << p;
st.execute(true);
}
if (commonPragma)
{
for (auto const& p : *commonPragma)
@@ -214,11 +220,7 @@ private:
st.execute(true);
}
}
for (auto const& p : pragma)
{
soci::statement st = session_->prepare << p;
st.execute(true);
}
for (auto const& sql : initSQL)
{
soci::statement st = session_->prepare << sql;