mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 03:52:15 +00:00
28 lines
594 B
C++
28 lines
594 B
C++
#pragma once
|
|
|
|
#include <DB/Storages/IStorage.h>
|
|
#include <DB/Interpreters/Context.h>
|
|
|
|
namespace DB
|
|
{
|
|
class ASTIdentifier;
|
|
|
|
/** Позволяет добавить или удалить столбец в таблице.
|
|
*/
|
|
class InterpreterAlterQuery
|
|
{
|
|
public:
|
|
InterpreterAlterQuery(ASTPtr query_ptr_, Context & context_);
|
|
|
|
void execute();
|
|
|
|
private:
|
|
void dropColumnFromAST(const ASTIdentifier & drop_column, ASTs & columns);
|
|
void addColumnToAST(StoragePtr table, ASTs & columns, const ASTPtr & add_column_ptr, const ASTPtr & after_column_ptr);
|
|
|
|
ASTPtr query_ptr;
|
|
|
|
Context context;
|
|
};
|
|
}
|