diff --git a/website/docs/reference/resource-configs/alias.md b/website/docs/reference/resource-configs/alias.md index 5beaa238806..83a6d8e63a4 100644 --- a/website/docs/reference/resource-configs/alias.md +++ b/website/docs/reference/resource-configs/alias.md @@ -101,7 +101,7 @@ seeds: -Configure a snapshots's alias in your `dbt_project.yml` file or config block. +Configure a snapshots's alias in your `dbt_project.yml` file, `snapshots/snapshot_name.yml` file, or config block. The following examples demonstrate how to `alias` a snapshot named `your_snapshot` to `the_best_snapshot`. @@ -117,15 +117,15 @@ snapshots: ``` -In the `snapshots/properties.yml` file: +In the `snapshots/snapshot_name.yml` file: - + ```yml version: 2 snapshots: - - name: your_snapshot + - name: your_snapshot_name config: alias: the_best_snapshot ``` diff --git a/website/docs/reference/resource-configs/contract.md b/website/docs/reference/resource-configs/contract.md index 18266ec672f..bd1fceb4e9b 100644 --- a/website/docs/reference/resource-configs/contract.md +++ b/website/docs/reference/resource-configs/contract.md @@ -6,8 +6,6 @@ default_value: {enforced: false} id: "contract" --- -Supported in dbt v1.5 and higher. - When the `contract` configuration is enforced, dbt will ensure that your model's returned dataset exactly matches the attributes you have defined in yaml: - `name` and `data_type` for every column - Additional [`constraints`](/reference/resource-properties/constraints), as supported for this materialization and data platform diff --git a/website/docs/reference/resource-configs/database.md b/website/docs/reference/resource-configs/database.md index 6c57e7e2c69..16742b3f597 100644 --- a/website/docs/reference/resource-configs/database.md +++ b/website/docs/reference/resource-configs/database.md @@ -22,6 +22,7 @@ models: ``` + This would result in the generated relation being located in the `reporting` database, so the full relation name would be `reporting.finance.sales_metrics` instead of the default target database. @@ -55,7 +56,7 @@ Available for dbt Cloud release tracks or dbt Core v1.9+. Select v1.9 or newer f -Specify a custom database for a snapshot in your `dbt_project.yml` or config file. +Specify a custom database for a snapshot in your `dbt_project.yml`, snapshot.yml file, or config file. For example, if you have a snapshot that you want to load into a database other than the target database, you can configure it like this: @@ -69,6 +70,20 @@ snapshots: ``` +Or in a `snapshot_name.yml` file: + + + +```yaml +version: 2 + +snapshots: + - name: snapshot_name + [config](/reference/resource-properties/config): + database: snapshots +``` + + This results in the generated relation being located in the `snapshots` database so the full relation name would be `snapshots.finance.your_snapshot` instead of the default target database. diff --git a/website/docs/reference/resource-configs/enabled.md b/website/docs/reference/resource-configs/enabled.md index b74d7250907..04ca3ca538b 100644 --- a/website/docs/reference/resource-configs/enabled.md +++ b/website/docs/reference/resource-configs/enabled.md @@ -78,6 +78,19 @@ snapshots: + + +```yaml +version: 2 + +snapshots: + - name: snapshot_name + [config](/reference/resource-properties/config): + enabled: true | false +``` + + + ```sql diff --git a/website/docs/reference/resource-configs/group.md b/website/docs/reference/resource-configs/group.md index cd0ad2683f5..5ea701b3b63 100644 --- a/website/docs/reference/resource-configs/group.md +++ b/website/docs/reference/resource-configs/group.md @@ -96,6 +96,21 @@ snapshots: + + + +```yaml +version: 2 + +snapshots: + - name: snapshot_name + [config](/reference/resource-properties/config): + group: GROUP_NAME +``` + + + + ```sql diff --git a/website/docs/reference/resource-configs/persist_docs.md b/website/docs/reference/resource-configs/persist_docs.md index d4a90027771..68a23274b4b 100644 --- a/website/docs/reference/resource-configs/persist_docs.md +++ b/website/docs/reference/resource-configs/persist_docs.md @@ -84,6 +84,23 @@ snapshots: + + + +```yaml +version: 2 + +snapshots: + - name: snapshot_name + [config](/reference/resource-properties/config): + persist_docs: + relation: true + columns: true +``` + + + + ```sql diff --git a/website/docs/reference/resource-configs/schema.md b/website/docs/reference/resource-configs/schema.md index 6f56215de61..3311807692c 100644 --- a/website/docs/reference/resource-configs/schema.md +++ b/website/docs/reference/resource-configs/schema.md @@ -22,6 +22,23 @@ models: ``` +In a `snapshots/snapshot_name.yml` file: + + + + +```yaml +version: 2 + +snapshots: + - name: snapshot_name + [config](/reference/resource-properties/config): + schema: marketing +``` + + + + This would result in the generated relations for these models being located in the `marketing` schema, so the full relation names would be `analytics.target_schema_marketing.model_name`. This is because the schema of the relation is `{{ target.schema }}_{{ schema }}`. The [definition](#definition) section explains this in more detail.