blob: 6b5f5da550951c0b3bcaef0cd27bd262d269c215 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#include "odbc-mock.h"
#include "connection_fwd.h"
#include "mockDatabase.h"
#include "odbc-connection.h"
#include <compileTimeFormatter.h>
#include <memory>
namespace ODBC {
Mock::Mock(const std::string & b, const std::string & masterdb, const std::string & name,
const std::vector<std::filesystem::path> & ss) :
MockServerDatabase(b + ";" + masterdb, name, "odbc"),
base(b)
{
Mock::CreateNewDatabase();
PlaySchemaScripts(ss);
}
AdHocFormatter(MockConnStr, "%?;Database=%?");
DB::ConnectionPtr
Mock::openConnection() const
{
return std::make_shared<Connection>(MockConnStr::get(base, testDbName));
}
Mock::~Mock()
{
Mock::DropDatabase();
}
void
Mock::DropDatabase() const
{
MockServerDatabase::DropDatabase();
}
}
|