summaryrefslogtreecommitdiff
path: root/src/database/postgresql_engine.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-01-14 21:46:49 +0100
committerlouiz’ <louiz@louiz.org>2018-01-14 21:46:49 +0100
commit7e64a2e361adcdbd2fce5ad76051a150b4de062d (patch)
treeb90208a43341ba626fffb42a6a6d63dd126ba561 /src/database/postgresql_engine.cpp
parent3cd649023680bd49f9865fd62474d4db6a9d7c68 (diff)
downloadbiboumi-7e64a2e361adcdbd2fce5ad76051a150b4de062d.tar.gz
biboumi-7e64a2e361adcdbd2fce5ad76051a150b4de062d.tar.bz2
biboumi-7e64a2e361adcdbd2fce5ad76051a150b4de062d.tar.xz
biboumi-7e64a2e361adcdbd2fce5ad76051a150b4de062d.zip
Add a DEBUG_SQL_QUERIES to log info about the executed SQL queries
fix #3324
Diffstat (limited to 'src/database/postgresql_engine.cpp')
-rw-r--r--src/database/postgresql_engine.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/database/postgresql_engine.cpp b/src/database/postgresql_engine.cpp
index 150ca42..984a959 100644
--- a/src/database/postgresql_engine.cpp
+++ b/src/database/postgresql_engine.cpp
@@ -3,6 +3,8 @@
#include <utils/scopeguard.hpp>
+#include <database/query.hpp>
+
#include <database/postgresql_engine.hpp>
#include <database/postgresql_statement.hpp>
@@ -51,6 +53,10 @@ std::set<std::string> PostgresqlEngine::get_all_columns_from_table(const std::st
std::tuple<bool, std::string> PostgresqlEngine::raw_exec(const std::string& query)
{
+#ifdef DEBUG_SQL_QUERIES
+ log_debug("SQL QUERY: ", query);
+ const auto timer = make_sql_timer();
+#endif
PGresult* res = PQexec(this->conn, query.data());
auto sg = utils::make_scope_guard([res](){
PQclear(res);