forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPostgreSQLHandlerFactory.h
More file actions
46 lines (37 loc) · 1.11 KB
/
PostgreSQLHandlerFactory.h
File metadata and controls
46 lines (37 loc) · 1.11 KB
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
36
37
38
39
40
41
42
43
44
45
46
#pragma once
#include <atomic>
#include <memory>
#include <Server/IServer.h>
#include <Server/TCPServerConnectionFactory.h>
#include <Core/PostgreSQLProtocol.h>
#include "config.h"
namespace DB
{
class PostgreSQLHandlerFactory : public TCPServerConnectionFactory
{
private:
IServer & server;
LoggerPtr log;
ProfileEvents::Event read_event;
ProfileEvents::Event write_event;
#if USE_SSL
std::string conf_name;
bool ssl_enabled = true;
#else
bool ssl_enabled = false;
#endif
bool secure_required = false;
std::atomic<Int32> last_connection_id = 0;
std::vector<std::shared_ptr<PostgreSQLProtocol::PGAuthentication::AuthenticationMethod>> auth_methods;
public:
explicit PostgreSQLHandlerFactory(
IServer & server_,
bool secure_required_,
#if USE_SSL
const std::string & conf_name_,
#endif
const ProfileEvents::Event & read_event_ = ProfileEvents::end(),
const ProfileEvents::Event & write_event_ = ProfileEvents::end());
Poco::Net::TCPServerConnection * createConnection(const Poco::Net::StreamSocket & socket, TCPServer & server) override;
};
}