pub enum TableConstraint<'bump> {
PrimaryKey {
columns: &'bump [SortedColumn<'bump>],
auto_increment: bool,
conflict_clause: Option<ResolveType>,
},
Unique {
columns: &'bump [SortedColumn<'bump>],
conflict_clause: Option<ResolveType>,
},
Check(Expr<'bump>, Option<ResolveType>),
ForeignKey {
columns: &'bump [IndexedColumn<'bump>],
clause: ForeignKeyClause<'bump>,
defer_clause: Option<DeferSubclause>,
},
}Expand description
Table constraint
Variants§
PrimaryKey
PRIMARY KEY
Fields
§
columns: &'bump [SortedColumn<'bump>]columns
§
conflict_clause: Option<ResolveType>ON CONFLICT clause
Unique
UNIQUE
Fields
§
columns: &'bump [SortedColumn<'bump>]columns
§
conflict_clause: Option<ResolveType>ON CONFLICT clause
Check(Expr<'bump>, Option<ResolveType>)
CHECK
ForeignKey
FOREIGN KEY
Fields
§
columns: &'bump [IndexedColumn<'bump>]columns
§
clause: ForeignKeyClause<'bump>REFERENCES
§
defer_clause: Option<DeferSubclause>DEFERRABLE
Implementations§
Source§impl<'bump> TableConstraint<'bump>
impl<'bump> TableConstraint<'bump>
Sourcepub fn primary_key(
columns: Vec<'bump, SortedColumn<'bump>>,
auto_increment: bool,
conflict_clause: Option<ResolveType>,
) -> Result<Self, ParserError>
pub fn primary_key( columns: Vec<'bump, SortedColumn<'bump>>, auto_increment: bool, conflict_clause: Option<ResolveType>, ) -> Result<Self, ParserError>
PK constructor
Sourcepub fn unique(
columns: Vec<'bump, SortedColumn<'bump>>,
conflict_clause: Option<ResolveType>,
) -> Result<Self, ParserError>
pub fn unique( columns: Vec<'bump, SortedColumn<'bump>>, conflict_clause: Option<ResolveType>, ) -> Result<Self, ParserError>
UNIQUE constructor
Trait Implementations§
Source§impl<'bump> Debug for TableConstraint<'bump>
impl<'bump> Debug for TableConstraint<'bump>
impl<'bump> Eq for TableConstraint<'bump>
Source§impl<'bump> PartialEq for TableConstraint<'bump>
impl<'bump> PartialEq for TableConstraint<'bump>
Source§fn eq(&self, other: &TableConstraint<'bump>) -> bool
fn eq(&self, other: &TableConstraint<'bump>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<'bump> StructuralPartialEq for TableConstraint<'bump>
Auto Trait Implementations§
impl<'bump> !RefUnwindSafe for TableConstraint<'bump>
impl<'bump> !Send for TableConstraint<'bump>
impl<'bump> !Sync for TableConstraint<'bump>
impl<'bump> !UnwindSafe for TableConstraint<'bump>
impl<'bump> Freeze for TableConstraint<'bump>
impl<'bump> Unpin for TableConstraint<'bump>
impl<'bump> UnsafeUnpin for TableConstraint<'bump>
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.