2015-10-21 14:57:10 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Parsers/IParserBase.h>
|
|
|
|
#include <Parsers/CommonParsers.h>
|
|
|
|
#include <Parsers/ASTQueryWithOutput.h>
|
2015-10-21 14:57:10 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2019-01-23 19:23:37 +00:00
|
|
|
/// Parse queries supporting [INTO OUTFILE 'file_name'] [FORMAT format_name] [SETTINGS key1 = value1, key2 = value2, ...] suffix.
|
2015-10-21 14:57:10 +00:00
|
|
|
class ParserQueryWithOutput : public IParserBase
|
|
|
|
{
|
|
|
|
protected:
|
2020-12-16 10:00:21 +00:00
|
|
|
const char * end;
|
2022-04-04 08:09:22 +00:00
|
|
|
bool allow_settings_after_format_in_insert;
|
|
|
|
|
2017-01-11 19:05:46 +00:00
|
|
|
const char * getName() const override { return "Query with output"; }
|
2017-07-10 03:28:12 +00:00
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected) override;
|
2022-04-04 08:09:22 +00:00
|
|
|
|
2020-12-16 10:00:21 +00:00
|
|
|
public:
|
2022-04-04 08:09:22 +00:00
|
|
|
explicit ParserQueryWithOutput(const char * end_, bool allow_settings_after_format_in_insert_ = false)
|
|
|
|
: end(end_)
|
|
|
|
, allow_settings_after_format_in_insert(allow_settings_after_format_in_insert_)
|
|
|
|
{}
|
2015-10-21 14:57:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|