mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 03:07:20 +00:00
added create and drop schema
This commit is contained in:
parent
b28dd82838
commit
91f769e460
4 changed files with 42 additions and 2 deletions
|
@ -1027,6 +1027,28 @@ fn parse_create_table_with_multiple_on_delete_fails() {
|
|||
.expect_err("should have failed");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_create_schema() {
|
||||
let sql = "CREATE SCHEMA X";
|
||||
|
||||
match verified_stmt(sql) {
|
||||
Statement::CreateSchema { schema_name } => {
|
||||
assert_eq!(schema_name.to_string(), "X".to_owned())
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_drop_schema() {
|
||||
let sql = "DROP SCHEMA X";
|
||||
|
||||
match verified_stmt(sql) {
|
||||
Statement::Drop { object_type, .. } => assert_eq!(object_type, ObjectType::Schema),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_create_table_with_on_delete_on_update_2in_any_order() -> Result<(), ParserError> {
|
||||
let sql = |options: &str| -> String {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue