2011-10-31 17:30:44 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Storages/IStorage.h>
|
2015-09-29 19:19:54 +00:00
|
|
|
#include <common/singleton.h>
|
2011-10-31 17:30:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2012-05-22 19:32:56 +00:00
|
|
|
class Context;
|
2011-10-31 17:30:44 +00:00
|
|
|
|
|
|
|
|
2017-06-06 17:06:14 +00:00
|
|
|
/** Allows you to create a table by the name and parameters of the engine.
|
2017-04-23 07:59:49 +00:00
|
|
|
* In 'columns', 'materialized_columns', etc., Nested data structures must be flattened.
|
2017-06-06 17:06:14 +00:00
|
|
|
* You should subsequently call IStorage::startup method to work with table.
|
2011-10-31 17:30:44 +00:00
|
|
|
*/
|
2015-02-09 09:51:08 +00:00
|
|
|
class StorageFactory : public Singleton<StorageFactory>
|
2011-10-31 17:30:44 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-04-01 07:20:54 +00:00
|
|
|
StoragePtr get(
|
|
|
|
const String & name,
|
|
|
|
const String & data_path,
|
|
|
|
const String & table_name,
|
|
|
|
const String & database_name,
|
|
|
|
Context & local_context,
|
|
|
|
Context & context,
|
|
|
|
ASTPtr & query,
|
|
|
|
NamesAndTypesListPtr columns,
|
|
|
|
const NamesAndTypesList & materialized_columns,
|
|
|
|
const NamesAndTypesList & alias_columns,
|
|
|
|
const ColumnDefaults & column_defaults,
|
|
|
|
bool attach,
|
|
|
|
bool has_force_restore_data_flag) const;
|
2011-10-31 17:30:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|