Replies: 2 comments 6 replies
-
In theory, you may grant any custom privilege via
my_custom_role:
global_roles:
- database_creator
comment: "Business role which can create databases" It is possible, but it is probably not what you are looking for. Normally it is not enough to create a database. You may also need to create schemas with managed access, set future grants, fix object ownership, drop schema If databases and schemas are configured via SnowDDL, all the complexity is managed by SnowDDL. If you try to create databases yourself using SQL, you lose most of benefits. If you have dynamic list of databases provided by some external data source, it is possible to generate SnowDDL config programmatically: https://docs.snowddl.com/advanced/programmatic-config Just add a Python module with something like this: from snowddl import *
def handler(config: SnowDDLConfig):
database_bp = DatabaseBlueprint(
full_name=DatabaseIdent(config.env_prefix, "my_custom_database"),
comment="My custom database",
)
schema_bp = SchemaBlueprint(
full_name=SchemaIdent(config.env_prefix, "my_custom_database", "my_lovely_schema"),
comment="My custom schema in custom database",
)
config.add_blueprint(database_bp)
config.add_blueprint(schema_bp ) If these solutions are not good enough, please provide a bit more context about your specific business use case. We'll try to find an alternative. Thank you. |
Beta Was this translation helpful? Give feedback.
-
I'm gathering that this is not possible using a tech role? I tried the following: db_creator:
grants:
ACCOUNT:CREATE DATABASE:
- <my account name> But I get a keyerror: I need to be able to create databases on the fly without the help of SnowDDL, my entire workflow for blue-green deploys of data transforms depends on it. @littleK0i what do you recommend in this case? I'd rather not use the |
Beta Was this translation helpful? Give feedback.
-
I am trying to define a role that has
CREATE DATABASE
privileges. I haven't figured out the syntax for it, and am not sure if it's even possible.Beta Was this translation helpful? Give feedback.
All reactions