pub struct TenantProvisioner { /* private fields */ }Expand description
Tenant provisioner for setting up new tenants
Implementations§
Source§impl TenantProvisioner
impl TenantProvisioner
Sourcepub fn database_template(self, template: impl Into<String>) -> Self
pub fn database_template(self, template: impl Into<String>) -> Self
Set database name template
Sourcepub fn schema_template(self, template: impl Into<String>) -> Self
pub fn schema_template(self, template: impl Into<String>) -> Self
Set schema name template
Sourcepub fn branch_template(self, template: impl Into<String>) -> Self
pub fn branch_template(self, template: impl Into<String>) -> Self
Set branch name template
Sourcepub fn generate_database_name(&self, tenant: &TenantId) -> String
pub fn generate_database_name(&self, tenant: &TenantId) -> String
Generate database name for tenant
Sourcepub fn generate_schema_name(&self, tenant: &TenantId) -> String
pub fn generate_schema_name(&self, tenant: &TenantId) -> String
Generate schema name for tenant
Sourcepub fn generate_branch_name(&self, tenant: &TenantId) -> String
pub fn generate_branch_name(&self, tenant: &TenantId) -> String
Generate branch name for tenant
Sourcepub fn generate_isolation(
&self,
tenant: &TenantId,
strategy_type: &str,
shared_database: Option<&str>,
) -> IsolationStrategy
pub fn generate_isolation( &self, tenant: &TenantId, strategy_type: &str, shared_database: Option<&str>, ) -> IsolationStrategy
Generate isolation strategy for tenant
Sourcepub fn sql_create_database(&self, tenant: &TenantId) -> Vec<String>
pub fn sql_create_database(&self, tenant: &TenantId) -> Vec<String>
Generate SQL to create database isolation
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TenantProvisioner
impl RefUnwindSafe for TenantProvisioner
impl Send for TenantProvisioner
impl Sync for TenantProvisioner
impl Unpin for TenantProvisioner
impl UnsafeUnpin for TenantProvisioner
impl UnwindSafe for TenantProvisioner
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more