comparison Framework/PostgreSQL/PostgreSQLResult.cpp @ 429:dbf811b1bb43 pg-transactions

new configuration 'EnableVerboseLogs' to log SQL statements being executed
author Alain Mazy <am@osimis.io>
date Thu, 30 Nov 2023 14:47:23 +0100
parents 3d6886f3e5b3
children 326f8304daa1
comparison
equal deleted inserted replaced
428:4d0bacbd0fba 429:dbf811b1bb43
82 82
83 PostgreSQLResult::PostgreSQLResult(PostgreSQLStatement& statement) : 83 PostgreSQLResult::PostgreSQLResult(PostgreSQLStatement& statement) :
84 position_(0), 84 position_(0),
85 database_(statement.GetDatabase()) 85 database_(statement.GetDatabase())
86 { 86 {
87 if (database_.IsVerboseEnabled())
88 {
89 LOG(INFO) << "PostgreSQL: " << statement.sql_;
90 }
91
87 result_ = statement.Execute(); 92 result_ = statement.Execute();
88 assert(result_ != NULL); // An exception would have been thrown otherwise 93 assert(result_ != NULL); // An exception would have been thrown otherwise
89 94
90 // This is the first call to "Next()" 95 // This is the first call to "Next()"
91 if (PQresultStatus(reinterpret_cast<PGresult*>(result_)) == PGRES_TUPLES_OK) 96 if (PQresultStatus(reinterpret_cast<PGresult*>(result_)) == PGRES_TUPLES_OK)