pub enum ColumnConstraint {
PrimaryKey {
order: SortOrder,
on_conflict: Option<ConflictAction>,
autoincrement: bool,
},
NotNull(Option<ConflictAction>),
Null,
Unique(Option<ConflictAction>),
Check(ExprId),
Default(ExprId),
Collate(NameId),
References(ForeignKeyClause),
Generated {
expr: ExprId,
stored: bool,
},
}Expand description
A column constraint, in written order.
Variants§
PrimaryKey
PRIMARY KEY [ASC|DESC] [conflict] [AUTOINCREMENT].
Fields
§
on_conflict: Option<ConflictAction>The conflict clause.
NotNull(Option<ConflictAction>)
NOT NULL [conflict].
Null
NULL, which SQLite accepts and ignores.
Unique(Option<ConflictAction>)
UNIQUE [conflict].
Check(ExprId)
CHECK (expr).
No conflict clause, which is SQLite’s grammar and not an omission:
ccons ::= CHECK LP expr RP has no onconf, so
b INTEGER CHECK(b < 9) ON CONFLICT IGNORE is a syntax error there and
has to be one here. Only a table-level CHECK takes the clause - see
TableConstraint::Check.
Default(ExprId)
DEFAULT expr.
Collate(NameId)
COLLATE name.
References(ForeignKeyClause)
REFERENCES ....
Generated
GENERATED ALWAYS AS (expr) [STORED|VIRTUAL].
Trait Implementations§
Source§impl Clone for ColumnConstraint
impl Clone for ColumnConstraint
Source§impl Debug for ColumnConstraint
impl Debug for ColumnConstraint
impl Eq for ColumnConstraint
Source§impl PartialEq for ColumnConstraint
impl PartialEq for ColumnConstraint
impl StructuralPartialEq for ColumnConstraint
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