| 1 | #pragma once | 
|---|
| 2 |  | 
|---|
| 3 | #include <TableFunctions/ITableFunction.h> | 
|---|
| 4 |  | 
|---|
| 5 |  | 
|---|
| 6 | namespace DB | 
|---|
| 7 | { | 
|---|
| 8 |  | 
|---|
| 9 | /* mysql ('host:port', database, table, user, password) - creates a temporary StorageMySQL. | 
|---|
| 10 | * The structure of the table is taken from the mysql query DESCRIBE table. | 
|---|
| 11 | * If there is no such table, an exception is thrown. | 
|---|
| 12 | */ | 
|---|
| 13 | class TableFunctionMySQL : public ITableFunction | 
|---|
| 14 | { | 
|---|
| 15 | public: | 
|---|
| 16 | static constexpr auto name = "mysql"; | 
|---|
| 17 | std::string getName() const override | 
|---|
| 18 | { | 
|---|
| 19 | return name; | 
|---|
| 20 | } | 
|---|
| 21 | private: | 
|---|
| 22 | StoragePtr executeImpl(const ASTPtr & ast_function, const Context & context, const std::string & table_name) const override; | 
|---|
| 23 | }; | 
|---|
| 24 |  | 
|---|
| 25 | } | 
|---|
| 26 |  | 
|---|