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.
pip install dbt-core dbt-duckdbNo compatibility data collected yet for this library.
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.
Upgrade your Python environment to version 3.10 or later.
Modify your installation command to `pip install dbt-core dbt-duckdb` and ensure your `dbt-core` version meets the adapter's requirements.
Always set the `path` configuration in your `profiles.yml` to a file path on your filesystem to enable data persistence. Use `:memory:` explicitly if non-persistence is desired.
If encountering conflicts, consider isolating dbt-duckdb in a dedicated virtual environment or checking if other dependencies can tolerate `logbook < 1.9`. Report issues if this impacts critical functionality.
Update your dbt models and configurations to use the current, supported methods for interacting with DeltaLake if applicable. Refer to the dbt-duckdb documentation for updated patterns.
Be aware of these limitations when designing solutions for MotherDuck. Test thoroughly if using advanced SQL features or custom extensions.
Ensure both 'dbt-core' and 'dbt-duckdb' are installed together in a dedicated Python virtual environment using compatible versions. The recommended installation command is `python -m pip install dbt-core dbt-duckdb`.
Create a virtual environment named 'dbtenv' within your dbt project directory (or ensure it's in your environment path), activate it, and install all necessary Python packages (e.g., `pip install pandas`). dbt automatically detects and uses this `dbtenv` environment for Python model execution.
Ensure that no other applications or dbt processes are currently accessing the specified `.duckdb` file. Disconnect any database clients or terminate other dbt runs that might be holding a lock on the database file.
For Python models, verify the incremental logic, ensuring `dbt.is_incremental` is handled properly and that the model returns a `pandas.DataFrame` or `polars.DataFrame`. For external tables, double-check your `profiles.yml` for correct S3 configuration (region, access keys, required extensions like `httpfs`, `parquet`, `aws`) and confirm the `external_location` path is valid and accessible with the provided credentials.