test #6464. SQL-Server specific arrangement seems to allow DELETE from a CTE directly.
(self)
| 1722 | eq_(stmt.compile().isupdate, True) |
| 1723 | |
| 1724 | def test_delete_against_cte_directly(self): |
| 1725 | """test #6464. |
| 1726 | |
| 1727 | SQL-Server specific arrangement seems to allow |
| 1728 | DELETE from a CTE directly. |
| 1729 | |
| 1730 | """ |
| 1731 | products = table("products", column("id"), column("price")) |
| 1732 | |
| 1733 | cte = products.select().cte("pd") |
| 1734 | |
| 1735 | stmt = delete(cte) |
| 1736 | |
| 1737 | self.assert_compile( |
| 1738 | stmt, |
| 1739 | "WITH pd AS (SELECT products.id AS id, products.price AS price " |
| 1740 | "FROM products) DELETE FROM pd", |
| 1741 | ) |
| 1742 | eq_(stmt.compile().isdelete, True) |
| 1743 | |
| 1744 | def test_delete_against_user_textual_cte(self): |
| 1745 | """test #6464. |