1 | #pragma once |
---|---|
2 | |
3 | #include <ext/shared_ptr_helper.h> |
4 | #include <Storages/IStorage.h> |
5 | |
6 | |
7 | namespace DB |
8 | { |
9 | |
10 | class Context; |
11 | |
12 | |
13 | /** Implements the system table `tables`, which allows you to get information about all tables. |
14 | */ |
15 | class StorageSystemTables : public ext::shared_ptr_helper<StorageSystemTables>, public IStorage |
16 | { |
17 | friend struct ext::shared_ptr_helper<StorageSystemTables>; |
18 | public: |
19 | std::string getName() const override { return "SystemTables"; } |
20 | std::string getTableName() const override { return name; } |
21 | std::string getDatabaseName() const override { return "system"; } |
22 | |
23 | BlockInputStreams read( |
24 | const Names & column_names, |
25 | const SelectQueryInfo & query_info, |
26 | const Context & context, |
27 | QueryProcessingStage::Enum processed_stage, |
28 | size_t max_block_size, |
29 | unsigned num_streams) override; |
30 | |
31 | private: |
32 | const std::string name; |
33 | |
34 | protected: |
35 | StorageSystemTables(const std::string & name_); |
36 | }; |
37 | |
38 | } |
39 |