Also document more detail as to why SQL expression support
is not turned on for batch.
Fixes: #5165
Change-Id: Ia93bbf75f22b8781400086c45b86a60ef9cec360
(cherry picked from commit
88c23da948e76b1c273b6c48389d6671878696eb)
* Functionality related to primary key mutation, ON UPDATE cascade
-* SQL expression inserts / updates (e.g. :ref:`flush_embedded_sql_expressions`)
+* SQL expression inserts / updates (e.g. :ref:`flush_embedded_sql_expressions`) -
+ having to evaluate these would prevent INSERT and UPDATE statements from
+ being batched together in a straightforward way for a single executemany()
+ call as they alter the SQL compilation of the statement itself.
* ORM events such as :meth:`.MapperEvents.before_insert`, etc. The bulk
session methods have no event support.
col = propkey_to_col[propkey]
if value is None and col not in eval_none and not render_nulls:
continue
- elif (
- not bulk
- and hasattr(value, "__clause_element__")
+ elif not bulk and (
+ hasattr(value, "__clause_element__")
or isinstance(value, sql.ClauseElement)
):
value_params[col] = (