2022-11-11 21:19:58 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IAST.h>
|
|
|
|
#include <Parsers/ASTQueryWithOnCluster.h>
|
2022-11-15 14:49:25 +00:00
|
|
|
#include <Common/SettingsChanges.h>
|
2022-11-11 21:19:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class ASTCreateNamedCollectionQuery : public IAST, public ASTQueryWithOnCluster
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
std::string collection_name;
|
2022-11-15 14:49:25 +00:00
|
|
|
SettingsChanges changes;
|
2023-07-27 06:41:47 +00:00
|
|
|
bool if_not_exists = false;
|
2023-10-17 13:32:34 +00:00
|
|
|
SettingsChanges overridability;
|
2022-11-11 21:19:58 +00:00
|
|
|
|
|
|
|
String getID(char) const override { return "CreateNamedCollectionQuery"; }
|
|
|
|
|
|
|
|
ASTPtr clone() const override;
|
|
|
|
|
|
|
|
void formatImpl(const FormatSettings & s, FormatState & state, FormatStateStacked frame) const override;
|
|
|
|
|
|
|
|
ASTPtr getRewrittenASTWithoutOnCluster(const WithoutOnClusterASTRewriteParams &) const override { return removeOnCluster<ASTCreateNamedCollectionQuery>(clone()); }
|
|
|
|
|
2023-02-02 01:11:16 +00:00
|
|
|
QueryKind getQueryKind() const override { return QueryKind::Create; }
|
|
|
|
|
2022-11-11 21:19:58 +00:00
|
|
|
std::string getCollectionName() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|