"""Runtime connection pool. Importing the app does not open it.""" from __future__ import annotations from psycopg.rows import dict_row from psycopg_pool import ConnectionPool from app.core.settings import Settings def open_pool(settings: Settings) -> ConnectionPool: return ConnectionPool( conninfo=settings.dsn(settings.db_runtime_user), kwargs={"row_factory": dict_row}, min_size=1, max_size=10, open=True, timeout=10, )