Skip to content

SQLite guide

Installation

Install the SQLite extra:

pip install adbc-poolhouse[sqlite]

Or with uv:

uv add "adbc-poolhouse[sqlite]"

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).

config = SQLiteConfig(database=":memory:")
pool = create_pool(config)

Loading from environment variables

SQLiteConfig reads all fields from environment variables with the SQLITE_ prefix:

export SQLITE_DATABASE=/data/warehouse.db
export SQLITE_POOL_SIZE=3
config = SQLiteConfig()  # reads from env

See also