Subchapter 2.123
references/integrations/dagster-dbt/scaffolding.mdMarkdown2 KBView on GitHub
This guide covers the end-to-end process of creating a new DbtProjectComponent in a Dagster project.
For configuration and customization of an existing component, see
Component-Based Integration.
Ensure dagster-dbt is installed in the project:
uv add dagster-dbtIf the dbt project lives inside the Dagster repository:
dg scaffold defs dagster_dbt.DbtProjectComponent <component name> --project-path <path to dbt project>If the dbt project lives in a separate git repository:
dg scaffold defs dagster_dbt.DbtProjectComponent <component name> --git-url <git url> --project-path <repo-relative path to dbt project, default '.'>dbt requires a database-specific adapter library to compile the project manifest. Without it,
dbt parse will fail and no assets will be loaded.
profiles.yml file in the dbt project for the adapter type (look for the type: field
under the target configuration).profiles.yml, ask the user which database they are
targeting.uv add dbt-<adapter>Common adapters:
| Adapter | Package |
|---|---|
| DuckDB | dbt-duckdb |
| Snowflake | dbt-snowflake |
| BigQuery | dbt-bigquery |
| PostgreSQL | dbt-postgres |
| Redshift | dbt-redshift |
Always run dg list defs to confirm the manifest compiled and assets are visible:
dg list defsIf this returns no definitions, check that:
profiles.yml is properly configured