]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
set up is_from_statement and others for FromStatement
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Apr 2024 21:54:22 +0000 (17:54 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Apr 2024 23:29:30 +0000 (19:29 -0400)
commit7564f819d9bde2eb3276f99c411dad85559e1de7
treebf926f2bf8d32262003f099e81e20a91ec3d12c2
parent1a1ef60885ed948cdb3e2d84c97a007e7988fe6b
set up is_from_statement and others for FromStatement

Added new attribute :attr:`_orm.ORMExecuteState.is_from_statement`, to
detect statements of the form ``select().from_statement()``, and also
enhanced ``FromStatement`` to set :attr:`_orm.ORMExecuteState.is_select`,
:attr:`_orm.ORMExecuteState.is_insert`,
:attr:`_orm.ORMExecuteState.is_update`, and
:attr:`_orm.ORMExecuteState.is_delete` according to the element that is
sent to the :meth:`_sql.Select.from_statement` method itself.

Fixes: #11220
Change-Id: I3bf9e7e22fa2955d772b3b6ad636ed93a60916ae
(cherry picked from commit d3222a31b8df97a454b37a32881dd484a06e5742)
doc/build/changelog/unreleased_20/11220.rst [new file with mode: 0644]
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/sql/base.py
test/orm/test_events.py