pub enum TableConstraint {
PrimaryKey {
name: Option<String>,
columns: Vec<String>,
},
Unique {
name: Option<String>,
columns: Vec<String>,
},
}Expand description
v7.9.18 — table-level constraint at the end of a CREATE TABLE column list. Either a composite PRIMARY KEY or a UNIQUE (single- or multi-column).
Variants§
PrimaryKey
PRIMARY KEY (col1, col2, ...). Implies NOT NULL on each
referenced column. Engine builds a BTree index named
<table>_pkey and enforces composite uniqueness on INSERT.
Unique
UNIQUE (col1, col2, ...). Engine builds a BTree index
named <table>_<leading_col>_key (single-column) or
<table>_<leading_col>_<…>_key (composite) and enforces
uniqueness on INSERT.
Trait Implementations§
Source§impl Clone for TableConstraint
impl Clone for TableConstraint
Source§fn clone(&self) -> TableConstraint
fn clone(&self) -> TableConstraint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TableConstraint
impl Debug for TableConstraint
Source§impl PartialEq for TableConstraint
impl PartialEq for TableConstraint
Source§fn eq(&self, other: &TableConstraint) -> bool
fn eq(&self, other: &TableConstraint) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TableConstraint
Auto Trait Implementations§
impl Freeze for TableConstraint
impl RefUnwindSafe for TableConstraint
impl Send for TableConstraint
impl Sync for TableConstraint
impl Unpin for TableConstraint
impl UnsafeUnpin for TableConstraint
impl UnwindSafe for TableConstraint
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