added create and drop schema

This commit is contained in:
Alex Dukhno 2020-05-28 19:50:16 +03:00
parent b28dd82838
commit 91f769e460
4 changed files with 42 additions and 2 deletions

View file

@ -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 {