MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / fetch

Method fetch

asyncpg/cursor.py:269–284  ·  view source on GitHub ↗

r"""Return the next *n* rows as a list of :class:`Record` objects. :param float timeout: Optional timeout value in seconds. :return: A list of :class:`Record` instances.

(self, n, *, timeout=None)

Source from the content-addressed store, hash-verified

267
268 @connresource.guarded
269 async def fetch(self, n, *, timeout=None):
270 r"""Return the next *n* rows as a list of :class:`Record` objects.
271
272 :param float timeout: Optional timeout value in seconds.
273
274 :return: A list of :class:`Record` instances.
275 """
276 self._check_ready()
277 if n <= 0:
278 raise exceptions.InterfaceError('n must be greater than zero')
279 if self._exhausted:
280 return []
281 recs = await self._exec(n, timeout)
282 if len(recs) < n:
283 self._exhausted = True
284 return recs
285
286 @connresource.guarded
287 async def fetchrow(self, *, timeout=None):

Callers

nothing calls this directly

Calls 2

_check_readyMethod · 0.80
_execMethod · 0.80

Tested by

no test coverage detected