31 lines
743 B
C++
31 lines
743 B
C++
#ifndef QUERY_DUMMYCONNECTION_HPP
|
|
#define QUERY_DUMMYCONNECTION_HPP
|
|
|
|
#include "matador/sql/connection_info.hpp"
|
|
|
|
namespace matador::test {
|
|
|
|
class DummyConnection
|
|
{
|
|
public:
|
|
explicit DummyConnection(sql::connection_info info);
|
|
explicit DummyConnection(const std::string& dns);
|
|
DummyConnection(const DummyConnection &x) = default;
|
|
DummyConnection& operator=(const DummyConnection &x) = default;
|
|
DummyConnection(DummyConnection &&x) noexcept = default;
|
|
DummyConnection& operator=(DummyConnection &&x) noexcept = default;
|
|
~DummyConnection() = default;
|
|
|
|
void open();
|
|
void close();
|
|
[[nodiscard]] bool is_open() const;
|
|
|
|
private:
|
|
sql::connection_info connection_info_;
|
|
|
|
bool is_open_{};
|
|
};
|
|
|
|
}
|
|
#endif //QUERY_DUMMYCONNECTION_HPP
|