session progress
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "SessionFixture.hpp"
|
||||
|
||||
#include "catch2/catch_test_macros.hpp"
|
||||
|
||||
namespace matador::test {
|
||||
|
||||
SessionFixture::SessionFixture()
|
||||
@@ -14,7 +16,7 @@ SessionFixture::~SessionFixture() {
|
||||
|
||||
void SessionFixture::drop_table_if_exists(const std::string &table_name) const {
|
||||
if (ses.table_exists(table_name)) {
|
||||
ses.drop_table(table_name);
|
||||
REQUIRE(ses.drop_table(table_name));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ struct department {
|
||||
unsigned int id{};
|
||||
std::string name;
|
||||
std::vector<object::object_ptr<employee>> employees;
|
||||
object::object_ptr<employee> manager;
|
||||
|
||||
template<typename Operator>
|
||||
void process(Operator &op) {
|
||||
@@ -21,6 +22,7 @@ struct department {
|
||||
field::primary_key(op, "id", id);
|
||||
field::attribute(op, "name", name, 63);
|
||||
field::has_many(op, "employees", employees, "dep_id", utils::fetch_type::EAGER);
|
||||
field::belongs_to(op, "manager_id", manager, utils::fetch_type::EAGER);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user