]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add a note on using server_onupdate=FetchedValue()
authorAndrew Brookins <a.m.brookins@gmail.com>
Sun, 22 May 2022 20:24:15 +0000 (16:24 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 22 May 2022 20:48:18 +0000 (16:48 -0400)
commitd29cea6171e2a752175fb76a55afa725f538bf7e
tree62a46f2ae150c7cbfe7e359917cac1c0187dcd64
parentd19d5d72ad1e15d8f7632cb58aaa80da6e85423e
Add a note on using server_onupdate=FetchedValue()

Add a note on using `server_onupdate=FetchedValue()` when using SQL expressions with `onupdate`.

My team encountered an issue with using a SQL expression with `onupdate`.
Despite the dialect (PG) supporting `RETURNING`, we needed to mark the column with
`server_onupdate=FetchedValue()` in order to get the column used with `onupdate`
to appear in the `RETURNING` clause of `UPDATE` statements.

This was not clear from the documentation, so I want to make it crystal clear for other
folks defining similar columns.

Closes: #7437
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7437
Pull-request-sha: 4845fb09a90ab58f0ae882e0d335ddba09b32ca0

Change-Id: I272278830c8f3f42d057ff77c3209e87df7adf02
(cherry picked from commit 0487cd1678458b786d4beca5ae3a9c8e343c3763)
doc/build/core/defaults.rst
doc/build/orm/persistence_techniques.rst