ClickHouse/src/TableFunctions/TableFunctionPostgreSQL.h

36 lines
956 B
C++
Raw Normal View History

2020-11-25 21:06:33 +00:00
#pragma once
#include "config_core.h"
#if USE_LIBPQXX
#include <TableFunctions/ITableFunction.h>
2021-05-08 14:55:53 +00:00
#include <Core/PostgreSQL/PoolWithFailover.h>
2021-09-01 17:59:11 +00:00
#include <Storages/ExternalDataSourceConfiguration.h>
2020-11-25 21:06:33 +00:00
2021-01-11 10:23:44 +00:00
2020-11-25 21:06:33 +00:00
namespace DB
{
class TableFunctionPostgreSQL : public ITableFunction
{
public:
static constexpr auto name = "postgresql";
std::string getName() const override { return name; }
private:
StoragePtr executeImpl(
const ASTPtr & ast_function, ContextPtr context,
2020-11-25 21:06:33 +00:00
const std::string & table_name, ColumnsDescription cached_columns) const override;
const char * getStorageTypeName() const override { return "PostgreSQL"; }
ColumnsDescription getActualTableStructure(ContextPtr context) const override;
void parseArguments(const ASTPtr & ast_function, ContextPtr context) override;
2020-11-25 21:06:33 +00:00
2021-03-27 20:14:02 +00:00
postgres::PoolWithFailoverPtr connection_pool;
2021-09-01 23:17:15 +00:00
std::optional<StoragePostgreSQLConfiguration> configuration;
2020-11-25 21:06:33 +00:00
};
}
#endif