Run a query and return the results as a list of :class:`Record`. Pool performs this operation using one of its connections. Other than that, it behaves identically to :meth:`Connection.fetch() `. .. versionadded:: 0.10.0
(
self,
query,
*args,
timeout=None,
record_class=None
)
| 728 | return await con.executemany(command, args, timeout=timeout) |
| 729 | |
| 730 | async def fetch( |
| 731 | self, |
| 732 | query, |
| 733 | *args, |
| 734 | timeout=None, |
| 735 | record_class=None |
| 736 | ) -> list: |
| 737 | """Run a query and return the results as a list of :class:`Record`. |
| 738 | |
| 739 | Pool performs this operation using one of its connections. Other than |
| 740 | that, it behaves identically to |
| 741 | :meth:`Connection.fetch() <asyncpg.connection.Connection.fetch>`. |
| 742 | |
| 743 | .. versionadded:: 0.10.0 |
| 744 | """ |
| 745 | async with self.acquire() as con: |
| 746 | return await con.fetch( |
| 747 | query, |
| 748 | *args, |
| 749 | timeout=timeout, |
| 750 | record_class=record_class |
| 751 | ) |
| 752 | |
| 753 | async def fetchval(self, query, *args, column=0, timeout=None): |
| 754 | """Run a query and return a value in the first row. |