pub enum AlterSpecification<'a> {
    AddColumn {
        add_span: Span,
        if_not_exists_span: Option<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
§if_not_exists_span: Option<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§

source§

impl<'a> Clone for AlterSpecification<'a>

source§

fn clone(&self) -> AlterSpecification<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for AlterSpecification<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> Spanned for AlterSpecification<'a>

source§

fn span(&self) -> Span

Compute byte span of an ast fragment
source§

fn join_span(&self, other: &impl OptSpanned) -> Span

Compute the minimal span containing both self and other

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> OptSpanned for Twhere T: Spanned,

source§

fn opt_span(&self) -> Option<Range<usize>>

Compute an optional byte span of an ast fragment
source§

fn opt_join_span(&self, other: &impl OptSpanned) -> Option<Span>

Compute the minimal span containing both self and other if either is missing return the other
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.