pub struct CheckConstraintDef {
pub table: &'static str,
pub name: &'static str,
pub value: &'static str,
}Expand description
Const-friendly check constraint definition
§Examples
use drizzle_types::sqlite::ddl::CheckConstraintDef;
const CHECK: CheckConstraintDef = CheckConstraintDef::new("users", "ck_age")
.value("age >= 0");Fields§
§table: &'static strParent table name
name: &'static strConstraint name
value: &'static strCheck expression
Implementations§
Source§impl CheckConstraintDef
impl CheckConstraintDef
Sourcepub const fn new(table: &'static str, name: &'static str) -> Self
pub const fn new(table: &'static str, name: &'static str) -> Self
Create a new check constraint definition
Sourcepub const fn into_check_constraint(self) -> CheckConstraint
pub const fn into_check_constraint(self) -> CheckConstraint
Convert to runtime CheckConstraint type
Trait Implementations§
Source§impl Clone for CheckConstraintDef
impl Clone for CheckConstraintDef
Source§fn clone(&self) -> CheckConstraintDef
fn clone(&self) -> CheckConstraintDef
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 CheckConstraintDef
impl Debug for CheckConstraintDef
Source§impl Default for CheckConstraintDef
impl Default for CheckConstraintDef
Source§impl From<CheckConstraintDef> for CheckConstraint
impl From<CheckConstraintDef> for CheckConstraint
Source§fn from(def: CheckConstraintDef) -> Self
fn from(def: CheckConstraintDef) -> Self
Converts to this type from the input type.
Source§impl Hash for CheckConstraintDef
impl Hash for CheckConstraintDef
Source§impl PartialEq for CheckConstraintDef
impl PartialEq for CheckConstraintDef
impl Copy for CheckConstraintDef
impl Eq for CheckConstraintDef
impl StructuralPartialEq for CheckConstraintDef
Auto Trait Implementations§
impl Freeze for CheckConstraintDef
impl RefUnwindSafe for CheckConstraintDef
impl Send for CheckConstraintDef
impl Sync for CheckConstraintDef
impl Unpin for CheckConstraintDef
impl UnwindSafe for CheckConstraintDef
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