Added a param to show the underlying db queries
This commit is contained in:
@@ -12,6 +12,8 @@ log-file = "";
|
||||
access-log-file = "";
|
||||
# Logger configuration, see log-config in https://webtoolkit.eu/wt/doc/reference/html/overview.html#config_general
|
||||
log-config = "* -debug -info:WebRequest";
|
||||
# Output db queries on stdout
|
||||
db-show-queries = false;
|
||||
|
||||
# Listen port/addr of the web server
|
||||
listen-port = 5082;
|
||||
|
||||
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user