ClickHouse/dbms/src/Databases/DatabaseAtomic.h

39 lines
993 B
C++
Raw Normal View History

2019-10-23 13:46:38 +00:00
#pragma once
#include <Databases/DatabasesCommon.h>
#include <Databases/DatabaseOrdinary.h>
namespace DB
{
2019-11-11 11:34:03 +00:00
class DatabaseAtomic : public DatabaseOrdinary
2019-10-23 13:46:38 +00:00
{
public:
DatabaseAtomic(String name_, String metadata_path_, const Context & context_);
String getEngineName() const override { return "Atomic"; }
2019-11-11 14:28:28 +00:00
void renameTable(
const Context & context,
const String & table_name,
IDatabase & to_database,
2019-12-02 19:11:18 +00:00
const String & to_table_name) override;
2019-11-11 14:28:28 +00:00
2019-11-11 11:34:03 +00:00
void attachTable(const String & name, const StoragePtr & table, const String & relative_table_path = {}) override;
StoragePtr detachTable(const String & name) override;
String getDataPath(const String & table_name) const override;
String getDataPath(const ASTCreateQuery & query) const override;
void drop(const Context & /*context*/) override;
private:
//TODO store path in DatabaseWithOwnTables::tables
std::map<String, String> table_name_to_path;
2019-10-23 13:46:38 +00:00
};
}