record refactoring

This commit is contained in:
2024-03-17 16:32:08 +01:00
parent 9a02abacea
commit 12919ba372
21 changed files with 390 additions and 118 deletions
+3 -3
View File
@@ -206,13 +206,13 @@ TEST_CASE_METHOD(QueryRecordFixture, "Execute update record statement", "[sessio
for (const auto &i: result) {
REQUIRE(i.size() == 3);
REQUIRE(i.at(0).name() == "id");
REQUIRE(i.at(0).type() == data_type_t::type_long_long);
REQUIRE(i.at(0).is_integer());
REQUIRE(i.at(0).as<long long>() == 7);
REQUIRE(i.at(1).name() == "name");
REQUIRE(i.at(1).type() == data_type_t::type_varchar);
REQUIRE(i.at(1).is_string());
REQUIRE(i.at(1).as<std::string>() == "jane");
REQUIRE(i.at(2).name() == "age");
REQUIRE(i.at(2).type() == matador::sql::data_type_t::type_int);
REQUIRE(i.at(2).is_integer());
REQUIRE(i.at(2).as<int>() == 35);
}
+6 -6
View File
@@ -93,13 +93,13 @@ TEST_CASE_METHOD(QueryFixture, "Execute select statement with where clause", "[s
for (const auto &i: result_record) {
REQUIRE(i.size() == 4);
REQUIRE(i.at(0).name() == "id");
REQUIRE(i.at(0).type() == data_type_t::type_long_long);
REQUIRE(i.at(0).is_integer());
REQUIRE(i.at(0).as<long long>() == george.id);
REQUIRE(i.at(1).name() == "name");
REQUIRE(i.at(1).type() == data_type_t::type_varchar);
REQUIRE(i.at(1).is_string());
REQUIRE(i.at(1).as<std::string>() == george.name);
REQUIRE(i.at(2).name() == "age");
REQUIRE(i.at(2).type() == matador::sql::data_type_t::type_long_long);
REQUIRE(i.at(2).is_integer());
REQUIRE(i.at(2).as<long long>() == george.age);
}
@@ -144,13 +144,13 @@ TEST_CASE_METHOD(QueryFixture, "Execute insert statement", "[session]")
for (const auto &i: result_record) {
REQUIRE(i.size() == 3);
REQUIRE(i.at(0).name() == "id");
REQUIRE(i.at(0).type() == data_type_t::type_long_long);
REQUIRE(i.at(0).is_integer());
REQUIRE(i.at(0).as<unsigned long>() == 7);
REQUIRE(i.at(1).name() == "name");
REQUIRE(i.at(1).type() == data_type_t::type_varchar);
REQUIRE(i.at(1).is_string());
REQUIRE(i.at(1).as<std::string>() == "george");
REQUIRE(i.at(2).name() == "color");
REQUIRE(i.at(2).type() == matador::sql::data_type_t::type_varchar);
REQUIRE(i.at(2).is_string());
REQUIRE(i.at(2).as<std::string>() == "green");
}