query parts progress
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user