]> 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:44:59 +0000 (16:44 -0400)
commit0487cd1678458b786d4beca5ae3a9c8e343c3763
treeec3788f49a212ef988dc60d0527b47e5f983ca17
parent719197dd9399b4436aeaba3e2f44761292036ad6
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
doc/build/core/defaults.rst
doc/build/orm/persistence_techniques.rst