ClickHouse/src/Parsers/ASTDropQuery.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.2 KiB
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;
2014-12-17 15:26:24 +00:00
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};
2022-06-23 07:59:13 +00:00
bool sync{false};
2020-03-20 00:07:52 +00:00
2020-11-30 17:52:32 +00:00
// We detach the object permanently, so it will not be reattached back during server restart.
bool permanently{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 WithoutOnClusterASTRewriteParams & params) const override
{
return removeOnCluster<ASTDropQuery>(clone(), params.default_database);
}
QueryKind getQueryKind() const override { return QueryKind::Drop; }
2021-08-04 14:09:23 +00:00
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
};
}