]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
add chunking to selectin_polymorphic
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 6 Aug 2025 14:19:39 +0000 (10:19 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 6 Aug 2025 18:00:38 +0000 (14:00 -0400)
commit435b22e41d7af099732009a28234c11cb1667fde
tree1157c529b1e323ca291b19b333f8b4fd4638d76f
parent3ba16238f97e2fd79af68905e160349ae31975da
add chunking to selectin_polymorphic

Improved the implementation of the :func:`_orm.selectin_polymorphic`
inheritance loader strategy to properly render the IN expressions using
chunks of 500 records each, in the same manner as that of the
:func:`_orm.selectinload` relationship loader strategy.  Previously, the IN
expression would be arbitrarily large, leading to failures on databases
that have limits on the size of IN expressions including Oracle Database.

Fixes: #12790
Change-Id: I8df7f34d4fdf73996780772d983b72ea0fc8309e
(cherry picked from commit 9d6fa58d6996ac4cff1ac215ef389f4cb4b9ca3d)
doc/build/changelog/unreleased_20/12790.rst [new file with mode: 0644]
lib/sqlalchemy/orm/loading.py
test/orm/inheritance/test_poly_loading.py