pub struct ClickHouseConnection {
pub url: Option<String>,
pub host: Option<String>,
pub http_port: Option<u16>,
pub tls: bool,
pub database: String,
pub user: Option<String>,
pub password: Option<String>,
}Expand description
Shared connection configuration for the ClickHouse source and sink.
The endpoint is specified either as a full url
(http://host:8123) or as a host (+ optional http_port / tls).
Exactly one of the two forms must be provided.
Fields§
§url: Option<String>Full base URL of the ClickHouse HTTP interface, e.g.
"http://localhost:8123". Mutually exclusive with
host. A trailing slash is trimmed.
host: Option<String>Hostname of the ClickHouse server. Mutually exclusive with
url; combined with http_port and
tls to build the base URL.
http_port: Option<u16>HTTP-interface port used with host. Defaults to
DEFAULT_HTTP_PORT (8123).
tls: boolUse https:// instead of http:// when building the base URL from
host. Ignored when url is set. Defaults to
false.
database: StringTarget database. Defaults to DEFAULT_DATABASE ("default").
user: Option<String>ClickHouse user. When set, sent as the X-ClickHouse-User header.
password: Option<String>ClickHouse password. When set, sent as the X-ClickHouse-Key header.
Implementations§
Source§impl ClickHouseConnection
impl ClickHouseConnection
Sourcepub fn from_url(url: impl Into<String>) -> ClickHouseConnection
pub fn from_url(url: impl Into<String>) -> ClickHouseConnection
Build a connection from a full base URL, leaving credentials unset.
Sourcepub fn validate(&self) -> Result<(), FaucetError>
pub fn validate(&self) -> Result<(), FaucetError>
Validate that exactly one of url / host is set.
Sourcepub fn base_url(&self) -> Result<String, FaucetError>
pub fn base_url(&self) -> Result<String, FaucetError>
Resolve the base URL (scheme://host:port, no trailing slash) of the ClickHouse HTTP interface.
Returns FaucetError::Config when neither url nor host is set.
Trait Implementations§
Source§impl Clone for ClickHouseConnection
impl Clone for ClickHouseConnection
Source§fn clone(&self) -> ClickHouseConnection
fn clone(&self) -> ClickHouseConnection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClickHouseConnection
impl Debug for ClickHouseConnection
Source§impl Default for ClickHouseConnection
impl Default for ClickHouseConnection
Source§fn default() -> ClickHouseConnection
fn default() -> ClickHouseConnection
Source§impl<'de> Deserialize<'de> for ClickHouseConnection
impl<'de> Deserialize<'de> for ClickHouseConnection
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ClickHouseConnection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ClickHouseConnection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ClickHouseConnection
impl JsonSchema for ClickHouseConnection
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more