MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / ORMExecuteState

Class ORMExecuteState

lib/sqlalchemy/orm/session.py:264–820  ·  view source on GitHub ↗

Represents a call to the :meth:`_orm.Session.execute` method, as passed to the :meth:`.SessionEvents.do_orm_execute` event hook. .. versionadded:: 1.4 .. seealso:: :ref:`session_execute_events` - top level documentation on how to use :meth:`_orm.SessionEvents.do_orm_ex

Source from the content-addressed store, hash-verified

262
263
264class ORMExecuteState(util.MemoizedSlots):
265 """Represents a call to the :meth:`_orm.Session.execute` method, as passed
266 to the :meth:`.SessionEvents.do_orm_execute` event hook.
267
268 .. versionadded:: 1.4
269
270 .. seealso::
271
272 :ref:`session_execute_events` - top level documentation on how
273 to use :meth:`_orm.SessionEvents.do_orm_execute`
274
275 """
276
277 __slots__ = (
278 "session",
279 "statement",
280 "parameters",
281 "execution_options",
282 "local_execution_options",
283 "bind_arguments",
284 "identity_token",
285 "_compile_state_cls",
286 "_starting_event_idx",
287 "_events_todo",
288 "_update_execution_options",
289 )
290
291 session: Session
292 """The :class:`_orm.Session` in use."""
293
294 statement: Executable
295 """The SQL statement being invoked.
296
297 For an ORM selection as would
298 be retrieved from :class:`_orm.Query`, this is an instance of
299 :class:`_sql.select` that was generated from the ORM query.
300 """
301
302 parameters: Optional[_CoreAnyExecuteParams]
303 """Dictionary of parameters that was passed to
304 :meth:`_orm.Session.execute`."""
305
306 execution_options: _ExecuteOptions
307 """The complete dictionary of current execution options.
308
309 This is a merge of the statement level options with the
310 locally passed execution options.
311
312 .. seealso::
313
314 :attr:`_orm.ORMExecuteState.local_execution_options`
315
316 :meth:`_sql.Executable.execution_options`
317
318 :ref:`orm_queryguide_execution_options`
319
320 """
321

Callers 1

_execute_internalMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected