Skip to content

v0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 23 Mar 04:19

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 (or ActiveRecordBaseModel by default).
    • Now: it requires async_scoped_session explicitly as the first argument.
  • DBConnection.close() signature has changed:
    • Before: accepted an optional base_model.
    • Now: takes no arguments.
  • 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_sessionmaker via configure(bind=None),
    • and disposes the engine via dispose().

Fixed

  • After close(), attempts to reuse the session for query execution now fail explicitly due to missing bind (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 through DBConnection.close().