mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
feat(analytics): Add Clickhouse based analytics (#2988)
Co-authored-by: harsh_sharma_juspay <harsh.sharma@juspay.in> Co-authored-by: Ivor Dsouza <ivor.dsouza@juspay.in> Co-authored-by: Chethan Rao <70657455+Chethan-rao@users.noreply.github.com> Co-authored-by: nain-F49FF806 <126972030+nain-F49FF806@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: akshay.s <akshay.s@juspay.in> Co-authored-by: Gnanasundari24 <118818938+Gnanasundari24@users.noreply.github.com>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use masking::Secret;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, serde::Deserialize)]
|
||||
pub struct Database {
|
||||
pub username: String,
|
||||
pub password: Secret<String>,
|
||||
@ -9,7 +9,41 @@ pub struct Database {
|
||||
pub dbname: String,
|
||||
pub pool_size: u32,
|
||||
pub connection_timeout: u64,
|
||||
pub queue_strategy: bb8::QueueStrategy,
|
||||
pub queue_strategy: QueueStrategy,
|
||||
pub min_idle: Option<u32>,
|
||||
pub max_lifetime: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize, Clone, Copy, Default)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub enum QueueStrategy {
|
||||
#[default]
|
||||
Fifo,
|
||||
Lifo,
|
||||
}
|
||||
|
||||
impl From<QueueStrategy> for bb8::QueueStrategy {
|
||||
fn from(value: QueueStrategy) -> Self {
|
||||
match value {
|
||||
QueueStrategy::Fifo => Self::Fifo,
|
||||
QueueStrategy::Lifo => Self::Lifo,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Database {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
username: String::new(),
|
||||
password: Secret::<String>::default(),
|
||||
host: "localhost".into(),
|
||||
port: 5432,
|
||||
dbname: String::new(),
|
||||
pool_size: 5,
|
||||
connection_timeout: 10,
|
||||
queue_strategy: QueueStrategy::default(),
|
||||
min_idle: None,
|
||||
max_lifetime: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user