2016-10-25 13:49:07 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-03-23 20:46:43 +00:00
|
|
|
#include <Databases/DatabasesCommon.h>
|
2016-10-25 13:49:07 +00:00
|
|
|
|
|
|
|
|
2017-01-21 04:24:28 +00:00
|
|
|
namespace Poco { class Logger; }
|
|
|
|
|
|
|
|
|
2016-10-25 13:49:07 +00:00
|
|
|
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.
|
|
|
|
*/
|
2018-03-23 20:46:43 +00:00
|
|
|
class DatabaseMemory : public DatabaseWithOwnTablesBase
|
2016-10-25 13:49:07 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-11-06 16:05:04 +00:00
|
|
|
DatabaseMemory(const String & name_);
|
2016-10-25 13:49:07 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
String getEngineName() const override { return "Memory"; }
|
2016-10-25 13:49:07 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
void createTable(
|
2017-09-11 12:39:01 +00:00
|
|
|
const Context & context,
|
|
|
|
const String & table_name,
|
|
|
|
const StoragePtr & table,
|
2017-10-25 19:52:32 +00:00
|
|
|
const ASTPtr & query) override;
|
2017-01-23 18:05:07 +00:00
|
|
|
|
2017-09-11 12:39:01 +00:00
|
|
|
void removeTable(
|
|
|
|
const Context & context,
|
|
|
|
const String & table_name) override;
|
2016-10-25 13:49:07 +00:00
|
|
|
|
2020-01-14 11:11:01 +00:00
|
|
|
ASTPtr getCreateDatabaseQuery(const Context & /*context*/) const override;
|
2016-10-25 13:49:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|