> ## Documentation Index
> Fetch the complete documentation index at: https://docs.omni.co/llms.txt
> Use this file to discover all available pages before exploring further.

# dbt metadata reference

> A complete list of the dbt metadata Omni can include in a dbt sync, and what each item becomes in your Omni model.

export const CustomerData = "The data contained in the customer data sources connected to Omni";

export const CustomerCredentials = "The credentials provided to Omni to access Customer Data";

export const OmniAccount = "A single Omni customer, such as Blobs R Us, that may have one or more Omni organizations (like blobsrus-usa and blobsrus-eu).";

export const OmniOrganization = "A single instance of Omni, such as blobsrus-usa.omniapp.co.";

export const DbtSync = "An operation triggered in the dbt IDE that pulls dbt metadata into corresponding Omni views. Does not include structural changes.";

A [dbt sync](/integrations/dbt/syncing-dbt) reads metadata from your dbt project and adds it to the matching Omni views. This page lists the metadata a sync can include, what each item becomes in Omni, and what a sync does not read.

Omni includes some metadata in every sync, while the rest depends on the connection's dbt settings.

<h2 id="default">
  Default dbt metadata
</h2>

Every time Omni performs a <Tooltip tip={DbtSync} cta="Learn more" href="/integrations/dbt/syncing-dbt">dbt sync</Tooltip>, the following metadata is included by default:

| From dbt                                                                                                             | In Omni                                                                                                                                                                                          |
| -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Model, seed, or snapshot description**                                                                             | View description                                                                                                                                                                                 |
| **Column description**                                                                                               | Description on the matching dimension                                                                                                                                                            |
| **Model SQL**                                                                                                        | `code` in the view's `dbt` block                                                                                                                                                                 |
| **materialized config**                                                                                              | `config.materialized` in the view's `dbt` block                                                                                                                                                  |
| **Model-level tags config**                                                                                          | `config.tags` in the view's `dbt` block                                                                                                                                                          |
| [**Custom schema config**](https://docs.getdbt.com/docs/build/custom-schemas)                                        | `config.schema` in the view's `dbt` block. Also names the [virtual schema](/integrations/dbt/virtual-schemas)                                                                                    |
| **Downstream models**                                                                                                | `referenced_by` in the view's `dbt` block                                                                                                                                                        |
| [**accepted\_values test values**](https://docs.getdbt.com/reference/resource-properties/data-tests#accepted_values) | `all_values` on the dimension, which Omni uses for filter suggestions and [AI context](/modeling/develop/ai-optimization). If the test has a `where:` config, the values map to `sample_values`. |

Omni matches dbt column names to dimension names without case sensitivity. Only columns that exist in the warehouse table are updated — documenting a column in dbt does not create a dimension in Omni.

## Constraints

If you have [native dbt `primary_key` and `foreign_key` constraints](https://docs.getdbt.com/reference/resource-properties/constraints) defined in your dbt project, you can include them in <Tooltip tip={DbtSync} cta="Learn more" href="/integrations/dbt/syncing-dbt">dbt syncs</Tooltip> by enabling **Auto-generate primary keys and relationships from dbt constraints** in the connection's dbt settings.

When this setting is enabled, dbt syncs include the following:

| From dbt                     | In Omni                                                                                                            |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **primary\_key constraints** | View primary keys. **Note**: Omni only applies a primary key from dbt when the view does not already have one.     |
| **foreign\_key constraints** | [Relationships](/modeling/relationships). **Note**: Foreign key constraints must use a single column on each side. |

<Note>
  Only native dbt constraints are supported. Constraints defined through a package (e.g., `Snowflake-Labs/dbt_constraints`) or constraints based on data tests are not supported.
</Note>

## Semantic layer

If you use dbt's semantic layer, you can include the semantic layer's metadata in <Tooltip tip={DbtSync} cta="Learn more" href="/integrations/dbt/syncing-dbt">dbt syncs</Tooltip> in a few short steps. See [Integrating dbt's semantic layer with Omni](/integrations/dbt/semantic-layer) for more information.

When the semantic layer is enabled, dbt syncs include the following:

| From dbt                      | In Omni                                                                                                                      |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **Semantic layer dimensions** | View dimensions. Includes metadata for descriptions, expressions, and labels.                                                |
| **Semantic layer entities**   | Dimensions that are used to create [relationships](/modeling/relationships) between tables mapped to their respective models |
| **Measures**                  | View [measures](/modeling/measures)                                                                                          |
| **Simple metrics**            | [Measures](/modeling/measures) in the view that the table of the underlying expression is based on                           |
| **Ratio metrics**             | [Measures](/modeling/measures) in the view that the denominator is based on                                                  |
| **Derived metrics**           | [Measures](/modeling/measures) in the view that the first metric is based on                                                 |
| **Semantic view labels**      | Labels on the corresponding `dbt_models` table                                                                               |

Metrics with filters will have dimensions created as those filters in Omni. These dimensions are automatically hidden and applied to the corresponding Omni measure for an equivalent calculation.

## Next steps

* Troubleshoot and resolve [dbt sync issues](/integrations/dbt/debugging-sync-issues)
* Learn more about [dbt syncs in Omni](/integrations/dbt/syncing-dbt)
* Integrate [dbt's semantic layer](/integrations/dbt/semantic-layer) with Omni
* Generate [exposures](/integrations/dbt/exposures) in Omni and push to dbt
