ClickHouse/dbms/Parsers/ASTDropQuery.h

48 lines
995 B
C++
Raw Normal View History

2011-11-05 23:31:19 +00:00
#pragma once
#include <Parsers/ASTQueryWithTableAndOutput.h>
2017-04-21 12:39:28 +00:00
#include <Parsers/ASTQueryWithOnCluster.h>
2011-11-05 23:31:19 +00:00
2018-06-09 16:03:07 +00:00
namespace DB
{
2011-11-05 23:31:19 +00:00
2017-05-27 17:27:16 +00:00
/** DROP query
2011-11-05 23:31:19 +00:00
*/
class ASTDropQuery : public ASTQueryWithTableAndOutput, public ASTQueryWithOnCluster
2011-11-05 23:31:19 +00:00
{
public:
2018-04-21 00:35:20 +00:00
enum Kind
{
Drop,
Detach,
Truncate,
};
Kind kind;
bool if_exists{false};
2011-11-05 23:31:19 +00:00
2019-03-11 16:50:31 +00:00
/// Useful if we already have a DDL lock
bool no_ddl_lock{false};
2019-10-08 11:10:29 +00:00
/// We dropping dictionary, so print correct word
bool is_dictionary{false};
2020-03-23 22:28:30 +00:00
/// Same as above
bool is_view{false};
2017-05-27 17:27:16 +00:00
/** Get the text that identifies this element. */
String getID(char) const override;
2018-06-09 16:03:07 +00:00
ASTPtr clone() const override;
2011-12-12 06:15:34 +00:00
ASTPtr getRewrittenASTWithoutOnCluster(const std::string & new_database) const override
{
return removeOnCluster<ASTDropQuery>(clone(), new_database);
}
protected:
2018-06-09 16:03:07 +00:00
void formatQueryImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override;
2011-11-05 23:31:19 +00:00
};
}