I noticed that in the current implementation of the UserSQLAlchemyRepo, each repository method creates a new session using the session_factory() context manager. It can lead to potential performance issues when multiple repository methods are called sequentially within the same service layer function.
I noticed that in the current implementation of the UserSQLAlchemyRepo, each repository method creates a new session using the session_factory() context manager. It can lead to potential performance issues when multiple repository methods are called sequentially within the same service layer function.
https://github.com/teamhide/fastapi-boilerplate/blob/ca3bb3fa5686cb031d6cd99d45b34fd7d2b12494/core/db/session.py#L51-L76
https://github.com/teamhide/fastapi-boilerplate/blob/ca3bb3fa5686cb031d6cd99d45b34fd7d2b12494/app/user/adapter/output/persistence/sqlalchemy/user.py#L29-L39