progress on query compiler

This commit is contained in:
Sascha Kühl
2026-01-22 16:14:42 +01:00
parent b331ef6923
commit 686b1ddb7a
19 changed files with 241 additions and 175 deletions
+7 -5
View File
@@ -24,12 +24,14 @@
#include "../../models/recipe.hpp"
#include "../../models/order.hpp"
#include "../../models/student.hpp"
#include "../../models/model_metas.hpp"
using namespace matador::object;
using namespace matador::query;
using namespace matador::utils;
using namespace matador::sql;
using namespace matador::test;
using namespace matador::query::meta;
TEST_CASE("Create sql query data for entity with eager has one", "[query][entity][builder]") {
using namespace matador::test;
@@ -46,7 +48,7 @@ TEST_CASE("Create sql query data for entity with eager has one", "[query][entity
const auto it = scm.find(typeid(flight));
REQUIRE(it != scm.end());
const auto* col = it->second.table()["id"];
const auto* col = it->second.table()[FLIGHT.id];
REQUIRE(col);
auto data = eqb.build<flight>(*col == _);
@@ -100,7 +102,7 @@ TEST_CASE("Create sql query data for entity with eager belongs to", "[query][ent
const auto it = scm.find(typeid(book));
REQUIRE(it != scm.end());
const auto* col = it->second.table()["id"];
const auto* col = it->second.table()[BOOK.id];
REQUIRE(col);
auto data = eqb.build<book>(*col == _);
@@ -172,7 +174,7 @@ TEST_CASE("Create sql query data for entity with eager has many belongs to", "[q
const auto it = scm.find(typeid(order));
REQUIRE(it != scm.end());
const auto* col = it->second.table()["order_id"];
const auto* col = it->second.table()[ORDER.order_id];
REQUIRE(col);
auto data = eqb.build<order>(*col == _);
@@ -236,7 +238,7 @@ TEST_CASE("Create sql query data for entity with eager many to many", "[query][e
const auto it = scm.find(typeid(ingredient));
REQUIRE(it != scm.end());
const auto* col = it->second.table()["id"];
const auto* col = it->second.table()[INGREDIENT.id];
REQUIRE(col);
auto data = eqb.build<ingredient>(*col == _);
@@ -290,7 +292,7 @@ TEST_CASE("Create sql query data for entity with eager many to many (inverse par
const auto it = scm.find(typeid(course));
REQUIRE(it != scm.end());
const auto* col = it->second.table()["id"];
const auto* col = it->second.table()[COURSE.id];
REQUIRE(col);
auto data = eqb.build<course>(*col == _);