-
I'm attempting to skip modifying a particular view using Programmatic config. I'm looking for some help in how to achieve it. My idea is to replace the view blueprint with the definition found in Snowflake. I figure this is the way to get the ViewResolver to return a NO_CHANGE ResolveResult. I've got the view blueprint I want to ignore
What I'm unsure of is:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I would generally suggest to avoid it and try different approach. If you add some specific logic to preserve objects on DEV, it means one of the core features of "dropping and re-creating environment at any time" will be lost. If something drops or alters this VIEW, original code will be gone anyway. So.. what can we do instead? For example..
You may still manage this database on PROD using SnowDDL. On DEV you may simply remove blueprints for DATABASE, SCHEMA and all objects inside by iterating and calling Sometimes it is very handy to have a DATABASE on PROD, but SHARE with the same name on DEV. No need to change any queries, everything will be compatible. Alternatively, you may try to build VIEW text separately for DEV and PROD envirvonments, but without using current state of objects in Snowflake. This SQL code probably comes from somewhere, maybe it can be replicated in pure Python.
You may try to open a separate Snowflake connection directly in |
Beta Was this translation helpful? Give feedback.
Aha. The following approach might work:
owner_global_roles
: https://docs.snowddl.com/basic/yaml-configs/schemadepends_on
. We assume all external objects already exist.SnowDDL will be able to create view referring to external objects. More importantly, it will be able to detect when this view becomes broken due to various changes in source objects. It is very common for views with
SELECT * FROM ...
. Such view will be recreated automatically.