14 lines
481 B
Python
14 lines
481 B
Python
import uuid
|
|
|
|
from shared.postgres.postgres_helper import DatabaseConfig, DatabaseHelper
|
|
from src import domain
|
|
|
|
|
|
class Postgres(DatabaseHelper):
|
|
def __init__(self, config: DatabaseConfig, migrations_path: str = 'migration/versions') -> None:
|
|
super().__init__(config, migrations_path)
|
|
|
|
async def get_user(self, user_id: uuid.UUID) -> domain.User | None:
|
|
async with self.session_getter() as session:
|
|
return await session.get(domain.User, user_id)
|