DuckDB guide¶
Install the DuckDB extra:
Or with uv:
Connection¶
DuckDBConfig supports file-backed and in-memory databases.
For a pool with more than one connection, use a file path. Each in-memory connection gets its own isolated database — sharing state across connections is not possible with :memory:.
File-backed¶
from adbc_poolhouse import DuckDBConfig, create_pool
config = DuckDBConfig(database="/tmp/warehouse.db")
pool = create_pool(config)
In-memory (single connection)¶
pool_size is forced to 1 for in-memory databases. Requesting a larger pool would give each connection its own empty database, which is almost always unintended.
Read-only¶
Loading from environment variables¶
DuckDBConfig reads all fields from environment variables with the DUCKDB_ prefix:
See also¶
- Configuration reference — env_prefix, pool tuning
- Pool lifecycle — close_pool, pytest fixtures