Skip to content

PrismaFrontendDB

fastagency.studio.db.prisma.PrismaFrontendDB #

Bases: FrontendDBProtocol, PrismaBaseDB

ENV_VAR class-attribute instance-attribute #

ENV_VAR = 'DATABASE_URL'

get_user async #

get_user(user_uuid: Union[str, UUID]) -> Any
Source code in fastagency/studio/db/prisma.py
async def get_user(self, user_uuid: Union[str, UUID]) -> Any:
    async with self._get_db_connection() as db:
        select_query = 'SELECT * from "User" where uuid=' + f"'{user_uuid}'"  # nosec: [B608]
        user = await db.query_first(
            select_query  # nosec: [B608]
        )
    if not user:
        raise KeyNotFoundError(f"user_uuid {user_uuid} not found")
    return user