From 2acc9ec1281b2818bd44804f040d94ec46215688 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 4 Apr 2022 10:13:23 -0400 Subject: cx_Oracle modernize Full "RETURNING" support is implemented for the cx_Oracle dialect, meaning multiple RETURNING rows are now recived for DML statements that produce more than one row for RETURNING. cx_Oracle 7 is now the minimum version for cx_Oracle. Getting Oracle to do multirow returning took about 5 minutes. however, getting Oracle's RETURNING system to integrate with ORM-enabled insert, update, delete, is a big deal because that architecture wasn't really working very robustly, including some recent changes in 1.4 for FromStatement were done in a hurry, so this patch also cleans up the FromStatement situation and begins to establish it more concretely as the base for all ReturnsRows / TextClause ORM scenarios. Fixes: #6245 Change-Id: I2b4e6007affa51ce311d2d5baa3917f356ab961f --- lib/sqlalchemy/sql/dml.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/sql/dml.py') diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py index 8a3a1b38f..f23ba2e6e 100644 --- a/lib/sqlalchemy/sql/dml.py +++ b/lib/sqlalchemy/sql/dml.py @@ -463,11 +463,18 @@ class UpdateBase( ) return self - @util.non_memoized_property + def corresponding_column( + self, column: ColumnElement[Any], require_embedded: bool = False + ) -> Optional[ColumnElement[Any]]: + return self.exported_columns.corresponding_column( + column, require_embedded=require_embedded + ) + + @util.ro_memoized_property def _all_selected_columns(self) -> _SelectIterable: return [c for c in _select_iterables(self._returning)] - @property + @util.ro_memoized_property def exported_columns( self, ) -> ReadOnlyColumnCollection[Optional[str], ColumnElement[Any]]: -- cgit v1.2.1