Added a param to show the underlying db queries

This commit is contained in:
emeric
2023-11-17 08:36:20 +01:00
parent d7451e5393
commit 60bb6170e2
2 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -24,6 +24,8 @@
#include "services/database/Session.hpp"
#include "services/database/User.hpp"
#include "utils/IConfig.hpp"
#include "utils/Service.hpp"
#include "utils/Logger.hpp"
namespace Database
@@ -87,7 +89,8 @@ namespace Database
LMS_LOG(DB, INFO) << "Creating connection pool on file " << dbPath.string();
auto connection{ std::make_unique<Connection>(dbPath.string()) };
// connection->setProperty("show-queries", "true");
if (Service<IConfig>::get()->getBool("db-show-queries", false))
connection->setProperty("show-queries", "true");
auto connectionPool{ std::make_unique<Wt::Dbo::FixedSqlConnectionPool>(std::move(connection), connectionCount) };
connectionPool->setTimeout(std::chrono::seconds{ 10 });