class documentation

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_on_values Undocumented
Method _op Undocumented
Method _special_name_accessor 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_by_int_impl Undocumented
Method _get_by_key_impl_mapping Undocumented
Method _values_impl Undocumented
Class Variable _data Undocumented
Class Variable _key_style Undocumented
Class Variable _keymap Undocumented
Class Variable _parent Undocumented
def __contains__(self, key: Any) -> bool: (source)

Undocumented

def __delattr__(self, name: str) -> NoReturn: (source)

Undocumented

def __eq__(self, other: Any) -> bool: (source)

Undocumented

def __ge__(self, other: Any) -> bool: (source)

Undocumented

@overload
def __getitem__(self, index: int) -> Any:
@overload
def __getitem__(self, index: slice) -> Sequence[Any]:
(source)

Undocumented

def __gt__(self, other: Any) -> bool: (source)

Undocumented

def __le__(self, other: Any) -> bool: (source)

Undocumented

def __lt__(self, other: Any) -> bool: (source)

Undocumented

def __ne__(self, other: Any) -> bool: (source)

Undocumented

def __repr__(self) -> str: (source)

Undocumented

def __setattr__(self, name: str, value: Any) -> NoReturn: (source)

Undocumented

def tuple(self) -> _TP: (source)

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`

Undocumented

Undocumented

a synonym for :attr:`.Row.tuple` .. versionadded:: 2.0 .. seealso:: :meth:`.Result.t`

def _asdict(self) -> Dict[str, Any]: (source)

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`

def _filter_on_values(self, filters: Optional[Sequence[Optional[_ResultProcessorType[Any]]]]) -> Row[Any]: (source)

Undocumented

def _op(self, other: Any, op: Callable[[Any, Any], bool]) -> bool: (source)

Undocumented

def _special_name_accessor(name: str) -> Any: (source)

Handle ambiguous names such as "count" and "index"

@property
_fields: Tuple[str, ...] = (source)

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`

Return a :class:`.RowMapping` for this :class:`.Row`. This object provides a consistent Python mapping (i.e. dictionary) interface for the data contained within the row. The :class:`.Row` by itself behaves like a named tuple. .. seealso:: :attr:`.Row._fields` .. versionadded:: 1.4