diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-04-04 10:13:23 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-04-07 10:47:53 -0400 |
| commit | 2acc9ec1281b2818bd44804f040d94ec46215688 (patch) | |
| tree | 40e77ef66a8682b4a1d885575412a78152806397 /lib/sqlalchemy/engine/default.py | |
| parent | 3b4d62f4f72e8dfad7f38db192a6a90a8551608c (diff) | |
| download | sqlalchemy-2acc9ec1281b2818bd44804f040d94ec46215688.tar.gz | |
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
Diffstat (limited to 'lib/sqlalchemy/engine/default.py')
| -rw-r--r-- | lib/sqlalchemy/engine/default.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index 85ce91deb..4d700866f 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -933,8 +933,11 @@ class DefaultExecutionContext(ExecutionContext): assert isinstance(compiled.statement, UpdateBase) self.is_crud = True self._is_explicit_returning = bool(compiled.statement._returning) - self._is_implicit_returning = bool( - compiled.returning and not compiled.statement._returning + self._is_implicit_returning = is_implicit_returning = bool( + compiled.implicit_returning + ) + assert not ( + is_implicit_returning and compiled.statement._returning ) if not parameters: @@ -1166,12 +1169,6 @@ class DefaultExecutionContext(ExecutionContext): return () @util.memoized_property - def returning_cols(self) -> Optional[Sequence[ColumnsClauseRole]]: - if TYPE_CHECKING: - assert isinstance(self.compiled, SQLCompiler) - return self.compiled.returning - - @util.memoized_property def no_parameters(self): return self.execution_options.get("no_parameters", False) @@ -1349,6 +1346,7 @@ class DefaultExecutionContext(ExecutionContext): result = _cursor.CursorResult(self, strategy, cursor_description) compiled = self.compiled + if ( compiled and not self.isddl |
