[][src]Enum sql_ast::ast::TableConstraint

pub enum TableConstraint {
    Unique {
        name: Option<Ident>,
        columns: Vec<Ident>,
        is_primary: bool,
    },
    ForeignKey {
        name: Option<Ident>,
        columns: Vec<Ident>,
        foreign_table: ObjectName,
        referred_columns: Vec<Ident>,
    },
    Check {
        name: Option<Ident>,
        expr: Box<Expr>,
    },
}

A table-level constraint, specified in a CREATE TABLE or an ALTER TABLE ADD <constraint> statement.

Variants

Unique

[ CONSTRAINT <name> ] { PRIMARY KEY | UNIQUE } (<columns>)

Fields of Unique

name: Option<Ident>columns: Vec<Ident>is_primary: bool

Whether this is a PRIMARY KEY or just a UNIQUE constraint

ForeignKey

A referential integrity constraint ([ CONSTRAINT <name> ] FOREIGN KEY (<columns>) REFERENCES <foreign_table> (<referred_columns>))

Fields of ForeignKey

name: Option<Ident>columns: Vec<Ident>foreign_table: ObjectNamereferred_columns: Vec<Ident>
Check

[ CONSTRAINT <name> ] CHECK (<expr>)

Fields of Check

name: Option<Ident>expr: Box<Expr>

Trait Implementations

impl Clone for TableConstraint[src]

impl Debug for TableConstraint[src]

impl Display for TableConstraint[src]

impl Eq for TableConstraint[src]

impl Hash for TableConstraint[src]

impl PartialEq<TableConstraint> for TableConstraint[src]

impl StructuralEq for TableConstraint[src]

impl StructuralPartialEq for TableConstraint[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.