#include "matador/sql/internal/query_result_impl.hpp" #include "matador/sql/interface/query_result_reader.hpp" namespace matador::sql { detail::pk_reader::pk_reader(query_result_reader &reader) : reader_(reader) { } query_result_impl::query_result_impl(std::unique_ptr &&reader, std::vector prototype, const std::shared_ptr& resolver_factory, const size_t column_index) : column_index_(column_index) , prototype_(std::move(prototype)) , reader_(std::move(reader)) , resolver_factory_(resolver_factory) , id_reader_(*reader_) , pk_reader_(*reader_) { } void query_result_impl::on_revision(const char *id, uint64_t &rev) { utils::data_type_traits::read_value(*reader_, id, column_index_++, rev); reader_->read_value(id, column_index_++, rev); } void query_result_impl::on_attribute(const char *id, char *value, const utils::field_attributes &attr) { utils::data_type_traits::read_value(*reader_, id, column_index_++, value, attr.size()); } void query_result_impl::on_attribute(const char *id, std::string &value, const utils::field_attributes &attr) { utils::data_type_traits::read_value(*reader_, id, column_index_++, value, attr.size()); } void query_result_impl::on_attribute(const char *id, utils::value &val, const utils::field_attributes &attr) { reader_->read_value(id, column_index_++, val, attr.size()); } const std::vector &query_result_impl::prototype() const { return prototype_; } }