Enum sql_parser::ast::TableConstraint [−][src]
pub enum TableConstraint<T: AstInfo> {
Unique {
name: Option<Ident>,
columns: Vec<Ident>,
is_primary: bool,
},
ForeignKey {
name: Option<Ident>,
columns: Vec<Ident>,
foreign_table: UnresolvedObjectName,
referred_columns: Vec<Ident>,
},
Check {
name: Option<Ident>,
expr: Box<Expr<T>>,
},
}Expand description
A table-level constraint, specified in a CREATE TABLE or an
ALTER TABLE ADD <constraint> statement.
Variants
Unique
Fields
is_primary: boolWhether this is a PRIMARY KEY or just a UNIQUE constraint
[ CONSTRAINT <name> ] { PRIMARY KEY | UNIQUE } (<columns>)
ForeignKey
Fields
foreign_table: UnresolvedObjectNameA referential integrity constraint ([ CONSTRAINT <name> ] FOREIGN KEY (<columns>) REFERENCES <foreign_table> (<referred_columns>))
Check
[ CONSTRAINT <name> ] CHECK (<expr>)
Trait Implementations
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
Auto Trait Implementations
impl<T> RefUnwindSafe for TableConstraint<T> where
<T as AstInfo>::Id: RefUnwindSafe,
<T as AstInfo>::ObjectName: RefUnwindSafe,
impl<T> Send for TableConstraint<T> where
<T as AstInfo>::Id: Send,
<T as AstInfo>::ObjectName: Send,
impl<T> Sync for TableConstraint<T> where
<T as AstInfo>::Id: Sync,
<T as AstInfo>::ObjectName: Sync,
impl<T> Unpin for TableConstraint<T>
impl<T> UnwindSafe for TableConstraint<T> where
<T as AstInfo>::Id: UnwindSafe,
<T as AstInfo>::ObjectName: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Formats an object with the “alternative” format ({:#}) and returns it.
Compare self to key and return true if they are equal.
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more