refactored result that an overload for void doesn't need to exist

This commit is contained in:
2026-07-30 12:33:24 +02:00
parent 78b30f9742
commit c880728093
7 changed files with 127 additions and 95 deletions
+2 -1
View File
@@ -171,7 +171,8 @@ template<class Type>
utils::result<query_result<Type>, utils::error> statement::fetch() {
std::cout << statement_proxy_->sql() << std::endl;
statement_proxy_->statement_->query_.result_type = typeid(Type);
return statement_proxy_->fetch(*bindings_).and_then([this](std::unique_ptr<query_result_impl> &&value) {
return statement_proxy_->fetch(*bindings_)
.and_then([this](std::unique_ptr<query_result_impl> &&value) -> utils::result<query_result<Type>, utils::error> {
auto resolver = statement_proxy_->statement_->query_.resolver->object_resolver<Type>();
const auto prototype = value->prototype();
return utils::ok(query_result<Type>(std::forward<decltype(value)>(value), resolver, [prototype] {