summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-03-21 16:29:59 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2022-03-21 16:31:14 -0400
commit8789171595507c2e43cd7ddc7dd4370b48130f4e (patch)
tree67a8c3edffebbebcca2fe6ec2d916807654c0257
parent4373bd215878a2ec8216ade74007994ddc0a554f (diff)
downloadsqlalchemy-8789171595507c2e43cd7ddc7dd4370b48130f4e.tar.gz
additional updates to stream results note
Change-Id: I9d7ed9f412a2d9384f6c0b50316df79b6f8f481a (cherry picked from commit 512807f02d7aa6c4074910f1d0fba2187f50ee8f)
-rw-r--r--doc/build/core/connections.rst19
-rw-r--r--lib/sqlalchemy/orm/query.py12
2 files changed, 21 insertions, 10 deletions
diff --git a/doc/build/core/connections.rst b/doc/build/core/connections.rst
index aaf118b1b..dc0652757 100644
--- a/doc/build/core/connections.rst
+++ b/doc/build/core/connections.rst
@@ -941,16 +941,19 @@ as the schema name is passed to these methods explicitly.
session = Session(schema_engine)
- When using the ORM, the schema translate feature is only supported as
- **a single schema translate map per Session**. It will **not work** if
- different schema translate maps are given on a per-statement basis, as
- the ORM :class:`_orm.Session` does not take current schema translate
- values into account for individual objects. In other words, all
- objects loaded in a particular :class:`_orm.Session` must be based on the
- **same** ``schema_translate_map``.
-
...
+ .. warning::
+
+ When using the ORM, the schema translate feature is only supported as
+ **a single schema translate map per Session**. It will **not work** if
+ different schema translate maps are given on a per-statement basis, as
+ the ORM :class:`_orm.Session` does not take current schema translate
+ values into account for individual objects. In other words, all
+ objects loaded in a particular :class:`_orm.Session` must be based on the
+ **same** ``schema_translate_map``.
+
+
.. versionadded:: 1.1
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index ab230f66f..fe06b5313 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -1557,12 +1557,20 @@ class Query(
automatically if the :meth:`~sqlalchemy.orm.query.Query.yield_per()`
method or execution option is used.
+ .. versionadded:: 1.4 - added ORM options to
+ :meth:`_orm.Query.execution_options`
+
The execution options may also be specified on a per execution basis
when using :term:`2.0 style` queries via the
:paramref:`_orm.Session.execution_options` parameter.
- .. versionadded:: 1.4 - added ORM options to
- :meth:`_orm.Query.execution_options`
+ .. warning:: The
+ :paramref:`_engine.Connection.execution_options.stream_results`
+ parameter should not be used at the level of individual ORM
+ statement executions, as the :class:`_orm.Session` will not track
+ objects from different schema translate maps within a single
+ session.
+
.. seealso::