user tenant_id

This commit is contained in:
2025-10-23 16:58:52 +02:00
parent 0ad79c9bc1
commit fbd3aff6d8
11 changed files with 32 additions and 21 deletions
+2 -1
View File
@@ -62,12 +62,13 @@ impl AppState {
}
pub fn db_for_tenant(&self, tenant_id: Uuid) -> AppResult<PgPooledConnection> {
debug_assert!(!tenant_id.is_nil(), "nil tenant_id passed to db_for_tenant");
let mut conn = self.db_unscoped()?;
apply_tenant_guc(&mut conn, tenant_id)?;
Ok(conn)
}
pub fn db_unscoped(&self) -> AppResult<PgPooledConnection> {
pub(crate) fn db_unscoped(&self) -> AppResult<PgPooledConnection> {
self.pool
.get()
.map_err(|err| AppError::internal(format!("database pool error: {err}")))