MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / one

Method one

lib/sqlalchemy/engine/result.py:1718–1728  ·  view source on GitHub ↗

Return exactly one object or raise an exception. Equivalent to :meth:`_engine.Result.one` except that :class:`_engine.RowMapping` values, rather than :class:`_engine.Row` objects, are returned.

(self)

Source from the content-addressed store, hash-verified

1716 )
1717
1718 def one(self) -> RowMapping:
1719 """Return exactly one object or raise an exception.
1720
1721 Equivalent to :meth:`_engine.Result.one` except that
1722 :class:`_engine.RowMapping` values, rather than :class:`_engine.Row`
1723 objects, are returned.
1724
1725 """
1726 return self._only_one_row(
1727 raise_for_second_row=True, raise_for_none=True, scalar=False
1728 )
1729
1730
1731class FrozenResult(Generic[Unpack[_Ts]]):

Callers

nothing calls this directly

Calls 1

_only_one_rowMethod · 0.80

Tested by

no test coverage detected