1 | #pragma once |
---|---|
2 | #include <Common/config.h> |
3 | #include <Interpreters/Context.h> |
4 | #include <Poco/Logger.h> |
5 | #include <Poco/Net/HTTPRequestHandler.h> |
6 | |
7 | #if USE_POCO_SQLODBC || USE_POCO_DATAODBC |
8 | /** The structure of the table is taken from the query "SELECT * FROM table WHERE 1=0". |
9 | * TODO: It would be much better to utilize ODBC methods dedicated for columns description. |
10 | * If there is no such table, an exception is thrown. |
11 | */ |
12 | namespace DB |
13 | { |
14 | class ODBCColumnsInfoHandler : public Poco::Net::HTTPRequestHandler |
15 | { |
16 | public: |
17 | ODBCColumnsInfoHandler(size_t keep_alive_timeout_, std::shared_ptr<Context> context_) |
18 | : log(&Poco::Logger::get("ODBCColumnsInfoHandler")), keep_alive_timeout(keep_alive_timeout_), context(context_) |
19 | { |
20 | } |
21 | |
22 | void handleRequest(Poco::Net::HTTPServerRequest & request, Poco::Net::HTTPServerResponse & response) override; |
23 | |
24 | private: |
25 | Poco::Logger * log; |
26 | size_t keep_alive_timeout; |
27 | std::shared_ptr<Context> context; |
28 | }; |
29 | } |
30 | #endif |
31 |