fixed compilation

This commit is contained in:
Sascha Kühl
2025-12-16 16:21:09 +01:00
parent 4a19322ef8
commit 9eec5b64fb
10 changed files with 98 additions and 88 deletions
+28 -28
View File
@@ -52,24 +52,24 @@ TEST_CASE("Generate columns for object with has many relation", "[column][genera
auto columns = generator::columns<order>(s, generator::column_generator_options::GenerateAlias);
const auto order_table = std::make_shared<table>("order");
const auto order_details_table = std::make_shared<table>("order_details");
const auto order_table = table("order");
const auto order_details_table = table("order_details");
const std::vector<column> expected_columns = {
{ order_table, "order_id", "c01" },
{ order_table, "order_date", "c02" },
{ order_table, "required_date", "c03" },
{ order_table, "shipped_date", "c04" },
{ order_table, "ship_via", "c05" },
{ order_table, "freight", "c06" },
{ order_table, "ship_name", "c07" },
{ order_table, "ship_address", "c08" },
{ order_table, "ship_city", "c09" },
{ order_table, "ship_region", "c10" },
{ order_table, "ship_postal_code", "c11" },
{ order_table, "ship_country", "c12" },
{ order_details_table, "order_details_id", "c13" },
{ order_details_table, "order_id", "c14" },
{ order_details_table, "product_id", "c15" }
{ &order_table, "order_id", "c01" },
{ &order_table, "order_date", "c02" },
{ &order_table, "required_date", "c03" },
{ &order_table, "shipped_date", "c04" },
{ &order_table, "ship_via", "c05" },
{ &order_table, "freight", "c06" },
{ &order_table, "ship_name", "c07" },
{ &order_table, "ship_address", "c08" },
{ &order_table, "ship_city", "c09" },
{ &order_table, "ship_region", "c10" },
{ &order_table, "ship_postal_code", "c11" },
{ &order_table, "ship_country", "c12" },
{ &order_details_table, "order_details_id", "c13" },
{ &order_details_table, "order_id", "c14" },
{ &order_details_table, "product_id", "c15" }
};
REQUIRE(!columns.empty());
REQUIRE(columns.size() == expected_columns.size());
@@ -87,18 +87,18 @@ TEST_CASE("Generate columns for object with eager foreign key relation", "[colum
.and_then( [&s] { return s.attach<author>("authors"); } );
REQUIRE(result);
const auto books_table = std::make_shared<table>("books");
const auto authors_table = std::make_shared<table>("authors");
const auto books_table = table("books");
const auto authors_table = table("authors");
const std::vector<column> expected_columns {
{ books_table, "id", "c01" },
{ books_table, "title", "c02" },
{ authors_table, "id", "c03" },
{ authors_table, "first_name", "c04" },
{ authors_table, "last_name", "c05" },
{ authors_table, "date_of_birth", "c06" },
{ authors_table, "year_of_birth", "c07" },
{ authors_table, "distinguished", "c08" },
{ books_table, "published_in", "c09" }
{ &books_table, "id", "c01" },
{ &books_table, "title", "c02" },
{ &authors_table, "id", "c03" },
{ &authors_table, "first_name", "c04" },
{ &authors_table, "last_name", "c05" },
{ &authors_table, "date_of_birth", "c06" },
{ &authors_table, "year_of_birth", "c07" },
{ &authors_table, "distinguished", "c08" },
{ &books_table, "published_in", "c09" }
};
auto columns = generator::columns<book>(s, generator::column_generator_options::GenerateAlias);