From 1deaab116c196ce95aae50a38df18f07d59ff387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20K=C3=BChl?= Date: Thu, 19 Feb 2026 18:17:42 +0100 Subject: [PATCH] set result_type in query_context to specify type --- include/matador/sql/statement.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/matador/sql/statement.hpp b/include/matador/sql/statement.hpp index 40fd7ea..f685a25 100644 --- a/include/matador/sql/statement.hpp +++ b/include/matador/sql/statement.hpp @@ -164,6 +164,7 @@ statement &statement::bind(const Type &obj) { template utils::result, 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 &&value) { auto resolver = statement_proxy_->statement_->query_.resolver->object_resolver(); const auto prototype = value->prototype(); @@ -176,6 +177,7 @@ utils::result, utils::error> statement::fetch() { template utils::result, utils::error> statement::fetch_one() { std::cout << statement_proxy_->sql() << std::endl; + statement_proxy_->statement_->query_.result_type = typeid(Type); auto result = statement_proxy_->fetch(*bindings_); if (!result.is_ok()) { return utils::failure(result.err());