Comment on page
📬
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.
my_view.yaml config file:
text: !include my_view.sql
my_view.sql file:
SELECT id, name
FROM my_table
- 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.
Last modified 6mo ago