pub struct PrimaryKeyConstraint {
pub name: Option<Ident>,
pub index_name: Option<Ident>,
pub index_type: Option<IndexType>,
pub columns: Vec<IndexColumn>,
pub index_options: Vec<IndexOption>,
pub characteristics: Option<ConstraintCharacteristics>,
}Expand description
MySQL definition for PRIMARY KEY constraints statements:
[CONSTRAINT [<name>]] PRIMARY KEY [index_name] [index_type] (<columns>) <index_options>
Actually the specification have no [index_name] but the next query will complete successfully:
CREATE TABLE unspec_table (
xid INT NOT NULL,
CONSTRAINT p_name PRIMARY KEY index_name USING BTREE (xid)
);where:
- index_type is
USING {BTREE | HASH} - index_options is
{index_type | COMMENT 'string' | ... %currently unsupported stmts% } ...
Fields§
§name: Option<Ident>Constraint name.
Can be not the same as index_name
index_name: Option<Ident>Index name
index_type: Option<IndexType>Optional USING of index type statement before columns.
columns: Vec<IndexColumn>Identifiers of the columns that form the primary key.
index_options: Vec<IndexOption>§characteristics: Option<ConstraintCharacteristics>Trait Implementations§
Source§impl Clone for PrimaryKeyConstraint
impl Clone for PrimaryKeyConstraint
Source§fn clone(&self) -> PrimaryKeyConstraint
fn clone(&self) -> PrimaryKeyConstraint
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrimaryKeyConstraint
impl Debug for PrimaryKeyConstraint
Source§impl<'de> Deserialize<'de> for PrimaryKeyConstraint
impl<'de> Deserialize<'de> for PrimaryKeyConstraint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for PrimaryKeyConstraint
impl Display for PrimaryKeyConstraint
Source§impl From<PrimaryKeyConstraint> for ColumnOption
impl From<PrimaryKeyConstraint> for ColumnOption
Source§fn from(c: PrimaryKeyConstraint) -> Self
fn from(c: PrimaryKeyConstraint) -> Self
Converts to this type from the input type.
Source§impl From<PrimaryKeyConstraint> for TableConstraint
impl From<PrimaryKeyConstraint> for TableConstraint
Source§fn from(constraint: PrimaryKeyConstraint) -> Self
fn from(constraint: PrimaryKeyConstraint) -> Self
Converts to this type from the input type.
Source§impl Hash for PrimaryKeyConstraint
impl Hash for PrimaryKeyConstraint
Source§impl Ord for PrimaryKeyConstraint
impl Ord for PrimaryKeyConstraint
Source§fn cmp(&self, other: &PrimaryKeyConstraint) -> Ordering
fn cmp(&self, other: &PrimaryKeyConstraint) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PrimaryKeyConstraint
impl PartialEq for PrimaryKeyConstraint
Source§impl PartialOrd for PrimaryKeyConstraint
impl PartialOrd for PrimaryKeyConstraint
Source§impl Serialize for PrimaryKeyConstraint
impl Serialize for PrimaryKeyConstraint
Source§impl Spanned for PrimaryKeyConstraint
impl Spanned for PrimaryKeyConstraint
Source§impl Visit for PrimaryKeyConstraint
impl Visit for PrimaryKeyConstraint
Source§impl VisitMut for PrimaryKeyConstraint
impl VisitMut for PrimaryKeyConstraint
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
impl Eq for PrimaryKeyConstraint
impl StructuralPartialEq for PrimaryKeyConstraint
Auto Trait Implementations§
impl Freeze for PrimaryKeyConstraint
impl RefUnwindSafe for PrimaryKeyConstraint
impl Send for PrimaryKeyConstraint
impl Sync for PrimaryKeyConstraint
impl Unpin for PrimaryKeyConstraint
impl UnwindSafe for PrimaryKeyConstraint
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