collection_resolver progress
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
#ifndef MATADOR_BASIC_SCHEMA_HPP
|
||||
#define MATADOR_BASIC_SCHEMA_HPP
|
||||
|
||||
#include "matador/object/repository.hpp"
|
||||
#include <memory>
|
||||
#include <typeindex>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "matador/sql/internal/collection_resolver_producer.hpp"
|
||||
#include "matador/sql/producer_resolver_factory.hpp"
|
||||
#include "matador/object/repository.hpp"
|
||||
|
||||
#include "matador/query/table.hpp"
|
||||
|
||||
#include <unordered_map>
|
||||
#include <memory>
|
||||
#include <typeindex>
|
||||
#include "matador/sql/internal/collection_resolver_producer.hpp"
|
||||
#include "matador/sql/internal/object_resolver_producer.hpp"
|
||||
#include "matador/sql/producer_resolver_factory.hpp"
|
||||
|
||||
namespace matador::query {
|
||||
class schema_node final {
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
}
|
||||
|
||||
const auto prototype = result.value()->prototype();
|
||||
auto resolver = exec.resolver_factory()->resolver<Type>();
|
||||
auto resolver = exec.resolver()->object_resolver<Type>();
|
||||
return utils::ok(sql::query_result<Type>(result.release(), resolver, [prototype] {
|
||||
return sql::detail::create_prototype<Type>(prototype);
|
||||
}));
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
}
|
||||
|
||||
const auto prototype = result.value()->prototype();
|
||||
auto resolver = exec.resolver_factory()->resolver<Type>();
|
||||
auto resolver = exec.resolver()->object_resolver<Type>();
|
||||
auto objects = sql::query_result<Type>(result.release(), resolver, [prototype] {
|
||||
return sql::detail::create_prototype<Type>(prototype);
|
||||
});
|
||||
|
||||
@@ -193,7 +193,6 @@ public:
|
||||
|
||||
template<class CollectionType>
|
||||
void on_has_many(const char * /*id*/, CollectionType &cont, const char *join_column, const utils::foreign_attributes &attr, std::enable_if_t<object::is_object_ptr<typename CollectionType::value_type>::value> * = nullptr) {
|
||||
// SELECT id FROM books where author_id = ?;
|
||||
const auto it = schema_.find(typeid(typename CollectionType::value_type::value_type));
|
||||
if (it == schema_.end()) {
|
||||
throw query_builder_exception{query_build_error::UnknownType};
|
||||
|
||||
Reference in New Issue
Block a user