Struct sql_parser::ast::ColumnOptionDef [−][src]
pub struct ColumnOptionDef<T: AstInfo> {
pub name: Option<Ident>,
pub option: ColumnOption<T>,
}Expand description
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<T>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 ColumnOptionDef<T> where
<T as AstInfo>::Id: RefUnwindSafe,
<T as AstInfo>::ObjectName: RefUnwindSafe,
impl<T> Send for ColumnOptionDef<T> where
<T as AstInfo>::Id: Send,
<T as AstInfo>::ObjectName: Send,
impl<T> Sync for ColumnOptionDef<T> where
<T as AstInfo>::Id: Sync,
<T as AstInfo>::ObjectName: Sync,
impl<T> Unpin for ColumnOptionDef<T> where
<T as AstInfo>::ObjectName: Unpin,
impl<T> UnwindSafe for ColumnOptionDef<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