ClickHouse/src/Client/ConnectionParameters.h

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

41 lines
1.2 KiB
C++
Raw Normal View History

2018-08-25 13:55:18 +00:00
#pragma once
2024-04-04 20:58:35 +00:00
#include <Common/SSHWrapper.h>
2018-08-25 13:55:18 +00:00
#include <Core/Protocol.h>
#include <IO/ConnectionTimeouts.h>
2024-04-04 20:58:35 +00:00
#include <string>
2018-08-25 13:55:18 +00:00
namespace Poco::Util
2018-08-25 13:55:18 +00:00
{
class AbstractConfiguration;
2018-08-25 13:55:18 +00:00
}
namespace DB
{
2018-08-25 13:55:18 +00:00
struct ConnectionParameters
{
std::string host;
2019-01-19 23:27:52 +00:00
UInt16 port{};
std::string default_database;
std::string user;
std::string password;
2022-08-03 19:44:08 +00:00
std::string quota_key;
2024-04-04 20:58:35 +00:00
SSHKey ssh_private_key;
2019-01-19 23:27:52 +00:00
Protocol::Secure security = Protocol::Secure::Disable;
Protocol::Compression compression = Protocol::Compression::Enable;
2018-08-25 13:55:18 +00:00
ConnectionTimeouts timeouts;
ConnectionParameters() = default;
ConnectionParameters(const Poco::Util::AbstractConfiguration & config, std::string host);
2022-03-10 19:41:03 +00:00
ConnectionParameters(const Poco::Util::AbstractConfiguration & config, std::string host, std::optional<UInt16> port);
static UInt16 getPortFromConfig(const Poco::Util::AbstractConfiguration & config, std::string connection_host);
2023-06-19 03:57:38 +00:00
/// Ask to enter the user's password if password option contains this value.
/// "\n" is used because there is hardly a chance that a user would use '\n' as password.
static constexpr std::string_view ASK_PASSWORD = "\n";
2018-08-25 13:55:18 +00:00
};
}