#pragma once #include #include #include #include #include #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 bool ssl_enabled = true; #else bool ssl_enabled = false; #endif std::atomic last_connection_id = 0; std::vector> auth_methods; public: explicit PostgreSQLHandlerFactory(IServer & server_, 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; }; }