# YAML tag !include

SnowDDL supports custom `!include` tag in YAML configs. When parser encounters this tag, it loads specified file and uses its contents as value for YAML parameter.

It helps to store SQL or UDF code into separate files instead of putting everything inside YAML, which leads to significant improvement of developer experience by providing syntax highlighting and auto-completion.

It is primarily intended to be used with [VIEW](/basic/yaml-configs/view.md) parameter `text` and [FUNCTION](/basic/yaml-configs/function.md) & [PROCEDURE](/basic/yaml-configs/procedure.md) parameter `body`.

## Example

**my\_view\.yaml** config file:

```yaml
text: !include my_view.sql
```

**my\_view\.sql** file:

```sql
SELECT id, name
FROM my_table
```

## Usage notes

* Include paths are relative to source YAML file. It is possible to "include" from the same directory or from any sub-directory relative to YAML file. Examples of valid paths: `my_view.sql`, `sql/my_view_sql`.
* Loading files from parent directory or using absolute paths are not allowed due to security concerns.
* `!include` can be used with files of any type, including `*.py`, `*.java`, `*.sql`, etc.
* [YAML placeholders](/basic/yaml-placeholders.md) in included files are correctly resolved.


---

# 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/basic/yaml-tag-include.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.
