MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_recursive_union_no_alias_one

Method test_recursive_union_no_alias_one

test/sql/test_cte.py:267–279  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

265 )
266
267 def test_recursive_union_no_alias_one(self):
268 s1 = select(literal(0).label("x"))
269 cte = s1.cte(name="cte", recursive=True)
270 cte = cte.union_all(select(cte.c.x + 1).where(cte.c.x < 10))
271 s2 = select(cte)
272 self.assert_compile(
273 s2,
274 "WITH RECURSIVE cte(x) AS "
275 "(SELECT :param_1 AS x UNION ALL "
276 "SELECT cte.x + :x_1 AS anon_1 "
277 "FROM cte WHERE cte.x < :x_2) "
278 "SELECT cte.x FROM cte",
279 )
280
281 def test_recursive_union_alias_one(self):
282 s1 = select(literal(0).label("x"))

Callers

nothing calls this directly

Calls 7

selectFunction · 0.90
literalFunction · 0.90
assert_compileMethod · 0.80
labelMethod · 0.45
cteMethod · 0.45
union_allMethod · 0.45
whereMethod · 0.45

Tested by

no test coverage detected