Basic usage (CLI + YAML)
Advanced usage (Python)
Query builder & formatter
SnowDDL can be used directly in your code as Python package to build custom automation.
SnowDDL consists of the following components:
- dataclass representing the desired state of an object in Snowflake account;
- collection of blueprints;
- used to parse YAML config files into blueprints, one parser class per object type;
- used to compare blueprints with existing metadata in Snowflake account and generate DDL commands to apply changes, one resolver class per object type;
- initialized with Snowflake connection and SnowDDL config, used to build, format and execute commands by resolvers.
These components are normally combined into "applications" with the following workflow:
Initialize an empty
or custom Python code, add blueprints to
. If encountered any config errors, display error messages and stop execution.
Open connection to Snowflake using
using Snowflake connection and
to generate DDL commands and suggest or apply changes.
Display statistics and close the application.
Default application used by
is available on GitHub:
You may start with default application, overload it and adjust according to your specific needs.
for some tables and views dynamically, based on external data source;
for users dynamically, based on information from HR systems;
add a new object type, with its own
add more fine-grained DDL command classification to
, on top of existing
"safe" and "unsafe"
send error logs to centralized monitoring system of your organization;
store execution results of each query to OLTP DMBS (MySQL, PostgreSQL, etc.) for audit and future analysis;
When you start writing a custom code using SnowDDL, make sure to pin the current "snowddl" version in dependencies and keep an eye on
Single DB - Previous
On this page