diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-09-25 22:31:16 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-10-31 13:44:53 -0400 |
commit | 654b462d668a2ced4e87077b9babb2590acbf983 (patch) | |
tree | 8b6023480423e990c9bbca7c280cb1cb58e012fc /lib/sqlalchemy/engine | |
parent | 841eb216644202567ebddfc0badc51a3a35e98c3 (diff) | |
download | sqlalchemy-review/mike_bayer/tutorial20.tar.gz |
tutorial 2.0 WIPreview/mike_bayer/tutorial20
Add SelectBase.exists() method as it seems strange this is
not available already. The Exists construct itself does
not provide full SELECT-building capabilities so it makes
sense this should be used more like a scalar_subquery.
Make sure stream_results is getting set up when yield_per
is used, for 2.0 style statements as well. this was
hardcoded inside of Query.yield_per() and is now moved
to take place within QueryContext.
Change-Id: Icafcd4fd9b708772343d56edf40995c9e8f835d6
Diffstat (limited to 'lib/sqlalchemy/engine')
-rw-r--r-- | lib/sqlalchemy/engine/interfaces.py | 3 | ||||
-rw-r--r-- | lib/sqlalchemy/engine/result.py | 4 | ||||
-rw-r--r-- | lib/sqlalchemy/engine/row.py | 12 |
3 files changed, 14 insertions, 5 deletions
diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index a7f71f5e5..fddbc501a 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -1139,7 +1139,8 @@ class CreateEnginePlugin(object): :class:`_engine.URL` object should impliement the :meth:`_engine.CreateEnginePlugin.update_url` method. - :param kwargs: The keyword arguments passed to :func:`.create_engine`. + :param kwargs: The keyword arguments passed to + :func:`_sa.create_engine`. """ self.url = url diff --git a/lib/sqlalchemy/engine/result.py b/lib/sqlalchemy/engine/result.py index cb452ac73..73b07e540 100644 --- a/lib/sqlalchemy/engine/result.py +++ b/lib/sqlalchemy/engine/result.py @@ -710,6 +710,10 @@ class Result(_WithKeys, ResultInternal): :class:`.ResultProxy` interface. When using the ORM, a higher level object called :class:`.ChunkedIteratorResult` is normally used. + .. seealso:: + + :ref:`tutorial_fetching_rows` - in the :doc:`/tutorial/index` + """ _process_row = Row diff --git a/lib/sqlalchemy/engine/row.py b/lib/sqlalchemy/engine/row.py index 288f08e29..60954fcec 100644 --- a/lib/sqlalchemy/engine/row.py +++ b/lib/sqlalchemy/engine/row.py @@ -500,10 +500,14 @@ class RowMapping(BaseRow, collections_abc.Mapping): """A ``Mapping`` that maps column names and objects to :class:`.Row` values. The :class:`.RowMapping` is available from a :class:`.Row` via the - :attr:`.Row._mapping` attribute and supplies Python mapping (i.e. - dictionary) access to the contents of the row. This includes support - for testing of containment of specific keys (string column names or - objects), as well as iteration of keys, values, and items:: + :attr:`.Row._mapping` attribute, as well as from the iterable interface + provided by the :class:`.MappingResult` object returned by the + :meth:`_engine.Result.mappings` method. + + :class:`.RowMapping` supplies Python mapping (i.e. dictionary) access to + the contents of the row. This includes support for testing of + containment of specific keys (string column names or objects), as well + as iteration of keys, values, and items:: for row in result: if 'a' in row._mapping: |