Hi,

I have a use-case where I need to set the value of a column based on the 
values of other columns during an insert.
This works fine for an insert for a single row where 
`context.current_parameters` reflects the values of the other columns I 
care about.
When I have a multi-row insert, `context.current_parameters` is no longer 
usable since the column names are munged (e.g. assuming a `user_id` column, 
and an insert like `insert(table).values([{'user_id': 1}, {'user_id': 2}, 
{'user_id': 3}])` you might get something like `{'user_id_m0': 1, 
'user_id_m1': 2, 'user_id_m2': 3}`. It doesn't seem possible to tell which 
row we are operating on just by looking at `context` so we cannot determine 
which munged name we should look at. Ideally the current parameters would 
only reflect the parameters for a single row.

Is this a known limitation of defaults usage? Any workarounds?

Cheers
Colin

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to