0.4.0 (2026-03-22)
Introduced breaking API changes in connection and execution handling to make async session management explicit and enforce a stronger shutdown flow.
Breaking Changes
execute()signature has changed:- Before: session was resolved from
base_model(orActiveRecordBaseModelby default). - Now: it requires
async_scoped_sessionexplicitly as the first argument.
- Before: session was resolved from
DBConnection.close()signature has changed:- Before: accepted an optional
base_model. - Now: takes no arguments.
- Before: accepted an optional
SessionMixin.close_session()has been removed.
Changed
DBConnection.init_db()now supports multiple base models via*base_models.DBConnection.close()now performs a hard shutdown flow:- removes the scoped session from the current scope with
remove(), - unbinds
async_sessionmakerviaconfigure(bind=None), - and disposes the engine via
dispose().
- removes the scoped session from the current scope with
Fixed
- After
close(), attempts to reuse the session for query execution now fail explicitly due to missingbind(intended behavior to prevent accidental reuse).
Migration Notes
- Replace:
await execute(query, BaseModel)→await execute(conn.async_scoped_session, query)await conn.close(BaseModel)→await conn.close()
- If you relied on
SessionMixin.close_session(), remove that call and manage lifecycle throughDBConnection.close().