query/test/backends/SessionFixture.cpp

22 lines
457 B
C++

#include "SessionFixture.hpp"
#include "catch2/catch_test_macros.hpp"
namespace matador::test {
SessionFixture::SessionFixture()
: pool(connection::dns, 4)
, ses({bus, pool}) {}
SessionFixture::~SessionFixture() {
const auto result = ses.drop_schema();
REQUIRE(result.is_ok());
}
void SessionFixture::drop_table_if_exists(const std::string &table_name) const {
if (ses.table_exists(table_name)) {
REQUIRE(ses.drop_table(table_name));
}
}
}