#[non_exhaustive]pub enum TenancyMode {
None,
Row,
Schema,
}Expand description
Tenancy isolation mode for multi-tenant deployments.
Determines how tenant data is separated at the database level.
Configured via [fraiseql.tenancy] in fraiseql.toml.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
Single-tenant deployment, no isolation machinery.
Row
Row-level isolation: shared tables with @tenant_id column injection.
The compiler validates that all queries/mutations referencing
@tenant_id-annotated types have inject_params wired correctly.
At runtime, InjectedParamSource::Jwt resolves the tenant claim
and injects a WHERE clause.
Schema
Schema-level isolation: per-tenant PostgreSQL schemas.
The adapter issues SET search_path TO tenant_{key}, public on
connection acquisition. TenantExecutorFactory provisions/drops
schemas via DDL.
Trait Implementations§
Source§impl Clone for TenancyMode
impl Clone for TenancyMode
Source§fn clone(&self) -> TenancyMode
fn clone(&self) -> TenancyMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TenancyMode
impl Debug for TenancyMode
Source§impl Default for TenancyMode
impl Default for TenancyMode
Source§fn default() -> TenancyMode
fn default() -> TenancyMode
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for TenancyMode
impl<'de> Deserialize<'de> for TenancyMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TenancyMode
impl Display for TenancyMode
Source§impl PartialEq for TenancyMode
impl PartialEq for TenancyMode
Source§fn eq(&self, other: &TenancyMode) -> bool
fn eq(&self, other: &TenancyMode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TenancyMode
impl Serialize for TenancyMode
impl Copy for TenancyMode
impl Eq for TenancyMode
impl StructuralPartialEq for TenancyMode
Auto Trait Implementations§
impl Freeze for TenancyMode
impl RefUnwindSafe for TenancyMode
impl Send for TenancyMode
impl Sync for TenancyMode
impl Unpin for TenancyMode
impl UnsafeUnpin for TenancyMode
impl UnwindSafe for TenancyMode
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.