2011-10-30 05:19:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-06-10 19:22:49 +00:00
|
|
|
#include <Formats/FormatSettings.h>
|
|
|
|
#include <Formats/IRowOutputStream.h>
|
2011-10-30 05:19:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2016-08-13 01:57:35 +00:00
|
|
|
class WriteBuffer;
|
|
|
|
|
2011-10-30 05:19:41 +00:00
|
|
|
|
2017-05-13 22:19:04 +00:00
|
|
|
/** A stream for outputting data in the VALUES format (as in the INSERT request).
|
2011-10-30 05:19:41 +00:00
|
|
|
*/
|
|
|
|
class ValuesRowOutputStream : public IRowOutputStream
|
|
|
|
{
|
|
|
|
public:
|
2018-06-08 01:51:55 +00:00
|
|
|
ValuesRowOutputStream(WriteBuffer & ostr_, const FormatSettings & format_settings);
|
2011-10-30 05:19:41 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
void writeField(const IColumn & column, const IDataType & type, size_t row_num) override;
|
|
|
|
void writeFieldDelimiter() override;
|
|
|
|
void writeRowStartDelimiter() override;
|
|
|
|
void writeRowEndDelimiter() override;
|
|
|
|
void writeRowBetweenDelimiter() override;
|
|
|
|
void flush() override;
|
2014-08-14 20:27:41 +00:00
|
|
|
|
2011-10-30 05:19:41 +00:00
|
|
|
private:
|
2017-04-01 07:20:54 +00:00
|
|
|
WriteBuffer & ostr;
|
2018-06-08 01:51:55 +00:00
|
|
|
const FormatSettings format_settings;
|
2011-10-30 05:19:41 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|