mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 06:18:17 +00:00
Support CREATE ROLE and DROP ROLE (#598)
* Parse GRANT ROLE and DROP ROLE * Gate create role on dialect * cargo fmt * clippy * no-std * clippy again
This commit is contained in:
parent
604f755a59
commit
91087fcba0
7 changed files with 543 additions and 42 deletions
|
@ -118,6 +118,28 @@ fn parse_mssql_bin_literal() {
|
|||
let _ = ms_and_generic().one_statement_parses_to("SELECT 0xdeadBEEF", "SELECT X'deadBEEF'");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_mssql_create_role() {
|
||||
let sql = "CREATE ROLE mssql AUTHORIZATION helena";
|
||||
match ms().verified_stmt(sql) {
|
||||
Statement::CreateRole {
|
||||
names,
|
||||
authorization_owner,
|
||||
..
|
||||
} => {
|
||||
assert_eq_vec(&["mssql"], &names);
|
||||
assert_eq!(
|
||||
authorization_owner,
|
||||
Some(ObjectName(vec![Ident {
|
||||
value: "helena".into(),
|
||||
quote_style: None
|
||||
}]))
|
||||
);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
fn ms() -> TestedDialects {
|
||||
TestedDialects {
|
||||
dialects: vec![Box::new(MsSqlDialect {})],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue