(self)
| 750 | ) |
| 751 | |
| 752 | def test_cte_w_union(self): |
| 753 | t = select(func.values(1).label("n")).cte("t", recursive=True) |
| 754 | t = t.union_all(select(t.c.n + 1).where(t.c.n < 100)) |
| 755 | s = select(func.sum(t.c.n)) |
| 756 | |
| 757 | from sqlalchemy.sql.visitors import cloned_traverse |
| 758 | |
| 759 | cloned = cloned_traverse(s, {}, {}) |
| 760 | |
| 761 | self.assert_compile( |
| 762 | cloned, |
| 763 | "WITH RECURSIVE t(n) AS " |
| 764 | "(SELECT values(:values_1) AS n " |
| 765 | "UNION ALL SELECT t.n + :n_1 AS anon_1 " |
| 766 | "FROM t " |
| 767 | "WHERE t.n < :n_2) " |
| 768 | "SELECT sum(t.n) AS sum_1 FROM t", |
| 769 | ) |
| 770 | |
| 771 | def test_aliased_cte_w_union(self): |
| 772 | t = ( |
nothing calls this directly
no test coverage detected