diff --git a/crates/analytics/src/clickhouse.rs b/crates/analytics/src/clickhouse.rs index 8f0d00cd799f..945afb6a9418 100644 --- a/crates/analytics/src/clickhouse.rs +++ b/crates/analytics/src/clickhouse.rs @@ -31,9 +31,13 @@ use crate::{ pub type ClickhouseResult = error_stack::Result; +#[derive(Debug, serde::Deserialize)] +pub struct TenantID(pub String); + #[derive(Clone, Debug)] pub struct ClickhouseClient { pub config: Arc, + pub tenant_id: TenantID } #[derive(Clone, Debug, serde::Deserialize)] diff --git a/crates/analytics/src/sqlx.rs b/crates/analytics/src/sqlx.rs index 133e959d63ba..1b1e397b92bc 100644 --- a/crates/analytics/src/sqlx.rs +++ b/crates/analytics/src/sqlx.rs @@ -28,9 +28,13 @@ use super::{ }, }; +#[derive(Debug, serde::Deserialize)] +pub struct TenantID(pub String); + #[derive(Debug, Clone)] pub struct SqlxClient { pool: Pool, + tenant_id: TenantID } impl Default for SqlxClient { @@ -44,6 +48,7 @@ impl Default for SqlxClient { pool: PgPoolOptions::new() .connect_lazy(&database_url) .expect("SQLX Pool Creation failed"), + TenantID("default") } } }