[Sqlalchemy-tickets] Issue #3568: Use column expressions with session.bulk_update_mappings (zzzeek/
Brought to you by:
zzzeek
|
From: Fabio S. <iss...@bi...> - 2015-10-27 16:56:32
|
New issue 3568: Use column expressions with session.bulk_update_mappings https://bitbucket.org/zzzeek/sqlalchemy/issues/3568/use-column-expressions-with Fabio Sussetto: ``` prize = 10 mappings = {'id': 1, 'balance': User.balance + prize} db.session.bulk_update_mappings(User, mappings) ``` On 1.0.9 this fails with the following error: ``` can't adapt type 'BinaryExpression' [SQL: 'UPDATE "user" SET balance=%(balance)s WHERE "user".id = %(user_id)s'] [parameters: ({'user_id': 1, 'balance': <sqlalchemy.sql.elements.BinaryExpression object at 0x10d153be0>} ``` Is this supported? Thanks! |