MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_recursive_union_alias_one

Method test_recursive_union_alias_one

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

Source from the content-addressed store, hash-verified

279 )
280
281 def test_recursive_union_alias_one(self):
282 s1 = select(literal(0).label("x"))
283 cte = s1.cte(name="cte", recursive=True)
284 cte = cte.union_all(select(cte.c.x + 1).where(cte.c.x < 10)).alias(
285 "cr1"
286 )
287 s2 = select(cte)
288 self.assert_compile(
289 s2,
290 "WITH RECURSIVE cte(x) AS "
291 "(SELECT :param_1 AS x UNION ALL "
292 "SELECT cte.x + :x_1 AS anon_1 "
293 "FROM cte WHERE cte.x < :x_2) "
294 "SELECT cr1.x FROM cte AS cr1",
295 )
296
297 def test_recursive_union_no_alias_two(self):
298 """

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected