| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <Interpreters/IExternalLoaderConfigRepository.h> |
| 4 | #include <Databases/IDatabase.h> |
| 5 | #include <Interpreters/Context.h> |
| 6 | |
| 7 | namespace DB |
| 8 | { |
| 9 | |
| 10 | /// Repository from database, which stores dictionary definitions on disk. |
| 11 | /// Tracks update time and existance of .sql files through IDatabase. |
| 12 | class ExternalLoaderDatabaseConfigRepository : public IExternalLoaderConfigRepository |
| 13 | { |
| 14 | public: |
| 15 | ExternalLoaderDatabaseConfigRepository(IDatabase & database_, const Context & context_); |
| 16 | |
| 17 | const std::string & getName() const override { return name; } |
| 18 | |
| 19 | std::set<std::string> getAllLoadablesDefinitionNames() override; |
| 20 | |
| 21 | bool exists(const std::string & loadable_definition_name) override; |
| 22 | |
| 23 | Poco::Timestamp getUpdateTime(const std::string & loadable_definition_name) override; |
| 24 | |
| 25 | LoadablesConfigurationPtr load(const std::string & loadable_definition_name) override; |
| 26 | |
| 27 | private: |
| 28 | const String name; |
| 29 | IDatabase & database; |
| 30 | Context context; |
| 31 | }; |
| 32 | |
| 33 | } |
| 34 |