]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
raise informative error when selectable can't be extended
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 May 2022 14:48:16 +0000 (10:48 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 31 May 2022 17:01:09 +0000 (13:01 -0400)
commit96d40575ec612aaf00695f113dbcfe95f8cc80b4
tree178c9b80a1104db8146f0db891619812f851b340
parent6a9f23038ea8ace5c7fb2c323f2ee38a15fa07dd
raise informative error when selectable can't be extended

An informative error is raised for the use case where
:meth:`.Insert.from_select` is being passed a "compound select" object such
as a UNION, yet the INSERT statement needs to append additional columns to
support Python-side or explicit SQL defaults from the table metadata. In
this case a subquery of the compound object should be passed.

Fixes: #8073
Change-Id: Ic4a5dbf84ec49d2451901be05cb9cf6ae93f02b7
(cherry picked from commit 7474df2159f89d684d32aabb15014ef95cea1641)
doc/build/changelog/unreleased_14/8073.rst [new file with mode: 0644]
lib/sqlalchemy/sql/crud.py
test/sql/test_insert.py