blob: 425d048aa65b4cb5c099b0121957b11788e0cba0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#pragma once
#include <Databases/DatabasesCommon.h>
#include <Databases/IDatabase.h>
#include <Storages/IStorage_fwd.h>
#include <mutex>
#include <unordered_set>
namespace Poco
{
class Logger;
}
namespace DB
{
/* Database to store StorageDictionary tables
* automatically creates tables for all dictionaries
*/
class DatabaseDictionary final : public IDatabase, WithContext
{
public:
DatabaseDictionary(const String & name_, ContextPtr context_);
String getEngineName() const override
{
return "Dictionary";
}
bool isTableExist(const String & table_name, ContextPtr context) const override;
StoragePtr tryGetTable(const String & table_name, ContextPtr context) const override;
DatabaseTablesIteratorPtr getTablesIterator(ContextPtr context, const FilterByNameFunction & filter_by_table_name) const override;
bool empty() const override;
ASTPtr getCreateDatabaseQuery() const override;
bool shouldBeEmptyOnDetach() const override { return false; }
void shutdown() override;
protected:
ASTPtr getCreateTableQueryImpl(const String & table_name, ContextPtr context, bool throw_on_error) const override;
private:
Poco::Logger * log;
Tables listTables(const FilterByNameFunction & filter_by_name) const;
};
}
|