Skip to content

Commit

Permalink
Update saved-queries.md (#6084)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirnawong1 authored Sep 19, 2024
2 parents 5721abb + af68082 commit 12032e3
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions website/docs/docs/build/saved-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,7 @@ saved_queries:
```
</File>
Note, you can set `export_as` to both the saved query and the exports [config](/reference/resource-properties/config), with the exports config value taking precedence. If a key isn't set in the exports config, it will inherit the saved query config value.

#### Project-level saved queries

To enable saved queries at the project level, you can set the `saved-queries` configuration in the [`dbt_project.yml` file](/reference/dbt_project.yml). This saves you time in configuring saved queries in each file:

<File name='dbt_project.yml'>

```yaml
saved-queries:
my_saved_query:
config:
+cache:
enabled: true
```
</File>

For more information on `dbt_project.yml` and config naming conventions, see the [dbt_project.yml reference page](/reference/dbt_project.yml#naming-convention).
Note, that you can set `export_as` to both the saved query and the exports [config](/reference/resource-properties/config), with the exports config value taking precedence. If a key isn't set in the exports config, it will inherit the saved query config value.

#### Where clause

Expand Down Expand Up @@ -171,6 +154,26 @@ saved_queries:
</File>
</VersionBlock>

<VersionBlock firstVersion="1.7">

#### Project-level saved queries

To enable saved queries at the project level, you can set the `saved-queries` configuration in the [`dbt_project.yml` file](/reference/dbt_project.yml). This saves you time in configuring saved queries in each file:

<File name='dbt_project.yml'>

```yaml
saved-queries:
my_saved_query:
config:
+cache:
enabled: true
```
</File>

For more information on `dbt_project.yml` and config naming conventions, see the [dbt_project.yml reference page](/reference/dbt_project.yml#naming-convention).
</VersionBlock>

To build `saved_queries`, use the [`--resource-type` flag](/reference/global-configs/resource-type) and run the command `dbt build --resource-type saved_query`.

## Configure exports
Expand Down

0 comments on commit 12032e3

Please sign in to comment.