@@ -84,11 +84,14 @@ class Grant(Resource):
84
84
Yaml:
85
85
86
86
```yaml
87
- - Grant :
88
- priv: "SELECT"
87
+ grants :
88
+ - priv: "SELECT"
89
89
on_table: "some_table"
90
90
to: "some_role"
91
91
grant_option: true
92
+ - priv: "USAGE"
93
+ on_schema: somedb.someschema
94
+ to: somedb.somedbrole
92
95
```
93
96
"""
94
97
@@ -769,7 +772,40 @@ def __post_init__(self):
769
772
770
773
771
774
class DatabaseRoleGrant (Resource ):
775
+ """
776
+ Description:
777
+ Represents a grant of a database role to another role or database role in Snowflake.
778
+
779
+ Snowflake Docs:
780
+ https://docs.snowflake.com/en/sql-reference/sql/grant-database-role
781
+
782
+ Fields:
783
+ database_role (string or Role, required): The database role to be granted.
784
+ to_role (string or Role): The role to which the database role is granted.
785
+ to_database_role (string or User): The database role to which the database role is granted.
786
+
787
+ Python:
788
+
789
+ ```python
790
+ # Grant to Database Role:
791
+ role_grant = DatabaseRoleGrant(database_role="somedb.somerole", to_database_role="somedb.someotherrole")
792
+ role_grant = DatabaseRoleGrant(database_role="somedb.somerole", to=DatabaseRole(database="somedb", name="someotherrole"))
772
793
794
+ # Grant to Role:
795
+ role_grant = DatabaseRoleGrant(database_role="somedb.somerole", to_role="somerole")
796
+ role_grant = DatabaseRoleGrant(database_role="somedb.somerole", to=Role(name="somerole"))
797
+ ```
798
+
799
+ Yaml:
800
+
801
+ ```yaml
802
+ database_role_grants:
803
+ - database_role: somedb.somerole
804
+ to_database_role: somedb.someotherrole
805
+ - database_role: somedb.somerole
806
+ to_role: somerole
807
+ ```
808
+ """
773
809
resource_type = ResourceType .DATABASE_ROLE_GRANT
774
810
props = Props (
775
811
database_role = IdentifierProp ("database role" , eq = False ),
0 commit comments