1#pragma once
2
3#include <Databases/DatabasesCommon.h>
4
5
6namespace Poco { class Logger; }
7
8
9namespace DB
10{
11
12/** A non-persistent database to store temporary data.
13 * It doesn't make any manipulations with filesystem.
14 * All tables are created by calling code.
15 * TODO: Maybe DatabaseRuntime is more suitable class name.
16 */
17class DatabaseMemory : public DatabaseWithOwnTablesBase
18{
19public:
20 DatabaseMemory(const String & name_);
21
22 String getEngineName() const override { return "Memory"; }
23
24 void createTable(
25 const Context & context,
26 const String & table_name,
27 const StoragePtr & table,
28 const ASTPtr & query) override;
29
30 void removeTable(
31 const Context & context,
32 const String & table_name) override;
33
34 ASTPtr getCreateDatabaseQuery() const override;
35};
36
37}
38