🐍
Architecture overview
SnowDDL can be used directly in your code as Python package to build custom automation.
import snowddl
SnowDDL consists of the following components:
These components are normally combined into "applications" with the following workflow:
- 1.Initialize an empty config.
- 2.Generate individual blueprints using parsers or custom Python code, add blueprints to config.
- 3.Validate config. If encountered any config errors, display error messages and stop execution.
- 4.
- 5.Initialize engine using Snowflake connection and config.
- 6.Execute resolvers to generate DDL commands and suggest or apply changes.
- 7.Display statistics and close the application.
You may start with default application, overload it and adjust according to your specific needs.
For example:
- generate blueprints for some tables and views dynamically, based on external data source;
- generate blueprints for users dynamically, based on information from HR systems;
- add a new object type, with its own parser and resolver;
- add more fine-grained DDL command classification to engine, on top of existing "safe" and "unsafe" categories;
- 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 CHANGELOG.
Last modified 11mo ago