Skip to content

Migrate database access from synchronous SQLAlchemy Session to AsyncSession. #97

@abocianowski-themomentumai

Description

def _get_db_dependency() -> Iterator[Session]:

Replace create_engine with create_async_engine
Replace Session and sessionmaker with AsyncSession and async_sessionmaker
Change DB dependency from Iterator to AsyncIterator
Update repositories to use await session.execute
Update service layer to await commit flush and refresh

Goal
Ensure non blocking database IO and consistent async flow

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions