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

# Compilation

> How Lightdash compiles your dbt project into explores, and how to control compilation strictness

`lightdash compile` builds your dbt project's .yml files into Lightdash explores and reports any errors that would break your Lightdash project. For example, a metric that references a dimension that doesn't exist.

Compilation also runs inside [`lightdash validate`](/workflow/cli/validate), [`lightdash deploy`](/workflow/cli/deploy), and [`lightdash preview`](/workflow/preview-projects), so the behaviour and flags on this page apply to those commands too.

## Choose partial or strict compilation

Lightdash uses **partial compilation** by default. Field, join, and set-validation failures that can be isolated are reported as warnings so the rest of the explore stays usable; failures that cannot be isolated can still produce errors.

Add `--no-partial-compilation` to report the failures that partial compilation would otherwise isolate as errors instead. It doesn't promote unrelated, non-blocking warnings — other generic compilation warnings stay non-blocking.

If your project uses physical column references such as `${TABLE}.order_id`, add `--validate-warehouse-columns` to check supported unquoted references with warehouse queries that return no rows. It's opt-in because it sends those queries; whether your warehouse scans or bills for them is warehouse-dependent, and the check needs warehouse credentials and the warehouse catalog. Warehouse-column errors are reported whether partial compilation is on or off.

See the [CLI compilation options](/workflow/cli/reference#partial-compilation) for the supported reference syntax and every skip condition.

To report the isolated failures as errors instead, use strict compilation:

```bash theme={null}
lightdash compile --no-partial-compilation
```

Combine it with warehouse-column validation when your project uses physical references:

```bash theme={null}
lightdash compile --no-partial-compilation --validate-warehouse-columns
```

## Compile a subset of your dbt models

If you only use a subset of your dbt models in Lightdash, specify that subset with dbt selection syntax. For example, to only compile models with the tag `lightdash`:

```bash theme={null}
lightdash compile --select tag:lightdash
```

See [`lightdash compile`](/workflow/cli/reference#lightdash-compile) in the CLI reference for every option.

## Run compilation in CI

To run `lightdash compile` on every pull request and catch errors before they're merged, use the compile workflow template. Follow [Compile your dbt project](/workflow/set-up-ci-cd#compile-your-dbt-project) in Automate with CI/CD.
