MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / test_from_function_aas

Method test_from_function_aas

test/orm/test_joins.py:3323–3348  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3321 )
3322
3323 def test_from_function_aas(self):
3324 Bookcase = self.classes.Bookcase
3325
3326 s = fixture_session()
3327
3328 subq = s.query(Bookcase).subquery()
3329
3330 ba = aliased(Bookcase, subq)
3331
3332 srf = lateral(func.generate_series(1, ba.bookcase_shelves))
3333
3334 self.assert_compile(
3335 s.query(ba).join(srf, true()),
3336 "SELECT anon_1.bookcase_id AS anon_1_bookcase_id, "
3337 "anon_1.bookcase_owner_id AS anon_1_bookcase_owner_id, "
3338 "anon_1.bookcase_shelves AS anon_1_bookcase_shelves, "
3339 "anon_1.bookcase_width AS anon_1_bookcase_width "
3340 "FROM (SELECT bookcases.bookcase_id AS bookcase_id, "
3341 "bookcases.bookcase_owner_id AS bookcase_owner_id, "
3342 "bookcases.bookcase_shelves AS bookcase_shelves, "
3343 "bookcases.bookcase_width AS bookcase_width FROM bookcases) "
3344 "AS anon_1 "
3345 "JOIN LATERAL "
3346 "generate_series(:generate_series_1, anon_1.bookcase_shelves) "
3347 "AS anon_2 ON true",
3348 )
3349
3350
3351class JoinRawTablesWLegacyTest(QueryTest, AssertsCompiledSQL):

Callers

nothing calls this directly

Calls 8

fixture_sessionFunction · 0.90
aliasedFunction · 0.90
lateralFunction · 0.90
trueFunction · 0.90
assert_compileMethod · 0.80
subqueryMethod · 0.45
queryMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected