Minor db cleanup

This commit is contained in:
emeric
2024-05-08 16:37:43 +02:00
parent c6104c06ea
commit 06b071553c
5 changed files with 14 additions and 27 deletions
+3 -13
View File
@@ -50,12 +50,6 @@ namespace lms::db
prepare();
}
~Connection() override
{
// make use of per-connection usage stats to optimize
optimize();
}
private:
Connection& operator=(const Connection&) = delete;
@@ -72,13 +66,6 @@ namespace lms::db
LMS_LOG(DB, DEBUG, "Setting per-connection settings done!");
}
void optimize()
{
LMS_LOG(DB, DEBUG, "connection close: Running pragma optimize...");
executeSql("PRAGMA optimize");
LMS_LOG(DB, DEBUG, "connection close: pragma optimize complete");
}
std::filesystem::path _dbPath;
};
}
@@ -119,6 +106,9 @@ namespace lms::db
}
}
// For now, multiple databases are not handled
assert(&tlsSession->getDb() == this);
return *tlsSession;
}