mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-03 13:58:15 +00:00
feat: Support SHOW CREATE TABLE|EVENT|FUNCTION (MySQL specific) (#338)
* feat: Support SHOW CREATE TABLE|EVENT|FUNCTION (MySQL specific) * misc: Simplify test with loop over enum values
This commit is contained in:
parent
69af5a1d99
commit
9a5716d94b
4 changed files with 87 additions and 1 deletions
|
@ -100,6 +100,27 @@ fn parse_show_columns() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_show_create() {
|
||||
let obj_name = ObjectName(vec![Ident::new("myident")]);
|
||||
|
||||
for obj_type in &vec![
|
||||
ShowCreateObject::Table,
|
||||
ShowCreateObject::Trigger,
|
||||
ShowCreateObject::Event,
|
||||
ShowCreateObject::Function,
|
||||
ShowCreateObject::Procedure,
|
||||
] {
|
||||
assert_eq!(
|
||||
mysql_and_generic().verified_stmt(format!("SHOW CREATE {} myident", obj_type).as_str()),
|
||||
Statement::ShowCreate {
|
||||
obj_type: obj_type.clone(),
|
||||
obj_name: obj_name.clone(),
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_create_table_auto_increment() {
|
||||
let sql = "CREATE TABLE foo (bar INT PRIMARY KEY AUTO_INCREMENT)";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue