MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / onerow

Method onerow

lib/sqlalchemy/engine/_result_cy.py:399–414  ·  view source on GitHub ↗
(self: Self)

Source from the content-addressed store, hash-verified

397 uniques, strategy = self._unique_strategy
398
399 def onerow(self: Self) -> Literal[_NoRow._NO_ROW] | _R:
400 while True:
401 row = self._fetchone_impl()
402 if row is None:
403 return _NO_ROW
404 else:
405 obj: _InterimRowType[Any] = (
406 make_row(row) if make_row is not None else row
407 )
408 hashed = strategy(obj) if strategy is not None else obj
409 if hashed in uniques:
410 continue
411 uniques.add(hashed)
412 if post_creational_filter is not None:
413 obj = post_creational_filter(obj)
414 return obj # type: ignore
415
416 else:
417

Callers

nothing calls this directly

Calls 2

_fetchone_implMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected