ClickHouse/src/TableFunctions/TableFunctionRedis.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
992 B
C++
Raw Normal View History

2023-05-17 02:42:52 +00:00
#pragma once
#include <Storages/StorageRedis.h>
#include <TableFunctions/ITableFunction.h>
#include <Storages/ExternalDataSourceConfiguration.h>
namespace DB
{
2023-05-30 12:31:23 +00:00
/* Implements Redis table function.
* Use redis(host:port, key, structure[, db_index[, password[, pool_size]]]);
*/
2023-05-17 02:42:52 +00:00
class TableFunctionRedis : public ITableFunction
{
public:
static constexpr auto name = "redis";
String getName() const override { return name; }
private:
StoragePtr executeImpl(
const ASTPtr & ast_function, ContextPtr context,
const String & table_name, ColumnsDescription cached_columns, bool is_insert_query) const override;
2023-05-17 02:42:52 +00:00
const char * getStorageTypeName() const override { return "Redis"; }
ColumnsDescription getActualTableStructure(ContextPtr context, bool is_insert_query) const override;
2023-05-17 02:42:52 +00:00
void parseArguments(const ASTPtr & ast_function, ContextPtr context) override;
2023-05-30 12:31:23 +00:00
RedisConfiguration configuration;
2023-05-26 02:34:37 +00:00
String structure;
2023-05-30 12:31:23 +00:00
String primary_key;
2023-05-17 02:42:52 +00:00
};
}