pub enum ColumnConstraint {
PrimaryKey {
order: Option<SortOrder>,
conflict_clause: Option<ResolveType>,
auto_increment: bool,
},
NotNull {
nullable: bool,
conflict_clause: Option<ResolveType>,
},
Unique(Option<ResolveType>),
Check(Expr),
Default(Expr),
Defer(DeferSubclause),
Collate {
collation_name: Name,
},
ForeignKey {
clause: ForeignKeyClause,
deref_clause: Option<DeferSubclause>,
},
Generated {
expr: Expr,
typ: Option<Id>,
},
}Expand description
Column constraint
Variants§
PrimaryKey
PRIMARY KEY
Fields
§
conflict_clause: Option<ResolveType>ON CONFLICT clause
NotNull
NULL
Unique(Option<ResolveType>)
UNIQUE
Check(Expr)
CHECK
Default(Expr)
DEFAULT
Defer(DeferSubclause)
DEFERRABLE
Collate
COLLATE
ForeignKey
REFERENCES foreign-key clause
Generated
GENERATED
Trait Implementations§
Source§impl Clone for ColumnConstraint
impl Clone for ColumnConstraint
Source§fn clone(&self) -> ColumnConstraint
fn clone(&self) -> ColumnConstraint
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 ColumnConstraint
impl Debug for ColumnConstraint
impl Eq for ColumnConstraint
Source§impl PartialEq for ColumnConstraint
impl PartialEq for ColumnConstraint
Source§fn eq(&self, other: &ColumnConstraint) -> bool
fn eq(&self, other: &ColumnConstraint) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ColumnConstraint
Source§impl ToSqlString for ColumnConstraint
impl ToSqlString for ColumnConstraint
Source§fn to_sql_string<C: ToSqlContext>(&self, context: &C) -> String
fn to_sql_string<C: ToSqlContext>(&self, context: &C) -> String
Convert the given value to String
Auto Trait Implementations§
impl Freeze for ColumnConstraint
impl RefUnwindSafe for ColumnConstraint
impl Send for ColumnConstraint
impl Sync for ColumnConstraint
impl Unpin for ColumnConstraint
impl UnsafeUnpin for ColumnConstraint
impl UnwindSafe for ColumnConstraint
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.