]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add more nesting features to add_cte()
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 23 Feb 2022 17:24:31 +0000 (12:24 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 24 Feb 2022 23:43:50 +0000 (18:43 -0500)
commit0fe8f4a3e79c8fc805e7a84849920c7258177f41
tree778ad1fc6298e377f04192b0585566d4d4f2dc16
parent0353a9db76db6a46fa63d99a1d05c5cac45ea460
Add more nesting features to add_cte()

Added new parameter :paramref:`.HasCTE.add_cte.nest_here` to
:meth:`.HasCTE.add_cte` which will "nest" a given :class:`.CTE` at the
level of the parent statement. This parameter is equivalent to using the
:paramref:`.HasCTE.cte.nesting` parameter, but may be more intuitive in
some scenarios as it allows the nesting attribute to be set simultaneously
along with the explicit level of the CTE.

The :meth:`.HasCTE.add_cte` method also accepts multiple CTE objects.

Fixes: #7759
Change-Id: I263c015f5a3f452cb54819aee12bc9bf2953a7bb
doc/build/changelog/unreleased_20/7759.rst [new file with mode: 0644]
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/selectable.py
test/sql/test_cte.py