Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé
Module « sqlalchemy »

Classe « CursorResult »

Informations générales

Héritage

    builtins.object
        Generic
builtins.object
    HasMemoized
        InPlaceGenerative
            ResultInternal
        builtins.object
            _WithKeys
                Result
                    CursorResult

Définition

class CursorResult(Result):

help(CursorResult)

A Result that is representing state from a DBAPI cursor.

.. versionchanged:: 1.4  The :class:`.CursorResult``
   class replaces the previous :class:`.ResultProxy` interface.
   This classes are based on the :class:`.Result` calling API
   which provides an updated usage model and calling facade for
   SQLAlchemy Core and SQLAlchemy ORM.

Returns database rows via the :class:`.Row` class, which provides
additional API features and behaviors on top of the raw data returned by
the DBAPI.   Through the use of filters such as the :meth:`.Result.scalars`
method, other kinds of objects may also be returned.

.. seealso::

    :ref:`tutorial_selecting_data` - introductory material for accessing
    :class:`_engine.CursorResult` and :class:`.Row` objects.

Constructeur(s)

Signature du constructeur Description
__init__(self, context: 'DefaultExecutionContext', cursor_strategy: 'ResultFetchStrategy', cursor_description: 'Optional[_DBAPICursorDescription]')

Liste des attributs statiques

Nom de l'attribut Valeur
closedFalse
connection<member 'connection' of 'CursorResult' objects>
context<member 'context' of 'CursorResult' objects>
cursor<member 'cursor' of 'CursorResult' objects>
cursor_strategy<member 'cursor_strategy' of 'CursorResult' objects>
dialect<member 'dialect' of 'CursorResult' objects>
rowcount<sqlalchemy.util.langhelpers._memoized_property object at 0x0000020DA0D47350>

Liste des propriétés

Nom de la propriétéDescription
inserted_primary_keyReturn the primary key for the row just inserted. [extrait de inserted_primary_key.__doc__]
inserted_primary_key_rowsReturn the value of [extrait de inserted_primary_key_rows.__doc__]
is_insertTrue if this :class:`_engine.CursorResult` is the result [extrait de is_insert.__doc__]
lastrowidReturn the 'lastrowid' accessor on the DBAPI cursor. [extrait de lastrowid.__doc__]
returned_defaultsReturn the values of default columns that were fetched using [extrait de returned_defaults.__doc__]
returned_defaults_rowsReturn a list of rows each containing the values of default [extrait de returned_defaults_rows.__doc__]
returns_rowsTrue if this :class:`_engine.CursorResult` returns zero or more [extrait de returns_rows.__doc__]
tApply a "typed tuple" typing filter to returned rows. [extrait de t.__doc__]

Propriétés héritées de la classe Result

closed

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__class_getitem__ Parameterizes a generic class. [extrait de __class_getitem__.__doc__]
close(self) -> 'Any' Close this :class:`_engine.CursorResult`. [extrait de close.__doc__]
last_inserted_params(self) Return the collection of inserted parameters from this [extrait de last_inserted_params.__doc__]
last_updated_params(self) Return the collection of updated parameters from this [extrait de last_updated_params.__doc__]
lastrow_has_defaults(self) Return ``lastrow_has_defaults()`` from the underlying [extrait de lastrow_has_defaults.__doc__]
merge(self, *others: 'Result[Any]') -> 'MergedResult[Any]'
postfetch_cols(self) Return ``postfetch_cols()`` from the underlying [extrait de postfetch_cols.__doc__]
prefetch_cols(self) Return ``prefetch_cols()`` from the underlying [extrait de prefetch_cols.__doc__]
splice_horizontally(self, other) Return a new :class:`.CursorResult` that "horizontally splices" [extrait de splice_horizontally.__doc__]
splice_vertically(self, other) Return a new :class:`.CursorResult` that "vertically splices", [extrait de splice_vertically.__doc__]
supports_sane_multi_rowcount(self) Return ``supports_sane_multi_rowcount`` from the dialect. [extrait de supports_sane_multi_rowcount.__doc__]
supports_sane_rowcount(self) Return ``supports_sane_rowcount`` from the dialect. [extrait de supports_sane_rowcount.__doc__]
yield_per(self, num: 'int') -> 'Self'

Méthodes héritées de la classe Result

__enter__, __exit__, __init_subclass__, __iter__, __next__, __subclasshook__, all, columns, fetchall, fetchmany, fetchone, first, freeze, mappings, one, one_or_none, partitions, scalar, scalar_one, scalar_one_or_none, scalars, tuples, unique

Méthodes héritées de la classe HasMemoized

memoized_attribute, memoized_instancemethod

Méthodes héritées de la classe _WithKeys

keys

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __getstate__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__

Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé