MCPcopy
hub / github.com/psycopg/psycopg / fetchone

Method fetchone

psycopg/psycopg/cursor_async.py:241–255  ·  view source on GitHub ↗

Return the next record from the current result set. Return `!None` the result set is finished. :rtype: Row | None, with Row defined by `row_factory`

(self)

Source from the content-addressed store, hash-verified

239 return self
240
241 async def fetchone(self) -> Row | None:
242 """
243 Return the next record from the current result set.
244
245 Return `!None` the result set is finished.
246
247 :rtype: Row | None, with Row defined by `row_factory`
248 """
249 await self._fetch_pipeline()
250 res = self._check_result_for_fetch()
251 if self._pos < res.ntuples:
252 record = self._tx.load_row(self._pos, self._make_row)
253 self._pos += 1
254 return record
255 return None
256
257 async def fetchmany(self, size: int = 0) -> list[Row]:
258 """

Callers

nothing calls this directly

Calls 3

_fetch_pipelineMethod · 0.95
load_rowMethod · 0.45

Tested by

no test coverage detected