diff --git a/ayon_server/lib/postgres.py b/ayon_server/lib/postgres.py index dbc1e8d2..34c1c297 100644 --- a/ayon_server/lib/postgres.py +++ b/ayon_server/lib/postgres.py @@ -151,6 +151,14 @@ async def fetch(cls, query: str, *args: Any, timeout: float = 60): async with cls.acquire() as connection: return await connection.fetch(query, *args, timeout=timeout) + @classmethod + async def fetchrow(cls, query: str, *args: Any, timeout: float = 60): + """Run a query and return the first row as a Record.""" + if cls.pool is None: + raise ConnectionError + async with cls.acquire() as connection: + return await connection.fetchrow(query, *args, timeout=timeout) + @classmethod async def iterate( cls,