]> 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:12 +0000 (17:58 -0500)
commitf0537442eb7d3a3b2e702c8843c3c277fbfda0ac
tree2105f8b0ebab5c9c8814d169b3bc8ea535ddb7f8
parent9bcc4da735891d09a4c850c5f29b3abeef13ce27
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
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