pub enum IsolationStrategy {
Database {
database_name: String,
},
Schema {
database_name: String,
schema_name: String,
},
Row {
database_name: String,
tenant_column: String,
},
Branch {
branch_name: String,
},
}Expand description
Tenant isolation strategy
Variants§
Database
Separate database per tenant
Schema
Separate schema per tenant (same database)
Fields
Row
Row-level security (same tables)
Branch
Branch per tenant (HeliosDB-Lite specific)
Implementations§
Source§impl IsolationStrategy
impl IsolationStrategy
Sourcepub fn schema(database: impl Into<String>, schema: impl Into<String>) -> Self
pub fn schema(database: impl Into<String>, schema: impl Into<String>) -> Self
Create schema isolation strategy
Sourcepub fn row(database: impl Into<String>, column: impl Into<String>) -> Self
pub fn row(database: impl Into<String>, column: impl Into<String>) -> Self
Create row-level isolation strategy
Sourcepub fn database_name(&self) -> Option<&str>
pub fn database_name(&self) -> Option<&str>
Get the database name for this strategy
Sourcepub fn schema_name(&self) -> Option<&str>
pub fn schema_name(&self) -> Option<&str>
Get the schema name if using schema isolation
Sourcepub fn tenant_column(&self) -> Option<&str>
pub fn tenant_column(&self) -> Option<&str>
Get the tenant column if using row-level isolation
Sourcepub fn branch_name(&self) -> Option<&str>
pub fn branch_name(&self) -> Option<&str>
Get the branch name if using branch isolation
Sourcepub fn requires_query_transform(&self) -> bool
pub fn requires_query_transform(&self) -> bool
Check if this strategy requires query transformation
Sourcepub fn requires_connection_routing(&self) -> bool
pub fn requires_connection_routing(&self) -> bool
Check if this strategy requires connection routing
Sourcepub fn strategy_name(&self) -> &'static str
pub fn strategy_name(&self) -> &'static str
Get display name for this strategy
Trait Implementations§
Source§impl Clone for IsolationStrategy
impl Clone for IsolationStrategy
Source§fn clone(&self) -> IsolationStrategy
fn clone(&self) -> IsolationStrategy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IsolationStrategy
impl Debug for IsolationStrategy
Source§impl PartialEq for IsolationStrategy
impl PartialEq for IsolationStrategy
impl Eq for IsolationStrategy
impl StructuralPartialEq for IsolationStrategy
Auto Trait Implementations§
impl Freeze for IsolationStrategy
impl RefUnwindSafe for IsolationStrategy
impl Send for IsolationStrategy
impl Sync for IsolationStrategy
impl Unpin for IsolationStrategy
impl UnsafeUnpin for IsolationStrategy
impl UnwindSafe for IsolationStrategy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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