dbt-duckdb Adapter

1.10.1 · active · verified Fri Apr 10

dbt-duckdb is the adapter that connects dbt (data build tool) with DuckDB, an embedded analytical database. It allows users to manage and transform data using SQL or Python models, enabling a powerful local data stack or data lakehouse architecture. The library is actively maintained with frequent releases, currently at version 1.10.1.

Warnings

Install

Quickstart

This quickstart guides you through initializing a dbt project, configuring the `dbt-duckdb` adapter in your `profiles.yml` for local storage, and running a simple dbt model. The `path` field is crucial for data persistence.

mkdir my_dbt_project
cd my_dbt_project
dbt init my_dbt_project_name
# Edit ~/.dbt/profiles.yml (or profiles.yml in project root)
# Add the following profile:
#
#   my_dbt_project_name:
#     target: dev
#     outputs:
#       dev:
#         type: duckdb
#         path: /tmp/dbt.duckdb  # Or './dbt_warehouse.duckdb' for project-local persistence
#         threads: 4
#
dbt debug --profile my_dbt_project_name
# Expected output: Connection test successful.

# Create a simple SQL model (e.g., models/my_model.sql)
# -- my_model.sql --
# SELECT 1 as id, 'hello' as message

# Run your dbt models
dbt run

view raw JSON →