ClickHouse/dbms/src/Databases/DatabaseMemory.h

71 lines
2.0 KiB
C++
Raw Normal View History

#pragma once
#include <Databases/DatabasesCommon.h>
namespace Poco { class Logger; }
namespace DB
{
/** A non-persistent database to store temporary data.
* It doesn't make any manipulations with filesystem.
* All tables are created by calling code.
* TODO: Maybe DatabaseRuntime is more suitable class name.
*/
class DatabaseMemory : public DatabaseWithOwnTablesBase
{
public:
DatabaseMemory(String name_);
String getDatabaseName() const override;
String getEngineName() const override { return "Memory"; }
2019-10-10 17:33:01 +00:00
void loadStoredObjects(
Context & context,
bool has_force_restore_data_flag) override;
void createTable(
const Context & context,
const String & table_name,
const StoragePtr & table,
const ASTPtr & query) override;
2019-10-10 17:33:01 +00:00
void createDictionary(
const Context & context,
const String & dictionary_name,
const ASTPtr & query) override;
2019-10-17 13:05:12 +00:00
void attachDictionary(
const String & name,
const Context & context) override;
2019-10-17 13:05:12 +00:00
void removeTable(
const Context & context,
const String & table_name) override;
2019-10-10 17:33:01 +00:00
void removeDictionary(
const Context & context,
2019-10-10 17:33:01 +00:00
const String & dictionary_name) override;
2019-10-17 13:05:12 +00:00
void detachDictionary(
const String & name,
const Context & context) override;
2019-10-17 13:05:12 +00:00
2019-10-10 17:33:01 +00:00
time_t getObjectMetadataModificationTime(const Context & context, const String & table_name) override;
2018-03-23 19:56:24 +00:00
ASTPtr getCreateTableQuery(const Context & context, const String & table_name) const override;
2019-10-10 17:33:01 +00:00
ASTPtr getCreateDictionaryQuery(const Context & context, const String & table_name) const override;
2018-03-23 19:56:24 +00:00
ASTPtr tryGetCreateTableQuery(const Context &, const String &) const override { return nullptr; }
2019-10-10 17:33:01 +00:00
ASTPtr tryGetCreateDictionaryQuery(const Context &, const String &) const override { return nullptr; }
ASTPtr getCreateDatabaseQuery(const Context & context) const override;
private:
Poco::Logger * log;
};
}