mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
feat(multitenancy): add tenant_id as a field for data pipeline and support individual database for clickhouse (#4867)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Arun Raj M <jarnura47@gmail.com> Co-authored-by: Sampras Lopes <sampras.lopes@juspay.in>
This commit is contained in:
@ -35,6 +35,7 @@ pub type ClickhouseResult<T> = error_stack::Result<T, ClickhouseError>;
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ClickhouseClient {
|
||||
pub config: Arc<ClickhouseConfig>,
|
||||
pub database: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, serde::Deserialize)]
|
||||
@ -42,7 +43,6 @@ pub struct ClickhouseConfig {
|
||||
username: String,
|
||||
password: Option<String>,
|
||||
host: String,
|
||||
database_name: String,
|
||||
}
|
||||
|
||||
impl Default for ClickhouseConfig {
|
||||
@ -51,7 +51,6 @@ impl Default for ClickhouseConfig {
|
||||
username: "default".to_string(),
|
||||
password: None,
|
||||
host: "http://localhost:8123".to_string(),
|
||||
database_name: "default".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -63,7 +62,7 @@ impl ClickhouseClient {
|
||||
let params = CkhQuery {
|
||||
date_time_output_format: String::from("iso"),
|
||||
output_format_json_quote_64bit_integers: 0,
|
||||
database: self.config.database_name.clone(),
|
||||
database: self.database.clone(),
|
||||
};
|
||||
let response = client
|
||||
.post(&self.config.host)
|
||||
|
||||
Reference in New Issue
Block a user