18 lines
440 B
Python
18 lines
440 B
Python
from typing import Annotated
|
|
|
|
from fastapi import Depends
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
|
|
|
from api.domain.user import UserRepository
|
|
from api.infrastructure.persistence.repositories.user_repository import (
|
|
SqlAlchemyUserRepository,
|
|
)
|
|
|
|
from .stub import Stub
|
|
|
|
|
|
def get_user_repository(
|
|
session: Annotated[AsyncSession, Depends(Stub(AsyncSession))],
|
|
) -> UserRepository:
|
|
return SqlAlchemyUserRepository(session)
|