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
)
| 611 | return await con.executemany(command, args, timeout=timeout) |
| 612 | |
| 613 | async def fetch( |
| 614 | self, |
| 615 | query, |
| 616 | *args, |
| 617 | timeout=None, |
| 618 | record_class=None |
| 619 | ) -> list: |
| 620 | """Run a query and return the results as a list of :class:`Record`. |
| 621 | |
| 622 | Pool performs this operation using one of its connections. Other than |
| 623 | that, it behaves identically to |
| 624 | :meth:`Connection.fetch() <asyncpg.connection.Connection.fetch>`. |
| 625 | |
| 626 | .. versionadded:: 0.10.0 |
| 627 | """ |
| 628 | async with self.acquire() as con: |
| 629 | return await con.fetch( |
| 630 | query, |
| 631 | *args, |
| 632 | timeout=timeout, |
| 633 | record_class=record_class |
| 634 | ) |
| 635 | |
| 636 | async def fetchval(self, query, *args, column=0, timeout=None): |
| 637 | """Run a query and return a value in the first row. |