ClickHouse/dbms/src/Storages/StorageFactory.h
Alexey Zatelepin 01c39dcf1c fix CREATE TABLE bugs and idiosyncrasies: [#CLICKHOUSE-3000]
* fix segfault on ATTACH MATERIALIZED VIEW
* allow only TEMPORARY TABLEs (not databases or views)
* forbid choosing ENGINE for TEMPORARY tables
* fix segfault on CREATE TABLE t1 AS t2 where t2 is a View
2017-10-26 07:53:52 +03:00

36 lines
912 B
C++

#pragma once
#include <Storages/IStorage.h>
#include <ext/singleton.h>
namespace DB
{
class Context;
/** Allows you to create a table by the name and parameters of the engine.
* In 'columns', 'materialized_columns', etc., Nested data structures must be flattened.
* You should subsequently call IStorage::startup method to work with table.
*/
class StorageFactory : public ext::singleton<StorageFactory>
{
public:
StoragePtr get(
ASTCreateQuery & query,
const String & data_path,
const String & table_name,
const String & database_name,
Context & local_context,
Context & context,
NamesAndTypesListPtr columns,
const NamesAndTypesList & materialized_columns,
const NamesAndTypesList & alias_columns,
const ColumnDefaults & column_defaults,
bool attach,
bool has_force_restore_data_flag) const;
};
}