ðArchitecture overview
Components
SnowDDL consists of the following components:
Blueprint - pydantic model representing the desired state of an object in Snowflake account;
Config - collection of blueprints;
Parsers - used to parse YAML config files into blueprints, one parser class per object type;
Resolvers - used to compare blueprints with existing metadata in Snowflake account and generate DDL commands to apply changes, one resolver class per object type;
Engine - initialized with Snowflake connection and SnowDDL config, used to build, format and execute commands by resolvers.
Workflow
These components are combined into "applications" with the following workflow:
Initialize an empty config.
Generate individual blueprints using parsers or custom Python code, add blueprints to config.
Validate config. If encountered any errors, display error messages and stop execution.
Open connection to Snowflake using Python connector.
Initialize engine using Snowflake connection and config.
Execute resolvers to generate DDL commands. Suggest or apply DDL commands, depending on settings.
Display statistics, close Snowflake connection and finish the application.
Default application used by CLI interface is available on GitHub: base.py
You may extend the default application to build even more sophisticated automation.
For example, Single DB mode is an extension of default application, which is available in singledb.py
.
Last updated