]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Warn / raise for returning() / return_defaults() combinations
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 11 Nov 2020 16:13:27 +0000 (11:13 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 11 Nov 2020 16:16:09 +0000 (11:16 -0500)
commit85cf381e51df99b8260683c0367b653c419a5b6e
treef8d6f214195f245eca197de7f8723e2e7736bca4
parent1dcd8a08cb050c2d89e6d77fbefaa41d90122411
Warn / raise for returning() / return_defaults() combinations

A warning is emmitted if a returning() method such as
:meth:`_sql.Insert.returning` is called multiple times, as this does not
yet support additive operation.  Version 1.4 will support additive
operation for this.  Additionally, any combination of the
:meth:`_sql.Insert.returning` and :meth:`_sql.Insert.return_defaults`
methods now raises an error as these methods are mutually exclusive;
previously the operation would fail silently.

Fixes: #5691
Change-Id: Id95e0f9da48bba0b59439cb26564f0daa684c8e3
(cherry picked from commit 44d64aef3ce26a1dd62b61ed15888d8baab06443)
doc/build/changelog/unreleased_13/5691.rst [new file with mode: 0644]
lib/sqlalchemy/sql/dml.py
test/sql/test_returning.py