mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-07 17:04:59 +00:00
Extend snowflake grant options support (#1794)
This commit is contained in:
parent
776b10afe6
commit
7efa686d78
4 changed files with 126 additions and 19 deletions
|
@ -3357,7 +3357,7 @@ fn test_timetravel_at_before() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn test_grant_account_privileges() {
|
||||
fn test_grant_account_global_privileges() {
|
||||
let privileges = vec![
|
||||
"ALL",
|
||||
"ALL PRIVILEGES",
|
||||
|
@ -3462,6 +3462,43 @@ fn test_grant_account_privileges() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_grant_account_object_privileges() {
|
||||
let privileges = vec![
|
||||
"ALL",
|
||||
"ALL PRIVILEGES",
|
||||
"APPLYBUDGET",
|
||||
"MODIFY",
|
||||
"MONITOR",
|
||||
"USAGE",
|
||||
"OPERATE",
|
||||
];
|
||||
|
||||
let objects_types = vec![
|
||||
"USER",
|
||||
"RESOURCE MONITOR",
|
||||
"WAREHOUSE",
|
||||
"COMPUTE POOL",
|
||||
"DATABASE",
|
||||
"INTEGRATION",
|
||||
"CONNECTION",
|
||||
"FAILOVER GROUP",
|
||||
"REPLICATION GROUP",
|
||||
"EXTERNAL VOLUME",
|
||||
];
|
||||
|
||||
let with_grant_options = vec!["", " WITH GRANT OPTION"];
|
||||
|
||||
for t in &objects_types {
|
||||
for p in &privileges {
|
||||
for wgo in &with_grant_options {
|
||||
let sql = format!("GRANT {p} ON {t} obj1 TO ROLE role1{wgo}");
|
||||
snowflake_and_generic().verified_stmt(&sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_grant_role_to() {
|
||||
snowflake_and_generic().verified_stmt("GRANT ROLE r1 TO ROLE r2");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue