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

# dbt Connector Overview

> Run production-grade dbt projects directly on Dune with full incremental model support

The dbt Connector enables you to run production-grade dbt projects directly against Dune's data warehouse using the [dbt-trino adapter](https://docs.getdbt.com/docs/core/connect-data-platform/trino-setup). Build, test, and deploy transformation pipelines with full support for incremental models, testing frameworks, and CI/CD orchestration.

This connector provides **write access to DuneSQL** via a Trino API endpoint, enabling you to create, update, and manage tables in your private namespace while reading from Dune's comprehensive blockchain datasets.

Enterprise teams can also use dbt to publish transformed tables from Dune into a configured Datashare target. See [dbt to Datashare](/api-reference/connectors/dbt/datashares).

<Card title="dbt Template Repository" icon="github" href="https://github.com/duneanalytics/dune-dbt-template">
  Get started quickly with our official dbt template repository, featuring example models for all model strategies and CI/CD workflows.
</Card>

<Card title="dbt to Datashare" icon="share-nodes" href="/api-reference/connectors/dbt/datashares">
  Sync dbt-managed tables from your Dune namespace into Snowflake or BigQuery.
</Card>

<Warning>
  The dbt Connector is currently only available to Enterprise customers with Data Transformations enabled.
</Warning>

<Tip>
  Interested in having the dbt Connector enabled for your team? [Contact our team](https://dune.com/enterprise)—please mention the dbt Connector when you reach out.
</Tip>

<Note>
  **Credits & CI/CD**

  Each dbt run consumes Dune credits, including runs triggered by CI/CD pipelines. If you're using GitHub Actions or similar tools, we recommend reviewing [Pricing & Best Practices](/api-reference/connectors/dbt/pricing-best-practices) for optimization tips and [CI/CD & Workflows](/api-reference/connectors/dbt/cicd-workflows) for guidance on configuring triggers.
</Note>

## Video Tutorial

Watch this step-by-step guide to get started with the dbt Connector on Dune:

<iframe width="560" height="315" src="https://www.youtube.com/embed/TRqqPC0PcZU" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen />

## What is dbt?

[dbt (data build tool)](https://www.getdbt.com/) is the industry-standard framework for analytics engineering. It enables data teams to transform raw data into analysis-ready datasets using SQL and software engineering best practices.

**Key capabilities:**

* **SQL-based transformations**: Write SELECT statements, dbt handles the DDL/DML
* **Incremental models**: Efficiently update large tables with merge, append, or delete+insert strategies
* **Testing & documentation**: Built-in data quality tests and auto-generated documentation
* **Version control**: Manage transformation logic in Git with code review workflows
* **Dependency management**: Define relationships between models with automatic execution ordering

<Card title="dbt Documentation" icon="book" href="https://docs.getdbt.com/">
  Learn more about dbt's features, best practices, and advanced capabilities in the official dbt documentation.
</Card>

## Why dbt on Dune?

### Enterprise-Grade Transformations

* **Full incremental support**: Use merge, delete+insert, or append strategies for efficient updates
* **Warehouse publishing**: Sync transformation outputs to a configured Datashare target
* **Testing framework**: Validate data quality with dbt's built-in testing capabilities
* **Documentation**: Generate and maintain documentation alongside your transformations
* **Modularity**: Build reusable models and macros for complex transformation logic

### Seamless Integration

* **Drop-in compatibility**: Works with your existing dbt projects and workflows
* **Version control**: Manage transformation logic in Git with PR reviews
* **Production orchestration**: Schedule with GitHub Actions, Airflow, Prefect, or dbt Cloud. See [Pricing & Best Practices](/api-reference/connectors/dbt/pricing-best-practices) for credit optimization tips
* **Private by default**: Keep proprietary transformation logic within your organization

### No Spellbook Dependency

* **Autonomous deployment**: Deploy transformations on your schedule without community review
* **Proprietary logic**: Keep sensitive business logic private
* **Faster iteration**: Test and deploy changes immediately

## Connection Details

Connect to Dune using these parameters:

| Parameter            | Value                                                  |
| -------------------- | ------------------------------------------------------ |
| **Host**             | `trino.api.dune.com`                                   |
| **Port**             | `443`                                                  |
| **Protocol**         | HTTPS                                                  |
| **Catalog**          | `dune` (required)                                      |
| **Authentication**   | JWT (use your Dune API key)                            |
| **Session Property** | `transformations=true` (required for write operations) |

<Warning>
  The session property `transformations=true` is **required** for all write operations. Without it, DDL and DML statements will be rejected.
</Warning>

## Use Cases

### Enterprise Data Pipelines

Add Dune to your existing data infrastructure without reworking your workflows:

* **Drop-in compatibility**: Integrate with your current dbt projects, Airflow DAGs, or Prefect flows
* **Full incremental support**: Use merge, delete+insert, or append strategies for efficient updates
* **Production orchestration**: Schedule with the tools you already use (GitHub Actions, Airflow, Prefect)
* **Version controlled**: Keep all transformation logic in Git alongside your other data pipelines

### Governance & Compliance

Meet enterprise requirements for data control and auditability:

* **Private by default**: All datasets remain private to your team unless explicitly shared
* **Audit trails**: Track every transformation through Git history and PR workflows
* **Data lineage**: Maintain clear lineage from raw data through transformations to analytics
* **Review processes**: Implement PR reviews and approval workflows before deploying to production
* **Access control**: Restrict write access to specific teams and namespaces

### Complex Analytics Workflows

Build sophisticated multi-stage data pipelines:

* Read from Dune's comprehensive blockchain datasets across all chains
* Transform and enrich with your proprietary business logic
* Create reusable intermediate datasets for downstream analytics
* Chain multiple transformations into complex data products

### Alternative to Spellbook

Build and maintain custom datasets without community review processes:

* Deploy transformations on your own schedule
* Keep proprietary logic private to your organization
* Faster iteration cycles without PR review delays

## Next Steps

<CardGroup cols={2}>
  <Card title="Getting Started" icon="rocket" href="/api-reference/connectors/dbt/getting-started">
    Set up your dbt project and connect to Dune
  </Card>

  <Card title="Incremental Models" icon="layer-group" href="/api-reference/connectors/dbt/incremental-models">
    Learn about merge, delete+insert, and append strategies
  </Card>

  <Card title="dbt to Datashare" icon="share-nodes" href="/api-reference/connectors/dbt/datashares">
    Publish dbt-managed tables to your configured Datashare target
  </Card>

  <Card title="CI/CD & Workflows" icon="code-branch" href="/api-reference/connectors/dbt/cicd-workflows">
    Set up GitHub Actions and development workflows
  </Card>

  <Card title="Pricing & Best Practices" icon="credit-card" href="/api-reference/connectors/dbt/pricing-best-practices">
    Understand credit consumption and optimization tips
  </Card>
</CardGroup>

## SQLMesh Compatibility

<Note>
  [SQLMesh](https://sqlmesh.com/) also works out of the box with Dune using the same Trino connection approach described above. If you prefer SQLMesh over dbt for your data transformation workflows, you can connect it to Dune using the [SQLMesh Trino adapter](https://sqlmesh.readthedocs.io/en/stable/integrations/engines/trino/) with the same connection parameters.

  We plan to release a dedicated SQLMesh template in the future. Until then, follow the same connection setup (host, port, authentication, and session properties) to get started with SQLMesh on Dune.
</Note>
