]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add support for preserve_rowcount execution_option
authorFederico Caselli <cfederico87@gmail.com>
Wed, 7 Feb 2024 21:11:25 +0000 (22:11 +0100)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 3 Mar 2024 22:58:46 +0000 (17:58 -0500)
commita0e7cab4d1f3fc6b586b63bef59fd84c1dc0d183
tree81c63eb9b07bc2df6b902fc559e9a0554e5330c3
parent388afa73d94b63fa2b0a933171f060a94347d5cb
Add support for preserve_rowcount execution_option

Added new core execution option
paramref:`_engine.Connection.execution_options.preserve_rowcount`
to unconditionally save the ``rowcount`` attribute from the cursor in the
class:`_engine.Result` returned from an execution, regardless of the
statement being executed.
When this option is provided the correct value is also set when
an INSERT makes use of the "insertmanyvalues" mode, that may use
more than one actualy cursor execution.

Fixes: #10974
Change-Id: Icecef6b7539be9f0a1a02b9539864f5f163dcfbc
(cherry picked from commit f0537442eb7d3a3b2e702c8843c3c277fbfda0ac)
19 files changed:
doc/build/changelog/unreleased_20/10974.rst [new file with mode: 0644]
doc/build/tutorial/data_update.rst
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/mysql/mariadbconnector.py
lib/sqlalchemy/dialects/mysql/mysqldb.py
lib/sqlalchemy/dialects/postgresql/__init__.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/cursor.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/interfaces.py
lib/sqlalchemy/ext/asyncio/engine.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/testing/fixtures/sql.py
test/requirements.py
test/sql/test_insert_exec.py
test/sql/test_resultset.py
test/typing/test_overloads.py