fix
This commit is contained in:
parent
ec8b7783f3
commit
37d393c1f9
@ -454,7 +454,7 @@ template <typename ctx_t, typename op_t> struct db_where_t final {
|
||||
for (auto &&action : data.actions) {
|
||||
std::visit(overloaded{
|
||||
[&idx, &stream](const comp_data_t &comp) {
|
||||
stream << comp.column_name << comp.op_type
|
||||
stream << '"' << comp.column_name << '"' << comp.op_type
|
||||
<< '?' + std::to_string(++idx);
|
||||
},
|
||||
[&idx, &stream](const n_t &next) {
|
||||
@ -517,7 +517,7 @@ template <typename ctx_t, typename op_t> struct db_where_with_limit_t final {
|
||||
for (auto &&action : data.actions) {
|
||||
std::visit(overloaded{
|
||||
[&idx, &stream](const comp_data_t &comp) {
|
||||
stream << comp.column_name << comp.op_type
|
||||
stream << '"' << comp.column_name << '"' << comp.op_type
|
||||
<< '?' + std::to_string(++idx);
|
||||
},
|
||||
[&idx, &stream](const n_t &next) {
|
||||
|
@ -143,7 +143,7 @@ TEST_F(database_test, db_delete_where_query) {
|
||||
.equals("test2");
|
||||
auto query_str = query.dump();
|
||||
std::cout << query_str << std::endl;
|
||||
EXPECT_STREQ(R"(DELETE FROM "table" WHERE ("column1"=?1 AND "column2"=?2);)",
|
||||
EXPECT_STREQ(R"(DELETE FROM "table" WHERE "column1"=?1 AND "column2"=?2;)",
|
||||
query_str.c_str());
|
||||
}
|
||||
|
||||
@ -185,9 +185,8 @@ TEST_F(database_test, db_select_where_query) {
|
||||
.equals("test2");
|
||||
auto query_str = query.dump();
|
||||
std::cout << query_str << std::endl;
|
||||
EXPECT_STREQ(
|
||||
R"(SELECT * FROM "table" WHERE ("column1"=?1 AND "column2"=?2);)",
|
||||
query_str.c_str());
|
||||
EXPECT_STREQ(R"(SELECT * FROM "table" WHERE "column1"=?1 AND "column2"=?2;)",
|
||||
query_str.c_str());
|
||||
}
|
||||
|
||||
TEST_F(database_test, db_select_columns_query) {
|
||||
@ -202,7 +201,7 @@ TEST_F(database_test, db_select_columns_query) {
|
||||
auto query_str = query.dump();
|
||||
std::cout << query_str << std::endl;
|
||||
EXPECT_STREQ(
|
||||
R"(SELECT column1, column2 FROM "table" WHERE ("column1"=?1 AND "column2"=?2);)",
|
||||
R"(SELECT column1, column2 FROM "table" WHERE "column1"=?1 AND "column2"=?2;)",
|
||||
query_str.c_str());
|
||||
}
|
||||
|
||||
@ -217,7 +216,7 @@ TEST_F(database_test, db_update_query) {
|
||||
auto query_str = query.dump();
|
||||
std::cout << query_str << std::endl;
|
||||
EXPECT_STREQ(
|
||||
R"(UPDATE "table" SET "column1"=?1 WHERE ("column1"=?2 AND "column2"=?3);)",
|
||||
R"(UPDATE "table" SET "column1"=?1 WHERE "column1"=?2 AND "column2"=?3;)",
|
||||
query_str.c_str());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user