Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions 24 asyncpg/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,13 @@ async def executemany(self, command: str, args, *, timeout: float=None):
async with self.acquire() as con:
return await con.executemany(command, args, timeout=timeout)

async def fetch(self, query, *args, timeout=None) -> list:
async def fetch(
self,
query,
*args,
timeout=None,
record_class=None
) -> list:
"""Run a query and return the results as a list of :class:`Record`.

Pool performs this operation using one of its connections. Other than
Expand All @@ -586,7 +592,12 @@ async def fetch(self, query, *args, timeout=None) -> list:
.. versionadded:: 0.10.0
"""
async with self.acquire() as con:
return await con.fetch(query, *args, timeout=timeout)
return await con.fetch(
query,
*args,
timeout=timeout,
record_class=record_class
)

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

async def fetchrow(self, query, *args, timeout=None):
async def fetchrow(self, query, *args, timeout=None, record_class=None):
"""Run a query and return the first row.

Pool performs this operation using one of its connections. Other than
Expand All @@ -612,7 +623,12 @@ async def fetchrow(self, query, *args, timeout=None):
.. versionadded:: 0.10.0
"""
async with self.acquire() as con:
return await con.fetchrow(query, *args, timeout=timeout)
return await con.fetchrow(
query,
*args,
timeout=timeout,
record_class=record_class
)

async def copy_from_table(
self,
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.