collection proxy progress

This commit is contained in:
sascha 2026-07-07 08:23:43 +02:00
parent 06f6166f05
commit d4865e4d10
2 changed files with 18 additions and 1 deletions

View File

@ -3,5 +3,14 @@
#include "matador/object/collection.hpp"
#include "matador/object/object.hpp"
#include <iostream>
using namespace matador::object;
TEST_CASE("Test collection", "[collection]") {
collection<int> ints{{1,2,3,4}};
for (auto const& i : ints) {
std::cout << i << std::endl ;
}
}

View File

@ -72,7 +72,7 @@ TEST_CASE_METHOD(QueryFixture, "Test delete builder has many to many", "[query][
.and_then( [&scm] { return scm.attach<ingredient>("ingredients"); } );
REQUIRE(result.is_ok());
const std::vector ingredients {
std::vector ingredients {
make_object<ingredient>(1, "Apple"),
make_object<ingredient>(2, "Strawberry"),
make_object<ingredient>(3, "Pineapple"),
@ -82,12 +82,20 @@ TEST_CASE_METHOD(QueryFixture, "Test delete builder has many to many", "[query][
make_object<ingredient>(7, "Beans")
};
for (auto &i : ingredients) {
i.change_state(object_state::Persistent);
}
std::vector recipes {
make_object<recipe>(1, "Apple Pie", std::vector{ingredients[0], ingredients[3], ingredients[4]}),
make_object<recipe>(2, "Strawberry Cake", std::vector{ingredients[5], ingredients[6]}),
make_object<recipe>(3, "Pineapple Pie", std::vector{ingredients[0], ingredients[1], ingredients[2]})
};
for (auto &r : recipes) {
r.change_state(object_state::Persistent);
}
const auto contexts_by_type = to_contexts_by_name(scm, db->dialect());
delete_query_builder<recipe> dqb(scm, contexts_by_type);