Skip to content

Commit c97cbdb

Browse files
fix: clickhouse https url (#12041) (#12051)
Co-authored-by: lmatz <[email protected]>
1 parent f2c977a commit c97cbdb

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/connector/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ futures = { version = "0.3", default-features = false, features = ["alloc"] }
4949
futures-async-stream = { workspace = true }
5050
glob = "0.3"
5151
google-cloud-pubsub = "0.19"
52+
hyper = "0.14"
53+
hyper-tls = "0.5"
5254
icelake = { workspace = true }
5355
itertools = "0.11"
5456
jsonschema-transpiler = "1.10.0"

src/connector/src/common.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,22 @@ pub struct ClickHouseCommon {
308308
pub table: String,
309309
}
310310

311+
const POOL_IDLE_TIMEOUT: Duration = Duration::from_secs(5);
312+
311313
impl ClickHouseCommon {
312314
pub(crate) fn build_client(&self) -> anyhow::Result<Client> {
313-
let client = Client::default()
315+
use hyper_tls::HttpsConnector;
316+
317+
let https = HttpsConnector::new();
318+
let client = hyper::Client::builder()
319+
.pool_idle_timeout(POOL_IDLE_TIMEOUT)
320+
.build::<_, hyper::Body>(https);
321+
322+
let client = Client::with_http_client(client)
314323
.with_url(&self.url)
315324
.with_user(&self.user)
316-
.with_password(&self.password);
325+
.with_password(&self.password)
326+
.with_database(&self.database);
317327
Ok(client)
318328
}
319329
}

0 commit comments

Comments
 (0)