2013-08-07 13:07:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Parsers/IParserBase.h>
|
|
|
|
#include <Parsers/ExpressionElementParsers.h>
|
2013-08-07 13:07:42 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2016-03-25 11:48:45 +00:00
|
|
|
|
2017-05-27 17:29:55 +00:00
|
|
|
/** Query like this:
|
2017-04-21 12:39:28 +00:00
|
|
|
* ALTER TABLE [db.]name [ON CLUSTER cluster]
|
2017-04-01 07:20:54 +00:00
|
|
|
* [ADD COLUMN col_name type [AFTER col_after],]
|
2017-06-22 11:01:30 +00:00
|
|
|
* [DROP COLUMN col_to_drop, ...]
|
|
|
|
* [CLEAR COLUMN col_to_clear [IN PARTITION partition],]
|
|
|
|
* [MODIFY COLUMN col_to_modify type, ...]
|
2017-04-01 07:20:54 +00:00
|
|
|
* [MODIFY PRIMARY KEY (a, b, c...)]
|
2017-05-24 21:38:56 +00:00
|
|
|
* [DROP|DETACH|ATTACH PARTITION|PART partition, ...]
|
2017-04-01 07:20:54 +00:00
|
|
|
* [FETCH PARTITION partition FROM ...]
|
|
|
|
* [FREEZE PARTITION]
|
2018-02-02 16:02:43 +00:00
|
|
|
* [DELETE WHERE ...]
|
2018-08-07 13:58:11 +00:00
|
|
|
* [UPDATE col_name = expr, ... WHERE ...]
|
2013-08-07 13:07:42 +00:00
|
|
|
*/
|
2018-06-09 15:53:14 +00:00
|
|
|
|
2018-08-07 13:58:11 +00:00
|
|
|
class ParserAlterQuery : public IParserBase
|
2018-06-09 15:53:14 +00:00
|
|
|
{
|
|
|
|
protected:
|
2018-08-07 13:58:11 +00:00
|
|
|
const char * getName() const { return "ALTER query"; }
|
2018-06-09 15:53:14 +00:00
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class ParserAlterCommandList : public IParserBase
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
const char * getName() const { return "a list of ALTER commands"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-08-07 13:58:11 +00:00
|
|
|
class ParserAlterCommand : public IParserBase
|
2013-08-07 13:07:42 +00:00
|
|
|
{
|
|
|
|
protected:
|
2018-08-07 13:58:11 +00:00
|
|
|
const char * getName() const { return "ALTER command"; }
|
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/// Part of the UPDATE command of the form: col_name = expr
|
|
|
|
class ParserAssignment : public IParserBase
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
const char * getName() const { return "column assignment"; }
|
2017-07-10 03:28:12 +00:00
|
|
|
bool parseImpl(Pos & pos, ASTPtr & node, Expected & expected);
|
2013-08-07 13:07:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|