pub struct DropIndex<'a> {
pub drop_span: Span,
pub index_span: Span,
pub if_exists: Option<Span>,
pub index_name: Identifier<'a>,
pub on: Option<(Span, QualifiedName<'a>)>,
}
Expand description
Represent a drop index statement.
MariaDB example
let sql = "DROP INDEX IF EXISTS `myindex` ON `bar`;";
let mut issues = Issues::new(sql);
let mut stmts = parse_statements(sql, &mut issues, &options);
let s: DropIndex = match stmts.pop() {
Some(Statement::DropIndex(s)) => s,
_ => panic!("We should get a drop trigger statement")
};
assert!(s.index_name.as_str() == "myindex");
PostgreSQL example
let sql = "DROP INDEX IF EXISTS \"myindex\";";
let mut issues = Issues::new(sql);
let mut stmts = parse_statements(sql, &mut issues, &options);
let s: DropIndex = match stmts.pop() {
Some(Statement::DropIndex(s)) => s,
_ => panic!("We should get a drop trigger statement")
};
assert!(s.index_name.as_str() == "myindex");
Fields§
§drop_span: Span
Span of “DROP”
index_span: Span
Span of “INDEX”
if_exists: Option<Span>
Span of “IF EXISTS” if specified
index_name: Identifier<'a>
§on: Option<(Span, QualifiedName<'a>)>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for DropIndex<'a>
impl<'a> RefUnwindSafe for DropIndex<'a>
impl<'a> Send for DropIndex<'a>
impl<'a> Sync for DropIndex<'a>
impl<'a> Unpin for DropIndex<'a>
impl<'a> UnwindSafe for DropIndex<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more