mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-03 22:08:16 +00:00
Support ALTER INDEX {INDEX_NAME} RENAME TO {NEW_INDEX_NAME}
(#767)
* test: add a case `rename_index` * feat: add AlterIndex match arm * fix: remove todo with self.expected * chore: add comment to unreachable
This commit is contained in:
parent
f0870fd315
commit
61c661c234
4 changed files with 229 additions and 164 deletions
|
@ -2686,6 +2686,21 @@ fn parse_alter_table() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_alter_index() {
|
||||
let rename_index = "ALTER INDEX idx RENAME TO new_idx";
|
||||
match verified_stmt(rename_index) {
|
||||
Statement::AlterIndex {
|
||||
name,
|
||||
operation: AlterIndexOperation::RenameIndex { index_name },
|
||||
} => {
|
||||
assert_eq!("idx", name.to_string());
|
||||
assert_eq!("new_idx", index_name.to_string())
|
||||
}
|
||||
_ => unreachable!(),
|
||||
};
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_alter_table_add_column() {
|
||||
match verified_stmt("ALTER TABLE tab ADD foo TEXT") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue