# Architecture overview

### Components

SnowDDL consists of the following components:

* [<mark style="color:blue;">**Blueprint**</mark>](/advanced/architecture-overview/blueprints.md) - pydantic model representing the desired state of an object in Snowflake account;
* [<mark style="color:purple;">**Config**</mark>](/advanced/architecture-overview/config.md) - collection of blueprints;
* [<mark style="color:orange;">**Parsers**</mark>](/advanced/architecture-overview/parsers.md) - used to parse YAML config files into blueprints, one parser class per object type;
* [<mark style="color:green;">**Resolvers**</mark>](/advanced/architecture-overview/resolvers.md) - used to compare blueprints with existing metadata in Snowflake account and generate DDL commands to apply changes, one resolver class per object type;
* [<mark style="color:red;">**Engine**</mark>](/advanced/architecture-overview/engine.md) - 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:

1. Initialize an empty <mark style="color:purple;">**config**</mark>.
2. Generate individual <mark style="color:blue;">**blueprints**</mark> using <mark style="color:orange;">**parsers**</mark> or custom Python code, add blueprints to <mark style="color:purple;">**config**</mark>.
3. Validate <mark style="color:purple;">**config**</mark>. If encountered any errors, display error messages and stop execution.
4. Open connection to Snowflake using [Python connector](https://docs.snowflake.com/en/user-guide/python-connector.html).
5. Initialize <mark style="color:red;">**engine**</mark> using Snowflake connection and <mark style="color:purple;">**config**</mark>.
6. Execute <mark style="color:green;">**resolvers**</mark> to generate DDL commands. Suggest or apply DDL commands, depending on settings.
7. Display statistics, close Snowflake connection and finish the application.

Default application used by [CLI interface](/basic/cli.md) is available on GitHub: [`base.py`](https://github.com/littleK0i/SnowDDL/blob/master/snowddl/app/base.py)

You may extend the default application to build even more sophisticated automation.

For example, [Single DB mode](/single-db/overview.md) is an extension of default application, which is available in [`singledb.py`](https://github.com/littleK0i/SnowDDL/blob/master/snowddl/app/singledb.py).

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.snowddl.com/advanced/architecture-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
