Add parsing for GRANT ROLE and GRANT DATABASE ROLE in Snowflake dialect (#1689)

This commit is contained in:
Yoav Cohen 2025-02-03 20:17:47 +01:00 committed by GitHub
parent 257da5a82c
commit ec948eaf6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 94 additions and 54 deletions

View file

@ -3046,7 +3046,10 @@ fn parse_grant() {
);
assert_eq!(
objects,
GrantObjects::Tables(vec![ObjectName::from(vec!["*".into(), "*".into()])])
Some(GrantObjects::Tables(vec![ObjectName::from(vec![
"*".into(),
"*".into()
])]))
);
assert!(!with_grant_option);
assert!(granted_by.is_none());
@ -3087,7 +3090,10 @@ fn parse_revoke() {
);
assert_eq!(
objects,
GrantObjects::Tables(vec![ObjectName::from(vec!["db1".into(), "*".into()])])
Some(GrantObjects::Tables(vec![ObjectName::from(vec![
"db1".into(),
"*".into()
])]))
);
if let [Grantee {
grantee_type: GranteesType::None,