Represent a single result row. The :class:`.Row` object represents a row of a database result. It is typically associated in the 1.x series of SQLAlchemy with the :class:`_engine.CursorResult` object, however is also used by the ORM for tuple-like results as of SQLAlchemy 1.4. The :class:`.Row` object seeks to act as much like a Python named tuple as possible. For mapping (i.e. dictionary) behavior on a row, such as testing for containment of keys, refer to the :attr:`.Row._mapping` attribute. .. seealso:: :ref:`tutorial_selecting_data` - includes examples of selecting rows from SELECT statements. .. versionchanged:: 1.4 Renamed ``RowProxy`` to :class:`.Row`. :class:`.Row` is no longer a "proxy" object in that it contains the final form of data within it, and now acts mostly like a named tuple. Mapping-like functionality is moved to the :attr:`.Row._mapping` attribute. See :ref:`change_4710_core` for background on this change.
Method | __contains__ |
Undocumented |
Method | __delattr__ |
Undocumented |
Method | __eq__ |
Undocumented |
Method | __ge__ |
Undocumented |
Method | __getitem__ |
Undocumented |
Method | __gt__ |
Undocumented |
Method | __le__ |
Undocumented |
Method | __lt__ |
Undocumented |
Method | __ne__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __setattr__ |
Undocumented |
Method | tuple |
Return a 'tuple' form of this :class:`.Row`. |
Class Variable | __slots__ |
Undocumented |
Class Variable | count |
Undocumented |
Class Variable | index |
Undocumented |
Property | t |
a synonym for :attr:`.Row.tuple` |
Method | _asdict |
Return a new dict which maps field names to their corresponding values. |
Method | _filter |
Undocumented |
Method | _op |
Undocumented |
Method | _special |
Handle ambiguous names such as "count" and "index" |
Property | _fields |
Return a tuple of string keys as represented by this :class:`.Row`. |
Property | _mapping |
Return a :class:`.RowMapping` for this :class:`.Row`. |
Inherited from BaseRow
:
Method | __getattr__ |
Undocumented |
Method | __getstate__ |
Undocumented |
Method | __hash__ |
Undocumented |
Method | __init__ |
Row objects are constructed by CursorResult objects. |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | __reduce__ |
Undocumented |
Method | __setstate__ |
Undocumented |
Method | _get |
Undocumented |
Method | _get |
Undocumented |
Method | _values |
Undocumented |
Class Variable | _data |
Undocumented |
Class Variable | _key |
Undocumented |
Class Variable | _keymap |
Undocumented |
Class Variable | _parent |
Undocumented |
Return a 'tuple' form of this :class:`.Row`. At runtime, this method returns "self"; the :class:`.Row` object is already a named tuple. However, at the typing level, if this :class:`.Row` is typed, the "tuple" return type will be a :pep:`484` ``Tuple`` datatype that contains typing information about individual elements, supporting typed unpacking and attribute access. .. versionadded:: 2.0 .. seealso:: :meth:`.Result.tuples`
Return a new dict which maps field names to their corresponding values. This method is analogous to the Python named tuple ``._asdict()`` method, and works by applying the ``dict()`` constructor to the :attr:`.Row._mapping` attribute. .. versionadded:: 1.4 .. seealso:: :attr:`.Row._mapping`
Optional[ Sequence[ Optional[ _ResultProcessorType[ Any]]]]
) -> Row[ Any]
:
(source)
¶
Undocumented
Return a tuple of string keys as represented by this :class:`.Row`. The keys can represent the labels of the columns returned by a core statement or the names of the orm classes returned by an orm execution. This attribute is analogous to the Python named tuple ``._fields`` attribute. .. versionadded:: 1.4 .. seealso:: :attr:`.Row._mapping`