Enum sql_parse::AlterSpecification
source · 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
AddIndex
Fields
§
name: Option<Identifier<'a>>
Named of index if specified
§
constraint: Option<(Span, Option<Identifier<'a>>)>
Optional “CONSTRAINT” with symbol if specified
§
index_options: Vec<IndexOption<'a>>
Options on the index
Add an index
AddForeignKey
Fields
§
constraint: Option<(Span, Option<Identifier<'a>>)>
Optional “CONSTRAINT” with symbol if specified
§
name: Option<Identifier<'a>>
Named of index if specified
§
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
§
col: Identifier<'a>
Name of column to modify
Modify a column
OwnerTo
Modify a column
Trait Implementations§
source§impl<'a> Clone for AlterSpecification<'a>
impl<'a> Clone for AlterSpecification<'a>
source§fn clone(&self) -> AlterSpecification<'a>
fn clone(&self) -> AlterSpecification<'a>
Returns a copy 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 more