refactor: update ClickhouseConfig to use Hostname type for host configuration

This commit is contained in:
Simon Larsen
2025-01-01 16:37:12 +00:00
parent 5ba526d12e
commit 7c16fa7b42

View File

@@ -11,13 +11,16 @@ import {
ClickhouseUsername,
ShouldClickhouseSslEnable,
} from "../EnvironmentConfig";
import Hostname from "../../Types/API/Hostname";
export type ClickHouseClientConfigOptions = NodeClickHouseClientConfigOptions;
const hostProtocol: string = ClickHouseIsHostHttps ? "https" : "http";
const clickhouseHost: Hostname = ClickhouseHost || new Hostname("clickhouse");
const options: ClickHouseClientConfigOptions = {
url: `${hostProtocol}://${ClickhouseHost.toString()}:${ClickhousePort.toNumber()}`,
url: `${hostProtocol}://${clickhouseHost.toString()}:${ClickhousePort.toNumber()}`,
username: ClickhouseUsername,
password: ClickhousePassword,
database: ClickhouseDatabase,