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
| 255 | |
| 256 | |
| 257 | class ORMExecuteState(util.MemoizedSlots): |
| 258 | """Represents a call to the :meth:`_orm.Session.execute` method, as passed |
| 259 | to the :meth:`.SessionEvents.do_orm_execute` event hook. |
| 260 | |
| 261 | .. versionadded:: 1.4 |
| 262 | |
| 263 | .. seealso:: |
| 264 | |
| 265 | :ref:`session_execute_events` - top level documentation on how |
| 266 | to use :meth:`_orm.SessionEvents.do_orm_execute` |
| 267 | |
| 268 | """ |
| 269 | |
| 270 | __slots__ = ( |
| 271 | "session", |
| 272 | "statement", |
| 273 | "parameters", |
| 274 | "execution_options", |
| 275 | "local_execution_options", |
| 276 | "bind_arguments", |
| 277 | "identity_token", |
| 278 | "_compile_state_cls", |
| 279 | "_starting_event_idx", |
| 280 | "_events_todo", |
| 281 | "_update_execution_options", |
| 282 | ) |
| 283 | |
| 284 | session: Session |
| 285 | """The :class:`_orm.Session` in use.""" |
| 286 | |
| 287 | statement: Executable |
| 288 | """The SQL statement being invoked. |
| 289 | |
| 290 | For an ORM selection as would |
| 291 | be retrieved from :class:`_orm.Query`, this is an instance of |
| 292 | :class:`_sql.select` that was generated from the ORM query. |
| 293 | """ |
| 294 | |
| 295 | parameters: Optional[_CoreAnyExecuteParams] |
| 296 | """Optional mapping or list of mappings of parameters that was passed to |
| 297 | :meth:`_orm.Session.execute`. |
| 298 | |
| 299 | May be mutated or re-assigned in place, which will take effect as the |
| 300 | effective parameters passed to the method. |
| 301 | |
| 302 | .. versionchanged:: 2.1 :attr:`.ORMExecuteState.parameters` may now be |
| 303 | mutated or replaced. |
| 304 | |
| 305 | """ |
| 306 | |
| 307 | execution_options: _ExecuteOptions |
| 308 | """The complete dictionary of current execution options. |
| 309 | |
| 310 | This is a merge of the statement level options with the |
| 311 | locally passed execution options. |
| 312 | |
| 313 | .. seealso:: |
| 314 |