query/test/backends/QueryFixture.hpp

34 lines
643 B
C++

#ifndef MATADOR_QUERY_FIXTURE_HPP
#define MATADOR_QUERY_FIXTURE_HPP
#include "matador/object/repository.hpp"
#include "matador/sql/connection.hpp"
#include "connection.hpp"
#include <stack>
namespace matador::test {
class QueryFixture {
public:
QueryFixture();
~QueryFixture();
void check_table_exists(const std::string &table_name) const;
void check_table_not_exists(const std::string &table_name) const;
protected:
sql::connection db;
std::stack <std::string> tables_to_drop;
object::repository repo;
private:
void drop_table_if_exists(const std::string &table_name) const;
};
}
#endif //MATADOR_QUERY_FIXTURE_HPP