collection resolver progress

This commit is contained in:
2026-02-01 13:17:40 +01:00
parent c838e9dd7b
commit f9333158e2
21 changed files with 247 additions and 192 deletions
+10 -4
View File
@@ -165,9 +165,12 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects", "[session][f
}
TEST_CASE_METHOD(SessionFixture, "Use session to find all objects with one-to-many lazy relation", "[session][find][one-to-many][eager]") {
auto result = schema.attach<author>("authors")
.and_then( [this] { return schema.attach<book>("books"); } )
// auto result = schema.attach<author>("authors")
// .and_then( [this] { return schema.attach<book>("books"); } )
auto result = schema.attach<book>("books")
.and_then( [this] { return schema.attach<author>("authors"); } )
.and_then([this] { return schema.create(db); } );
REQUIRE(result.is_ok());
schema.initialize_executor(ses);
std::vector authors {
@@ -217,11 +220,14 @@ TEST_CASE_METHOD(SessionFixture, "Use session to find all objects with one-to-ma
}
TEST_CASE_METHOD(SessionFixture, "Use session to find all objects with one-to-many eager relation", "[session][find][one-to-many][eager]") {
auto result = schema.attach<department>("departments")
.and_then( [this] { return schema.attach<employee>("employees"); } )
// auto result = repo.attach<department>("departments")
// .and_then([this] { return repo.attach<employee>("employees"); })
auto result = schema.attach<employee>("employees")
.and_then([this] { return schema.attach<department>("departments"); })
.and_then([this] {
return schema.create(db);
} );
REQUIRE(result.is_ok());
std::vector<std::unique_ptr<department>> departments;
departments.emplace_back(new department{1, "Insurance"});