summaryrefslogtreecommitdiff
path: root/libpqpp/pq-mock.h
blob: a8d9143cab4589292b01080be185fd2f4c8acab4 (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
#ifndef MOCKPQDATASOURCE_H
#define MOCKPQDATASOURCE_H

#include "pq-connection.h"
#include <filesystem>
#include <mockDatabase.h>
#include <visibility.h>

namespace PQ {
	class DLL_PUBLIC Mock : public DB::MockServerDatabase {
	public:
		Mock(const std::string & master, const std::string & name, const std::vector<std::filesystem::path> & ss);
		~Mock() override;

		SPECIAL_MEMBERS_MOVE_RO(Mock);

		[[nodiscard]] DB::ConnectionPtr openConnection() const override;

	protected:
		void CreateNewDatabase() const override;
		void DropDatabase() const override;
		void SetTablesToUnlogged() const;
		[[nodiscard]] bool hasUnloggedTables() const;
		[[nodiscard]] bool hasCopyToProgram() const;
		const std::filesystem::path tablespacePath;
		const int serverVersion;
	};
}

#endif