query parts progress

This commit is contained in:
2024-02-22 07:29:17 +01:00
parent b255ae22b4
commit 16d7fd7e76
10 changed files with 43 additions and 21 deletions
+2 -2
View File
@@ -232,8 +232,8 @@ TEST_CASE_METHOD(QueryFixture, " Select statement with foreign key and join_left
REQUIRE(f.airplane->id == 1);
auto result = db.query().select({"f.id", "ap.brand", "ap.model", "f.pilot_name"})
.from("flight", "f")
.join_left("airplane", "ap")
.from({"flight", "f"})
.join_left({"airplane", "ap"})
.on("f.airplane_id"_col == "ap.id"_col)
.order_by("f.id").asc()
.fetch_all();
+3 -2
View File
@@ -46,6 +46,7 @@ private:
TEST_CASE_METHOD(StatementTestFixture, " Create prepared statement", "[statement]")
{
table ap{"airplane"};
SECTION("Insert with prepared statement and placeholder") {
auto stmt = db.query().insert()
.into<airplane>("airplane")
@@ -57,7 +58,7 @@ TEST_CASE_METHOD(StatementTestFixture, " Create prepared statement", "[statement
stmt.reset();
}
auto result = db.query().select<airplane>().from("airplane").fetch_all<airplane>();
auto result = db.query().select<airplane>().from(ap).fetch_all<airplane>();
size_t index{0};
for (const auto &i: result) {
@@ -73,7 +74,7 @@ TEST_CASE_METHOD(StatementTestFixture, " Create prepared statement", "[statement
REQUIRE(res == 1);
}
auto stmt = db.query().select<airplane>().from("airplane").where("brand"_col == _).prepare();
auto stmt = db.query().select<airplane>().from(ap).where("brand"_col == _).prepare();
stmt.bind(0, "Airbus");