diff options
Diffstat (limited to 'lib/sqlalchemy/orm')
-rw-r--r-- | lib/sqlalchemy/orm/persistence.py | 24 | ||||
-rw-r--r-- | lib/sqlalchemy/orm/session.py | 7 |
2 files changed, 18 insertions, 13 deletions
diff --git a/lib/sqlalchemy/orm/persistence.py b/lib/sqlalchemy/orm/persistence.py index 4ba1917f6..3c0c637a2 100644 --- a/lib/sqlalchemy/orm/persistence.py +++ b/lib/sqlalchemy/orm/persistence.py @@ -938,7 +938,7 @@ def _emit_update_statements( has_all_defaults, has_all_pks, ) in records: - c = connection._execute_20( + c = connection.execute( statement.values(value_params), params, execution_options=execution_options, @@ -971,7 +971,7 @@ def _emit_update_statements( has_all_defaults, has_all_pks, ) in records: - c = connection._execute_20( + c = connection.execute( statement, params, execution_options=execution_options ) @@ -997,7 +997,7 @@ def _emit_update_statements( assert_singlerow and len(multiparams) == 1 ) - c = connection._execute_20( + c = connection.execute( statement, multiparams, execution_options=execution_options ) @@ -1093,7 +1093,7 @@ def _emit_insert_statements( records = list(records) multiparams = [rec[2] for rec in records] - c = connection._execute_20( + c = connection.execute( statement, multiparams, execution_options=execution_options ) @@ -1152,7 +1152,7 @@ def _emit_insert_statements( if do_executemany: multiparams = [rec[2] for rec in records] - c = connection._execute_20( + c = connection.execute( statement, multiparams, execution_options=execution_options ) @@ -1212,13 +1212,13 @@ def _emit_insert_statements( has_all_defaults, ) in records: if value_params: - result = connection._execute_20( + result = connection.execute( statement.values(value_params), params, execution_options=execution_options, ) else: - result = connection._execute_20( + result = connection.execute( statement, params, execution_options=execution_options, @@ -1321,7 +1321,7 @@ def _emit_post_update_statements( check_rowcount = assert_singlerow for state, state_dict, mapper_rec, connection, params in records: - c = connection._execute_20( + c = connection.execute( statement, params, execution_options=execution_options ) @@ -1345,7 +1345,7 @@ def _emit_post_update_statements( assert_singlerow and len(multiparams) == 1 ) - c = connection._execute_20( + c = connection.execute( statement, multiparams, execution_options=execution_options ) @@ -1425,7 +1425,7 @@ def _emit_delete_statements( # rows can be verified for params in del_objects: - c = connection._execute_20( + c = connection.execute( statement, params, execution_options=execution_options ) rows_matched += c.rowcount @@ -1435,11 +1435,11 @@ def _emit_delete_statements( "- versioning cannot be verified." % connection.dialect.dialect_description ) - connection._execute_20( + connection.execute( statement, del_objects, execution_options=execution_options ) else: - c = connection._execute_20( + c = connection.execute( statement, del_objects, execution_options=execution_options ) diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index 415826e5f..c76ece5de 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -1499,6 +1499,11 @@ class Session(_SessionClassMethods): by :meth:`_engine.Connection.execution_options`, and may also provide additional options understood only in an ORM context. + .. seealso:: + + :ref:`orm_queryguide_execution_options` - ORM-specific execution + options + :param bind_arguments: dictionary of additional arguments to determine the bind. May include "mapper", "bind", or other custom arguments. Contents of this dictionary are passed to the @@ -1592,7 +1597,7 @@ class Session(_SessionClassMethods): bind = self.get_bind(**bind_arguments) conn = self._connection_for_bind(bind) - result = conn._execute_20(statement, params or {}, execution_options) + result = conn.execute(statement, params or {}, execution_options) if compile_state_cls: result = compile_state_cls.orm_setup_cursor_result( |