2020-04-28 00:56:44 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Core/Block.h>
|
|
|
|
#include <DataStreams/IBlockOutputStream.h>
|
|
|
|
#include <Poco/Data/Session.h>
|
|
|
|
#include <Core/ExternalResultDescription.h>
|
2020-05-14 21:51:07 +00:00
|
|
|
#include <Parsers/IdentifierQuotingStyle.h>
|
2020-04-28 00:56:44 +00:00
|
|
|
|
2020-05-05 23:42:44 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
class ODBCBlockOutputStream : public IBlockOutputStream
|
|
|
|
{
|
2020-04-28 00:56:44 +00:00
|
|
|
public:
|
|
|
|
ODBCBlockOutputStream(Poco::Data::Session && session_, const std::string & remote_database_name_,
|
2020-05-14 21:51:07 +00:00
|
|
|
const std::string & remote_table_name_, const Block & sample_block_, IdentifierQuotingStyle quoting);
|
2020-04-28 00:56:44 +00:00
|
|
|
|
|
|
|
Block getHeader() const override;
|
|
|
|
void write(const Block & block) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Poco::Data::Session session;
|
|
|
|
std::string db_name;
|
|
|
|
std::string table_name;
|
|
|
|
Block sample_block;
|
2020-05-14 21:51:07 +00:00
|
|
|
IdentifierQuotingStyle quoting;
|
2020-04-28 00:56:44 +00:00
|
|
|
|
|
|
|
ExternalResultDescription description;
|
|
|
|
Poco::Logger * log;
|
|
|
|
};
|
|
|
|
|
2020-05-13 18:30:26 +00:00
|
|
|
}
|