dimagi / django-cte

Common Table Expressions (CTE) for Django
Other
334 stars 46 forks source link

Add support for combination two CTE queries #59

Open pgammans opened 2 years ago

pgammans commented 2 years ago

This is an initial draft/ RFC commit that provides support merging queries with CTEs on both sides. Initial support is for (union, difference, and difference) operators | and & are not as yet supported by may be possible to implement as a union wrapped in a CTE to allow Django to continue to apply filters an other ops.

ie allowing combined_ctequery = cte_query1.union(cte_query2, cte_query3)

Basic premise is to:

More work will be needed to improve..

This may solve #32