diff --git a/website/docs/docs/core/pip-install.md b/website/docs/docs/core/pip-install.md index 6d94d92a64..fa16ca1353 100644 --- a/website/docs/docs/core/pip-install.md +++ b/website/docs/docs/core/pip-install.md @@ -29,9 +29,9 @@ dbt-env\Scripts\activate # activate the environment for Windows #### Create an alias -To activate your dbt environment with every new shell window or session, you can create an alias for the source command in your $HOME/.bashrc, $HOME/.zshrc, or whichever config file your shell draws from. +To activate your dbt environment with every new shell window or session, you can create an alias for the source command in your `$HOME/.bashrc`, `$HOME/.zshrc`, or whichever config file your shell draws from. -For example, add the following to your rc file, replacing <PATH_TO_VIRTUAL_ENV_CONFIG> with the path to your virtual environment configuration. +For example, add the following to your rc file, replacing `` with the path to your virtual environment configuration. ```shell alias env_dbt='source /bin/activate' diff --git a/website/docs/reference/resource-configs/alias.md b/website/docs/reference/resource-configs/alias.md index 9b367f7b48..16a8a392e0 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,18 +117,17 @@ 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 -``` In `snapshots/your_snapshot.sql` file: diff --git a/website/docs/reference/resource-configs/contract.md b/website/docs/reference/resource-configs/contract.md index 18266ec672..bd1fceb4e9 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 6c57e7e2c6..16742b3f59 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 b74d725090..faee6654b2 100644 --- a/website/docs/reference/resource-configs/enabled.md +++ b/website/docs/reference/resource-configs/enabled.md @@ -78,9 +78,28 @@ snapshots: + + + + +```yaml +version: 2 + +snapshots: + - name: snapshot_name + [config](/reference/resource-properties/config): + enabled: true | false +``` + + + + + ```sql +# Configuring in a SQL file is a legacy method and not recommended. Use the YAML file instead. + {% snapshot [snapshot_name](snapshot_name) %} {{ config( @@ -90,11 +109,10 @@ snapshots: select ... {% endsnapshot %} - ``` - + diff --git a/website/docs/reference/resource-configs/group.md b/website/docs/reference/resource-configs/group.md index cd0ad2683f..5ea701b3b6 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 d4a9002777..68a23274b4 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 6f56215de6..1b5a2d83c4 100644 --- a/website/docs/reference/resource-configs/schema.md +++ b/website/docs/reference/resource-configs/schema.md @@ -22,13 +22,14 @@ models: ``` + 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. -Configure a custom schema in your `dbt_project.yml` file. +Configure a [custom schema](/docs/build/custom-schemas#understanding-custom-schemas) in your `dbt_project.yml` file. For example, if you have a seed that should be placed in a separate schema called `mappings`, you can configure it like this: @@ -50,16 +51,18 @@ This would result in the generated relation being located in the `mappings` sche -Available in dbt Core v1.9+. Select v1.9 or newer from the version dropdown to view the configs. Try it now in the [dbt Cloud "Latest" release track](/docs/dbt-versions/cloud-release-tracks). +Available in dbt Core v1.9 and higher. Select v1.9 or newer from the version dropdown to view the configs. Try it now in the [dbt Cloud "Latest" release track](/docs/dbt-versions/cloud-release-tracks). -Specify a custom schema for a snapshot in your `dbt_project.yml` or config file. +Specify a [custom schema](/docs/build/custom-schemas#understanding-custom-schemas) for a snapshot in your `dbt_project.yml` or YAML file. For example, if you have a snapshot that you want to load into a schema other than the target schema, you can configure it like this: +In a `dbt_project.yml` file: + ```yml @@ -70,6 +73,21 @@ snapshots: ``` +In a `snapshots/snapshot_name.yml` file: + + + +```yaml +version: 2 + +snapshots: + - name: snapshot_name + [config](/reference/resource-properties/config): + schema: snapshots +``` + + + This results in the generated relation being located in the `snapshots` schema so the full relation name would be `analytics.snapshots.your_snapshot` instead of the default target schema. @@ -78,20 +96,25 @@ This results in the generated relation being located in the `snapshots` schema s +Specify a [custom schema](/docs/build/custom-schemas#understanding-custom-schemas) for a [saved query](/docs/build/saved-queries#parameters) in your `dbt_project.yml` or YAML file. + ```yml saved-queries: +schema: metrics ``` + +This would result in the saved query being stored in the `metrics` schema. + + -Customize the schema for storing test results in your `dbt_project.yml` file. +Customize a [custom schema](/docs/build/custom-schemas#understanding-custom-schemas) for storing test results in your `dbt_project.yml` file. For example, to save test results in a specific schema, you can configure it like this: - ```yml