Skip to content

Upserts not honoring Column onupdate values #5903

Discussion options

You must be logged in to vote

Describe the bug
When updates happen via on_conflict_do_update, the onupdate values in Column definitions do not apply.
Any action that effectively updates a row should always consider onupdate data, especially in databases like SQLite that do not otherwise have proper support for things like auto-updating timestamps.

This is a documented limitation of the various "on conflict" constructs:

The Insert.on_conflict_do_update() method does not take into account Python-side default UPDATE values or generation functions, e.g. those specified using Column.onupdate. These values will not be exercised for an ON CONFLICT style of UPDATE, unless they are manually specified in the Insert.on_confli…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@DefiDebauchery
Comment options

@zzzeek
Comment options

Answer selected by CaselIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5900 on February 01, 2021 15:20.