//! Optional `PostgreSQL` row-level-security profile for tenant isolation.
use TenantId;
use ;
/// Installs the opt-in RLS policies for a tenant-aware schema.
///
/// RLS is deliberately separate from the ordinary migration. Applications
/// that enable it must use a role with `BYPASSRLS` for [`crate::AdminDovecote`]
/// and call [`bind_tenant`] at the start of every scoped transaction.
pub const RLS_PROFILE_SQL: &str = include_str!;
/// Binds a validated tenant to the current transaction for the RLS profile.
///
/// The setting is transaction-local and cannot outlive the supplied `SQLx`
/// transaction. It does not replace the adapter's tenant predicates.
///
/// # Errors
/// Returns the database error if binding transaction-local tenant context fails.
/// The caller must roll back the transaction before retrying.
pub async