SQLite guide¶
Installation¶
Install the SQLite extra:
Or with uv:
Connection¶
SQLiteConfig supports file-backed and in-memory databases.
For a pool with more than one connection, use a file path. In-memory SQLite is shared across all connections in the pool, unlike DuckDB, where each connection gets its own isolated database.
File-backed¶
from adbc_poolhouse import SQLiteConfig, create_pool
config = SQLiteConfig(database="/tmp/warehouse.db")
pool = create_pool(config)
In-memory¶
pool_size defaults to 1 for in-memory databases and cannot be raised. All connections in the pool share the same in-memory database, unlike DuckDB, where each connection gets its own isolated database, so pool_size > 1 would race connection state on that single database. Combining pool_size > 1 with :memory: raises ConfigurationError (wrapped as a Pydantic ValidationError).
Loading from environment variables¶
SQLiteConfig reads all fields from environment variables with the SQLITE_ prefix:
See also¶
- Configuration — env_prefix, pool tuning
- Pool lifecycle — close_pool, pytest fixtures