]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Support Column objects in the SET clause for upsert
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 24 Nov 2020 01:13:20 +0000 (20:13 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 24 Nov 2020 01:13:20 +0000 (20:13 -0500)
commit584cabbf7e79948e38b29df5af63c3c712566f31
treec4e8451d7f4b794826d20ecf18b8252099fadf25
parentb4e40b35627f1c26b84234d16a36ce2850a798b9
Support Column objects in the SET clause for upsert

Established support for :class:`_schema.Column` objects as well as ORM
instrumented attributes as keys in the ``set_`` dictionary passed to the
:meth:`_postgresql.Insert.on_conflict_do_update` and
:meth:`_sqlite.Insert.on_conflict_do_update` methods, which match to the
:class:`_schema.Column` objects in the ``.c`` collection of the target
:class:`_schema.Table`. Previously,  only string column names were
expected; a column expression would be assumed to be an out-of-table
expression that would render fully along with a warning.

Fixes: #5722
Change-Id: Ice73b501d721c28d978a0277a83cedc6aff756a9
doc/build/changelog/unreleased_14/5722.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/postgresql/dml.py
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/dialects/sqlite/dml.py
test/dialect/postgresql/test_compiler.py
test/dialect/postgresql/test_on_conflict.py
test/dialect/test_sqlite.py