# Dependency management

SnowDDL dependency management system is simple and straightforward.

## Dependencies across different object types

There is NO NEED for dependency management across different object types. All object types are resolved sequentially in order described in [Object types](/guides/object-types.md) guide. It means:

* all views are created after all tables
* all tables are created after all schemas
* all schemas created after all databases
* etc.

If one object type relies on another object type (for example, `EXTERNAL_TABLE` relies on `FILE_FORMAT`), you may assume that it will be available.

## Dependencies across the same object type

Sometimes objects of the same type depend on each other. In this case an explicit dependency must be added to make sure that objects will be created in the right order.

Currently the following object types support explicit dependencies:

* `TASKS` - property `after` is a reference to another task;
* `VIEWS` - property `depends_on` is a reference to another view;

In future dependency management for `FUNCTIONS` and `PROCEDURES` might be added, if it becomes necessary.

You may have any number of "levels" of dependencies.

{% hint style="warning" %}
If dependency could not be resolved (e.g. ref object was removed from config or renamed), SnowDDL will try to process such object anyway, so you'll have a chance to see an SQL error.
{% endhint %}


---

# 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/guides/other-guides/dependency-management.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.
