"""FastAPI dependency functions."""

from fastapi import Request


async def get_db(request: Request):
    """Dependency to get the shared DB connection."""
    return request.app.state.db


def get_project_id(owner: str, repo: str) -> str:
    """Reconstruct project_id from URL path segments."""
    return f"{owner}/{repo}"


def get_related_project_id(related_owner: str, related_repo: str) -> str:
    """Reconstruct related_project_id from URL path segments."""
    return f"{related_owner}/{related_repo}"
