collection_resolver progress

This commit is contained in:
Sascha Kühl
2026-01-30 15:53:31 +01:00
parent bcec740d60
commit 0d3ab09c14
7 changed files with 58 additions and 4 deletions
-1
View File
@@ -64,7 +64,6 @@ public:
friend std::ostream& operator<<(std::ostream &out, const field &col);
private:
template<class Operator>
void process(Operator &op) {
op.on_attribute(name_.c_str(), value_, { value_.size(), type_ } );
@@ -128,8 +128,8 @@ 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) {
using value_type = typename CollectionType::value_type::value_type;
auto resolver = resolver_->collection_resolver<typename CollectionType::value_type>(result_type_, join_column);
auto object_resolver = resolver_->object_resolver<value_type>();
auto resolver = resolver_->collection_resolver<typename CollectionType::value_type>(result_type_, join_column);
std::vector<typename CollectionType::value_type> objects;
if (attr.fetch() == utils::fetch_type::Lazy) {
+2
View File
@@ -44,6 +44,8 @@ public:
[[nodiscard]] const field& at(const std::string &name) const;
[[nodiscard]] const field& at(size_t index) const;
[[nodiscard]] field& at(const std::string &name);
[[nodiscard]] field& at(size_t index);
template<class Type>
std::optional<Type> at(const std::string &name) const {
return at(name).as<Type>();