diff options
Diffstat (limited to 'libodbcpp/mock.cpp')
-rw-r--r-- | libodbcpp/mock.cpp | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/libodbcpp/mock.cpp b/libodbcpp/mock.cpp deleted file mode 100644 index 58d5afd..0000000 --- a/libodbcpp/mock.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "connection.h" -#include "mock.h" -#include <buffer.h> - -namespace ODBC { - -Mock::Mock(const std::string & masterdb, const std::string & name, const std::vector<boost::filesystem::path> & ss) : - MockServerDatabase(masterdb, name, "odbc") -{ - CreateNewDatabase(); - PlaySchemaScripts(ss); -} - -DB::Connection * -Mock::openConnection() const -{ - return new Connection(stringbf("Driver=postgresql;Database=%s;uid=postgres;servername=/run/postgresql", testDbName)); -} - -Mock::~Mock() -{ - DropDatabase(); -} - -void Mock::DropDatabase() const -{ - master->execute("SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = '" + testDbName + "'"); - MockServerDatabase::DropDatabase(); -} - -} - |