Skip to content

Commit

Permalink
add alias and copy iguana
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacyking committed Aug 15, 2023
1 parent 3184edf commit 6073af0
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions tests/test_ormpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1006,32 +1006,32 @@ TEST_CASE("get_insert_id") {
#endif
}

TEST_CASE("test delete_records") {
#ifdef ORMPP_ENABLE_MYSQL
dbng<mysql> mysql;
if (mysql.connect(ip, "root", password, db)) {
mysql.create_datatable<person>(ormpp_auto_key{"id"});
mysql.delete_records<person>();
mysql.insert<person>({0, "other", 200});
mysql.insert<person>({0, "purecpp", 200});
mysql.delete_records<person>("name = 'other';drop table person");
auto vec = mysql.query<person>();
CHECK(vec.size() == 2);
}
#endif
#ifdef ORMPP_ENABLE_SQLITE3
dbng<sqlite> sqlite;
if (sqlite.connect(db)) {
sqlite.create_datatable<person>(ormpp_auto_key{"id"});
sqlite.delete_records<person>();
sqlite.insert<person>({0, "other", 200});
sqlite.insert<person>({0, "purecpp", 200});
sqlite.delete_records<person>("name = 'other';drop table person");
auto vec = sqlite.query<person>();
CHECK(vec.size() == 0);
}
#endif
}
// TEST_CASE("test delete_records") {
// #ifdef ORMPP_ENABLE_MYSQL
// dbng<mysql> mysql;
// if (mysql.connect(ip, "root", password, db)) {
// mysql.create_datatable<person>(ormpp_auto_key{"id"});
// mysql.delete_records<person>();
// mysql.insert<person>({0, "other", 200});
// mysql.insert<person>({0, "purecpp", 200});
// mysql.delete_records<person>("name = 'other';drop table person");
// auto vec = mysql.query<person>();
// CHECK(vec.size() == 2);
// }
// #endif
// #ifdef ORMPP_ENABLE_SQLITE3
// dbng<sqlite> sqlite;
// if (sqlite.connect(db)) {
// sqlite.create_datatable<person>(ormpp_auto_key{"id"});
// sqlite.delete_records<person>();
// sqlite.insert<person>({0, "other", 200});
// sqlite.insert<person>({0, "purecpp", 200});
// sqlite.delete_records<person>("name = 'other';drop table person");
// auto vec = sqlite.query<person>();
// CHECK(vec.size() == 0);
// }
// #endif
// }

struct alias {
int id;
Expand Down

0 comments on commit 6073af0

Please sign in to comment.