Enum wing_sqlparser::ast::AlterTableOperation[][src]

pub enum AlterTableOperation {
    AddConstraint(TableConstraint),
    AddColumn {
        column_def: ColumnDef,
    },
    DropConstraint {
        name: Ident,
    },
    DropColumn {
        column_name: Ident,
        if_exists: bool,
        cascade: bool,
    },
    RenamePartitions {
        old_partitions: Vec<Expr>,
        new_partitions: Vec<Expr>,
    },
    AddPartitions {
        if_not_exists: bool,
        new_partitions: Vec<Expr>,
    },
    DropPartitions {
        partitions: Vec<Expr>,
        if_exists: bool,
    },
    RenameColumn {
        old_column_name: Ident,
        new_column_name: Ident,
    },
    RenameTable {
        table_name: ObjectName,
    },
    ChangeColumn {
        old_name: Ident,
        new_name: Ident,
        data_type: DataType,
        options: Vec<ColumnOption>,
    },
    RenameConstraint {
        old_name: Ident,
        new_name: Ident,
    },
    AlterColumn {
        column_name: Ident,
        op: AlterColumnOperation,
    },
}
Expand description

An ALTER TABLE (Statement::AlterTable) operation

Variants

AddConstraint(TableConstraint)

Tuple Fields

ADD <table_constraint>

AddColumn

Fields

column_def: ColumnDef

ADD [ COLUMN ] <column_def>

DropConstraint

Fields

name: Ident

TODO: implement DROP CONSTRAINT <name>

DropColumn

Fields

column_name: Ident
if_exists: bool
cascade: bool

DROP [ COLUMN ] [ IF EXISTS ] <column_name> [ CASCADE ]

RenamePartitions

Fields

old_partitions: Vec<Expr>
new_partitions: Vec<Expr>

RENAME TO PARTITION (partition=val)

AddPartitions

Fields

if_not_exists: bool
new_partitions: Vec<Expr>

Add Partitions

DropPartitions

Fields

partitions: Vec<Expr>
if_exists: bool

RenameColumn

Fields

old_column_name: Ident
new_column_name: Ident

RENAME [ COLUMN ] <old_column_name> TO <new_column_name>

RenameTable

Fields

table_name: ObjectName

RENAME TO <table_name>

ChangeColumn

Fields

old_name: Ident
new_name: Ident
data_type: DataType
options: Vec<ColumnOption>

RenameConstraint

Fields

old_name: Ident
new_name: Ident

RENAME CONSTRAINT <old_constraint_name> TO <new_constraint_name>

Note: this is a PostgreSQL-specific operation.

AlterColumn

Fields

column_name: Ident

ALTER [ 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

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. 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.