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

Method fetchrow

asyncpg/prepared_stmt.py:200–212  ·  view source on GitHub ↗

Execute the statement and return the first row. :param str query: Query text :param args: Query arguments :param float timeout: Optional timeout value in seconds. :return: The first row as a :class:`Record` instance.

(self, *args, timeout=None)

Source from the content-addressed store, hash-verified

198
199 @connresource.guarded
200 async def fetchrow(self, *args, timeout=None):
201 """Execute the statement and return the first row.
202
203 :param str query: Query text
204 :param args: Query arguments
205 :param float timeout: Optional timeout value in seconds.
206
207 :return: The first row as a :class:`Record` instance.
208 """
209 data = await self.__bind_execute(args, 1, timeout)
210 if not data:
211 return None
212 return data[0]
213
214 @connresource.guarded
215 async def fetchmany(self, args, *, timeout=None):

Callers

nothing calls this directly

Calls 1

__bind_executeMethod · 0.95

Tested by

no test coverage detected