pub struct RlsPolicy {
pub name: String,
pub table: String,
pub command: PolicyCommand,
pub role: Option<String>,
pub using_expr: Option<String>,
pub with_check_expr: Option<String>,
pub permissive: bool,
}Expand description
Represents a custom RLS policy.
Fields§
§name: StringPolicy name.
table: StringTable the policy applies to.
command: PolicyCommandCommand the policy applies to (ALL, SELECT, INSERT, UPDATE, DELETE).
role: Option<String>Role the policy applies to.
using_expr: Option<String>USING expression (for SELECT, UPDATE, DELETE).
with_check_expr: Option<String>WITH CHECK expression (for INSERT, UPDATE).
permissive: boolWhether this is a permissive or restrictive policy.
Implementations§
Source§impl RlsPolicy
impl RlsPolicy
Sourcepub fn command(self, cmd: PolicyCommand) -> Self
pub fn command(self, cmd: PolicyCommand) -> Self
Set the command.
Sourcepub fn with_check(self, expr: impl Into<String>) -> Self
pub fn with_check(self, expr: impl Into<String>) -> Self
Set the WITH CHECK expression.
Sourcepub fn restrictive(self) -> Self
pub fn restrictive(self) -> Self
Make this a restrictive policy.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RlsPolicy
impl RefUnwindSafe for RlsPolicy
impl Send for RlsPolicy
impl Sync for RlsPolicy
impl Unpin for RlsPolicy
impl UnwindSafe for RlsPolicy
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