[][src]Struct sql_ast::ast::ColumnOptionDef

pub struct ColumnOptionDef {
    pub name: Option<Ident>,
    pub option: ColumnOption,
}

An optionally-named ColumnOption: [ CONSTRAINT <name> ] <column-option>.

Note that implementations are substantially more permissive than the ANSI specification on what order column options can be presented in, and whether they are allowed to be named. The specification distinguishes between constraints (NOT NULL, UNIQUE, PRIMARY KEY, and CHECK), which can be named and can appear in any order, and other options (DEFAULT, GENERATED), which cannot be named and must appear in a fixed order. PostgreSQL, however, allows preceding any option with CONSTRAINT <name>, even those that are not really constraints, like NULL and DEFAULT. MSSQL is less permissive, allowing DEFAULT, UNIQUE, PRIMARY KEY and CHECK to be named, but not NULL or NOT NULL constraints (the last of which is in violation of the spec).

For maximum flexibility, we don't distinguish between constraint and non-constraint options, lumping them all together under the umbrella of "column options," and we allow any column option to be named.

Fields

name: Option<Ident>option: ColumnOption

Trait Implementations

impl Clone for ColumnOptionDef[src]

impl Debug for ColumnOptionDef[src]

impl Display for ColumnOptionDef[src]

impl Eq for ColumnOptionDef[src]

impl Hash for ColumnOptionDef[src]

impl PartialEq<ColumnOptionDef> for ColumnOptionDef[src]

impl StructuralEq for ColumnOptionDef[src]

impl StructuralPartialEq for ColumnOptionDef[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.