pub enum AlterSpecification<'a> {
    AddColumn {
        add_span: Span,
        identifier: Identifier<'a>,
        data_type: DataType<'a>,
    },
    AddIndex {
        add_span: Span,
        index_type: IndexType,
        if_not_exists: Option<Span>,
        name: Option<Identifier<'a>>,
        constraint: Option<(Span, Option<Identifier<'a>>)>,
        cols: Vec<IndexCol<'a>>,
        index_options: Vec<IndexOption<'a>>,
    },
    AddForeignKey {
        add_span: Span,
        constraint: Option<(Span, Option<Identifier<'a>>)>,
        foreign_key_span: Span,
        if_not_exists: Option<Span>,
        name: Option<Identifier<'a>>,
        cols: Vec<IndexCol<'a>>,
        references_span: Span,
        references_table: Identifier<'a>,
        references_cols: Vec<Identifier<'a>>,
        ons: Vec<ForeignKeyOn>,
    },
    Modify {
        modify_span: Span,
        if_exists: Option<Span>,
        col: Identifier<'a>,
        definition: DataType<'a>,
    },
    OwnerTo {
        span: Span,
        owner: Identifier<'a>,
    },
}
Expand description

Enum of alterations to perform on a table

Variants§

§

AddColumn

Fields

§add_span: Span
§identifier: Identifier<'a>
§data_type: DataType<'a>
§

AddIndex

Fields

§add_span: Span

Span of “ADD”

§index_type: IndexType

The type of index to add

§if_not_exists: Option<Span>

Span of “IF NOT EXISTS” if specified

§name: Option<Identifier<'a>>

Named of index if specified

§constraint: Option<(Span, Option<Identifier<'a>>)>

Optional “CONSTRAINT” with symbol if specified

§cols: Vec<IndexCol<'a>>

Columns to add the index over

§index_options: Vec<IndexOption<'a>>

Options on the index

Add an index

§

AddForeignKey

Fields

§add_span: Span

Span of “ADD”

§constraint: Option<(Span, Option<Identifier<'a>>)>

Optional “CONSTRAINT” with symbol if specified

§foreign_key_span: Span

Span of “FOREIGN KEY”

§if_not_exists: Option<Span>

Span of “IF NOT EXISTS” if specified

§name: Option<Identifier<'a>>

Named of index if specified

§cols: Vec<IndexCol<'a>>

Columns to add the index over

§references_span: Span

Span of “REFERENCES”

§references_table: Identifier<'a>

Refereed table

§references_cols: Vec<Identifier<'a>>

Columns in referred table

§ons: Vec<ForeignKeyOn>

List of what should happen at specified events

Add a foreign key

§

Modify

Fields

§modify_span: Span
§if_exists: Option<Span>

Span of “IF EXISTS” if specified

§col: Identifier<'a>

Name of column to modify

§definition: DataType<'a>

New definition of column

Modify a column

§

OwnerTo

Fields

§span: Span
§owner: Identifier<'a>

Name of owner

Modify a column

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Compute byte span of an ast fragment
Compute the minimal span containing both self and other

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.