pub struct CheckConstraintDef {
pub table: &'static str,
pub name: &'static str,
pub value: &'static str,
}Expand description
A named CHECK constraint that can be built in a const.
§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 strSQL boolean expression, without CHECK (...)
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
Creates a check constraint with an empty expression; set it with
value.
Sourcepub const fn into_check_constraint(self) -> CheckConstraint
pub const fn into_check_constraint(self) -> CheckConstraint
Converts to the runtime CheckConstraint.
Trait Implementations§
Source§impl Clone for CheckConstraintDef
impl Clone for CheckConstraintDef
impl Copy for CheckConstraintDef
Source§impl Debug for CheckConstraintDef
impl Debug for CheckConstraintDef
Source§impl Default for CheckConstraintDef
impl Default for CheckConstraintDef
impl Eq 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 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 UnsafeUnpin 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