Add support for tracking subqueries in catch_queries().

Review Request #13401 — Created Nov. 3, 2023 and submitted — Latest diff uploaded

Information

Djblets
release-3.x

Reviewers

catch_queries() now looks for any subqueries as part of a query,
tracking them and nesting them in the appropriate parent query or
subquery. This works for a nested DISTINCT query, annotations,
aggregations, and filtering, at any depth.

This will soon be used by compare_queries() to do thorough subquery
comparisons.

Unit tests pass.

Made use of this in the upcoming work on subquery comparisons.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Add support for tracking subqueries in catch_queries().
`catch_queries()` now looks for any subqueries as part of a query, tracking them and nesting them in the appropriate parent query or subquery. This works for a nested `DISTINCT` query, annotations, aggregations, and filtering, at any depth. This will soon be used by `compare_queries()` to do thorough subquery comparisons.
76848bd60f06afc0fbf856ca76357538e6434dd9 Christian Hammond
djblets/db/query_catcher.py
djblets/db/tests/test_query_catcher.py
Loading...