pub struct TenantPool { /* private fields */ }Expand description
A storage’s connection pool, for one tenant: every connection it hands out
has the tenant set (TENANT_SETTING), so with row-level security on its
statements see only that tenant’s rows. For a host that keeps tables of its
own in the same database; see PostgresStorage::tenant_pool.
Implementations§
Source§impl TenantPool
impl TenantPool
Sourcepub async fn get(&self) -> Result<PgClient, StorageError>
pub async fn get(&self) -> Result<PgClient, StorageError>
A pooled connection with the tenant set. Use it inside
PostgresStorage::run: a connection belongs to the storage’s
runtime.
Sourcepub fn for_tenant(&self, tenant_id: &str) -> TenantPool
pub fn for_tenant(&self, tenant_id: &str) -> TenantPool
The same pool, for another tenant.
Trait Implementations§
Source§impl Clone for TenantPool
impl Clone for TenantPool
Auto Trait Implementations§
impl !RefUnwindSafe for TenantPool
impl !UnwindSafe for TenantPool
impl Forget for TenantPool
impl Freeze for TenantPool
impl Move for TenantPool
impl Send for TenantPool
impl Sync for TenantPool
impl Unpin for TenantPool
impl UnsafeUnpin for TenantPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more