Skip to content

Commit

Permalink
feat: add fetchrow method to postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
martastain committed Oct 8, 2024
1 parent 35903c7 commit e98aa69
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ayon_server/lib/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e98aa69

Please sign in to comment.