pub enum Constraint {
Unique {
columns: Vec<String>,
},
Check {
expression: String,
},
ForeignKey {
columns: Vec<String>,
references: String,
},
Collation {
column: String,
name: String,
},
}Expand description
A rule the source enforces that we have no equivalent for.
These are recorded, not applied. QuantyDB has keys, indexes and nullability, and nothing else from this list, so a foreign key or a check constraint cannot come across. That is a limitation rather than a choice, and the reason to carry them here at all is that an importer which does not mention them lets a developer believe their data is still guarded when it is not.
Variants§
Unique
unique (a, b), or a column declared unique.
Check
check (...), kept as written.
ForeignKey
foreign key (a) references other (b).
Collation
collate nocase on a column, which changes how text compares.
Trait Implementations§
Source§impl Clone for Constraint
impl Clone for Constraint
Source§impl Debug for Constraint
impl Debug for Constraint
impl Eq for Constraint
Source§impl PartialEq for Constraint
impl PartialEq for Constraint
impl StructuralPartialEq for Constraint
Auto Trait Implementations§
impl Freeze for Constraint
impl RefUnwindSafe for Constraint
impl Send for Constraint
impl Sync for Constraint
impl Unpin for Constraint
impl UnsafeUnpin for Constraint
impl UnwindSafe for Constraint
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