MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / onerow

Method onerow

lib/sqlalchemy/engine/result.py:630–647  ·  view source on GitHub ↗
(self: Result[Any])

Source from the content-addressed store, hash-verified

628 uniques, strategy = self._unique_strategy
629
630 def onerow(self: Result[Any]) -> Union[_NoRow, _R]:
631 _onerow = self._fetchone_impl
632 while True:
633 row = _onerow()
634 if row is None:
635 return _NO_ROW
636 else:
637 obj: _InterimRowType[Any] = (
638 make_row(row) if make_row else row
639 )
640 hashed = strategy(obj) if strategy else obj
641 if hashed in uniques:
642 continue
643 else:
644 uniques.add(hashed)
645 if post_creational_filter:
646 obj = post_creational_filter(obj)
647 return obj # type: ignore
648
649 else:
650

Callers

nothing calls this directly

Calls 2

_fetchone_implMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected