Enum sql_parse::AlterSpecification
source · [−]pub enum AlterSpecification<'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>,
},
}
Expand description
Enum of alterations to perform on a table
Variants
AddIndex
Fields
add_span: Span
Span of “ADD”
index_type: IndexType
The type of index to add
name: Option<Identifier<'a>>
Named of index if specified
index_options: Vec<IndexOption<'a>>
Options on the index
Add an index
AddForeignKey
Fields
add_span: Span
Span of “ADD”
foreign_key_span: Span
Span of “FOREIGN KEY”
name: Option<Identifier<'a>>
Named of index if specified
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
col: Identifier<'a>
Name of column to modify
definition: DataType<'a>
New definition of column
Modify a column
Trait Implementations
sourceimpl<'a> Clone for AlterSpecification<'a>
impl<'a> Clone for AlterSpecification<'a>
sourcefn clone(&self) -> AlterSpecification<'a>
fn clone(&self) -> AlterSpecification<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for AlterSpecification<'a>
impl<'a> Debug for AlterSpecification<'a>
sourceimpl<'a> Spanned for AlterSpecification<'a>
impl<'a> Spanned for AlterSpecification<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for AlterSpecification<'a>
impl<'a> Send for AlterSpecification<'a>
impl<'a> Sync for AlterSpecification<'a>
impl<'a> Unpin for AlterSpecification<'a>
impl<'a> UnwindSafe for AlterSpecification<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more