CodeCommitsIssuesPull requestsActionsInsightsSecurity
4364bff3bc805ef630b8cd0bc0c8e55b27cba032

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

programs/odbc-bridge/ColumnInfoHandler.h

35lines · modecode

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