2018-08-19 17:09:54 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-05-08 14:11:19 +00:00
|
|
|
#if USE_ODBC
|
|
|
|
|
|
|
|
# include <Interpreters/Context.h>
|
2021-02-19 12:51:26 +00:00
|
|
|
# include <Server/HTTP/HTTPRequestHandler.h>
|
2020-05-08 14:11:19 +00:00
|
|
|
# include <Common/config.h>
|
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
# include <Poco/Logger.h>
|
|
|
|
|
2018-08-19 20:13:22 +00:00
|
|
|
/** The structure of the table is taken from the query "SELECT * FROM table WHERE 1=0".
|
|
|
|
* TODO: It would be much better to utilize ODBC methods dedicated for columns description.
|
|
|
|
* If there is no such table, an exception is thrown.
|
|
|
|
*/
|
2018-08-19 17:09:54 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
2020-05-08 14:11:19 +00:00
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
class ODBCColumnsInfoHandler : public HTTPRequestHandler
|
2018-08-19 17:09:54 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-04-17 14:40:39 +00:00
|
|
|
ODBCColumnsInfoHandler(size_t keep_alive_timeout_, Context & context_)
|
2018-08-19 17:09:54 +00:00
|
|
|
: log(&Poco::Logger::get("ODBCColumnsInfoHandler")), keep_alive_timeout(keep_alive_timeout_), context(context_)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-02-19 12:51:26 +00:00
|
|
|
void handleRequest(HTTPServerRequest & request, HTTPServerResponse & response) override;
|
2018-08-19 17:09:54 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Poco::Logger * log;
|
|
|
|
size_t keep_alive_timeout;
|
2020-04-17 14:40:39 +00:00
|
|
|
Context & context;
|
2018-08-19 17:09:54 +00:00
|
|
|
};
|
2020-05-08 14:11:19 +00:00
|
|
|
|
2018-08-19 17:09:54 +00:00
|
|
|
}
|
2020-05-08 14:11:19 +00:00
|
|
|
|
2018-08-19 17:09:54 +00:00
|
|
|
#endif
|