added more tests

This commit is contained in:
Sascha Kühl
2025-02-06 16:17:47 +01:00
parent c76aa56440
commit 0b70f5d4ee
68 changed files with 2117 additions and 263 deletions
@@ -8,7 +8,7 @@
#include "matador/sql/interface/query_result_reader.hpp"
#include "matador/sql/column_definition.hpp"
#include "matador/object/attribute_definition.hpp"
#include <memory>
#include <string>
@@ -61,8 +61,8 @@ private:
class query_result_impl
{
public:
query_result_impl(std::unique_ptr<query_result_reader> &&reader, std::vector<column_definition> &&prototype, size_t column_index = 0);
query_result_impl(std::unique_ptr<query_result_reader> &&reader, const std::vector<column_definition> &prototype, size_t column_index = 0);
query_result_impl(std::unique_ptr<query_result_reader> &&reader, std::vector<object::attribute_definition> &&prototype, size_t column_index = 0);
query_result_impl(std::unique_ptr<query_result_reader> &&reader, const std::vector<object::attribute_definition> &prototype, size_t column_index = 0);
template<typename ValueType>
void on_primary_key(const char *id, ValueType &value, std::enable_if_t<std::is_integral_v<ValueType> && !std::is_same_v<bool, ValueType>>* = nullptr)
@@ -149,11 +149,11 @@ public:
return true;
}
[[nodiscard]] const std::vector<column_definition>& prototype() const;
[[nodiscard]] const std::vector<object::attribute_definition>& prototype() const;
protected:
size_t column_index_ = 0;
std::vector<column_definition> prototype_;
std::vector<object::attribute_definition> prototype_;
std::unique_ptr<query_result_reader> reader_;
detail::pk_reader pk_reader_;
};
@@ -161,7 +161,7 @@ protected:
namespace detail {
template<typename ValueType>
void detail::pk_reader::on_primary_key(const char *id, ValueType &value, std::enable_if_t<std::is_integral_v<ValueType> && !std::is_same_v<bool, ValueType>> *)
void pk_reader::on_primary_key(const char *id, ValueType &value, std::enable_if_t<std::is_integral_v<ValueType> && !std::is_same_v<bool, ValueType>> *)
{
utils::data_type_traits<ValueType>::read_value(reader_, id, column_index_++, value);
}