]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
include column.default, column.onupdate in eager_defaults
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 2 Aug 2022 20:18:18 +0000 (16:18 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 5 Aug 2022 14:07:15 +0000 (10:07 -0400)
commit82a1d4096fbfe94e2fa626d65d5c3beb2c6afa37
treebaca62a1a0784f192e65402f824319b0403c6847
parent0027b3a4bc54599ac8102a4a3d81d8007738903e
include column.default, column.onupdate in eager_defaults

Fixed bug in the behavior of the :paramref:`_orm.Mapper.eager_defaults`
parameter such that client-side SQL default or onupdate expressions in the
table definition alone will trigger a fetch operation using RETURNING or
SELECT when the ORM emits an INSERT or UPDATE for the row. Previously, only
server side defaults established as part of table DDL and/or server-side
onupdate expressions would trigger this fetch, even though client-side SQL
expressions would be included when the fetch was rendered.

Fixes: #7438
Change-Id: Iba719298ba4a26d185edec97ba77d2d54585e5a4
doc/build/changelog/unreleased_20/7438.rst [new file with mode: 0644]
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/persistence.py
lib/sqlalchemy/sql/dml.py
test/orm/test_unitofworkv2.py
test/sql/test_insert.py