summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-08-03 18:59:05 -0400
committermike bayer <mike_mp@zzzcomputing.com>2022-08-04 13:32:30 +0000
commit8032bfdcee30023aa2facf80be0d3627a8467149 (patch)
tree0918b0c5245d16d1686b040f01a5c904f00b8c1a /lib/sqlalchemy/orm
parent0027b3a4bc54599ac8102a4a3d81d8007738903e (diff)
downloadsqlalchemy-8032bfdcee30023aa2facf80be0d3627a8467149.tar.gz
deprecate Query.instances()
this method no longer does the thing that it was originally intended to do, which is to get ORM results from arbitrary result sets. Modern patterns should supersede the use of this construct. Change-Id: Ia1656c84d7c323f55e3a9594b950a40763d63d90 References: #8347
Diffstat (limited to 'lib/sqlalchemy/orm')
-rw-r--r--lib/sqlalchemy/orm/query.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 99131e3e9..374ae5cc8 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -2783,6 +2783,13 @@ class Query(
return _column_descriptions(self, legacy=True)
+ @util.deprecated(
+ "2.0",
+ "The :meth:`_orm.Query.instances` method is deprecated and will "
+ "be removed in a future release. "
+ "Use the Select.from_statement() method or aliased() construct in "
+ "conjunction with Session.execute() instead.",
+ )
def instances(
self,
result_proxy: CursorResult[Any],