Extend snowflake grant options support (#1794)

This commit is contained in:
Yoav Cohen 2025-04-03 19:52:23 +02:00 committed by GitHub
parent 776b10afe6
commit 7efa686d78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 126 additions and 19 deletions

View file

@ -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");