# DuckDB | DRE

> The duckdb source: profile fields and notes.

You're reading the docs for DRE 0.4 (v0.4.4). [This page for 0.5](https://getdre.com/docs/plugin-duckdb/) · [New in 0.5](https://getdre.com/docs/new-in-0.5/)

# DuckDB

DuckDB database files: the `duckdb` source, from the `duckdb` package. Declare the package once in `dependencies.yml`; DRE installs it on demand:

dependencies.yml

```yaml
plugins:
  - duckdb
```

### Profile fields

Set in `profiles.yml`, under `connections:`, in a target with `type: duckdb`.

Field

Default

Notes

`path`

`:memory:`

DuckDB database file (relative to the project), or :memory:.

`threads`

Number of threads DuckDB may use.

`memory_limit`

DuckDB memory limit, e.g. 4GB.

## Notes

Field

Notes

`path`

Database file, relative to the project directory. Default `:memory:`.

`threads`, `memory_limit`

Passed to DuckDB.

Capabilities: `sessions`, `read_only`, `check` (via `EXPLAIN`).

## Run without a database server

Use DuckDB for local examples, SQL over files and reproducible report tests. A memory database exists for one connection session; use a file path for tables that must survive runs.

profiles.yml

```yaml
connections:
  warehouse:
    targets:
      dev: {type: duckdb, path: ":memory:"}
```

dre\_project.yml

```yaml
name: local_reports
default_profile: warehouse
```

```sql
-- reports/check/check.sql
select 'local' as environment, 42 as row_count
```

```yaml
# reports/check/check.yml; also declare csv in dependencies.yml
queries: [check]
output: {format: csv}
```

`dre run check --preview 5` writes a local sample. The complete [tutorial project](https://github.com/get-dre/dre/blob/v0.4.4/examples/tutorial/) includes dependencies and every file. For a real file-backed report, set `path: reporting.duckdb` relative to the project root. `threads` controls DuckDB work as well as Binding concurrency; `memory_limit: 1GB` bounds DuckDB’s memory, not the xlsx writer’s memory.

`connection-failed` can mean another process holds the database file; close its writer and retry. `query-failed` on a missing table in `:memory:` means this session has not created or loaded it. Put setup SQL before the result query, using `tab: false`. See [connections](https://getdre.com/docs/v0.4/connections/), [report keys](https://getdre.com/docs/v0.4/reference-report/), [error codes](https://getdre.com/docs/v0.4/reference-error-codes/), and [source plugin](https://getdre.com/docs/v0.4/glossary/#source-plugin).

[Previous  
Databricks](https://getdre.com/docs/v0.4/plugin-databricks/)[Next  
Email](https://getdre.com/docs/v0.4/plugin-email/)
