enabled use of sql_logger in statement.cpp
This commit is contained in:
parent
621c3703fd
commit
b2d5db2702
|
|
@ -1,6 +1,5 @@
|
|||
#include "matador/sql/statement.hpp"
|
||||
#include "matador/sql/record.hpp"
|
||||
#include "matador/sql/field.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
|
@ -62,13 +61,12 @@ utils::result<query_result<record>, utils::error> statement::fetch() const {
|
|||
if (!result.is_ok()) {
|
||||
return utils::failure(result.err());
|
||||
}
|
||||
// logger_.info(statement_->query_.sql);
|
||||
logger_->on_fetch(statement_proxy_->sql());
|
||||
const auto prototype = result.value()->prototype();
|
||||
return utils::ok(query_result<record>(std::move(*result), prototype));
|
||||
}
|
||||
|
||||
utils::result<std::optional<record>, utils::error> statement::fetch_one() const {
|
||||
// logger_.info(statement_->query_.sql);
|
||||
auto result = statement_proxy_->fetch(*bindings_);
|
||||
if (!result.is_ok()) {
|
||||
return utils::failure(result.err());
|
||||
|
|
@ -80,7 +78,7 @@ utils::result<std::optional<record>, utils::error> statement::fetch_one() const
|
|||
if (first == records.end()) {
|
||||
return utils::ok(std::optional<record>{std::nullopt});
|
||||
}
|
||||
|
||||
logger_->on_fetch(statement_proxy_->sql());
|
||||
return utils::ok(std::optional{first.release()});
|
||||
}
|
||||
|
||||
|
|
@ -101,8 +99,8 @@ utils::result<std::unique_ptr<query_result_impl>, utils::error> statement::fetch
|
|||
if (!result.is_ok()) {
|
||||
return utils::failure(result.err());
|
||||
}
|
||||
logger_->on_fetch(statement_proxy_->sql());
|
||||
|
||||
// logger_.info(statement_->query_.sql);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue