Skip to content

Commit ebae8e4

Browse files
committed
Add record_class parameter Pool.fetch and Pool.fetchrow
1 parent a2f093d commit ebae8e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

asyncpg/pool.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ async def executemany(self, command: str, args, *, timeout: float=None):
576576
async with self.acquire() as con:
577577
return await con.executemany(command, args, timeout=timeout)
578578

579-
async def fetch(self, query, *args, timeout=None) -> list:
579+
async def fetch(self, query, *args, timeout=None, record_class=None) -> list:
580580
"""Run a query and return the results as a list of :class:`Record`.
581581
582582
Pool performs this operation using one of its connections. Other than
@@ -586,7 +586,7 @@ async def fetch(self, query, *args, timeout=None) -> list:
586586
.. versionadded:: 0.10.0
587587
"""
588588
async with self.acquire() as con:
589-
return await con.fetch(query, *args, timeout=timeout)
589+
return await con.fetch(query, *args, timeout=timeout, record_class=record_class)
590590

591591
async def fetchval(self, query, *args, column=0, timeout=None):
592592
"""Run a query and return a value in the first row.
@@ -602,7 +602,7 @@ async def fetchval(self, query, *args, column=0, timeout=None):
602602
return await con.fetchval(
603603
query, *args, column=column, timeout=timeout)
604604

605-
async def fetchrow(self, query, *args, timeout=None):
605+
async def fetchrow(self, query, *args, timeout=None, record_class=None):
606606
"""Run a query and return the first row.
607607
608608
Pool performs this operation using one of its connections. Other than
@@ -612,7 +612,7 @@ async def fetchrow(self, query, *args, timeout=None):
612612
.. versionadded:: 0.10.0
613613
"""
614614
async with self.acquire() as con:
615-
return await con.fetchrow(query, *args, timeout=timeout)
615+
return await con.fetchrow(query, *args, timeout=timeout, record_class=record_class)
616616

617617
async def copy_from_table(
618618
self,

0 commit comments

Comments
 (0)