pub struct DdlPolicy {
pub allow_create: bool,
pub allow_drop: bool,
pub allow_alter: bool,
pub allow_truncate: bool,
pub allow_create_index: bool,
pub allow_drop_index: bool,
}Expand description
DDL operation policy that controls allowed DDL operation types.
Fields§
§allow_create: boolWhether CREATE is allowed
allow_drop: boolWhether DROP is allowed
allow_alter: boolWhether ALTER is allowed
allow_truncate: boolWhether TRUNCATE is allowed
allow_create_index: boolWhether CREATE INDEX is allowed
allow_drop_index: boolWhether DROP INDEX is allowed
Implementations§
Source§impl DdlPolicy
impl DdlPolicy
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Create a policy that allows all DDL operations (use with caution in production).
Sourcepub fn safe_evolution() -> Self
pub fn safe_evolution() -> Self
Create a policy that allows CREATE and ALTER but disallows DROP and TRUNCATE.
Sourcepub fn validate(&self, sql: &str) -> ValidationResult
pub fn validate(&self, sql: &str) -> ValidationResult
Validate whether a DDL statement is allowed under the policy.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DdlPolicy
impl RefUnwindSafe for DdlPolicy
impl Send for DdlPolicy
impl Sync for DdlPolicy
impl Unpin for DdlPolicy
impl UnsafeUnpin for DdlPolicy
impl UnwindSafe for DdlPolicy
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