MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_basic_subquery_resultmap

Method test_basic_subquery_resultmap

test/sql/test_text.py:594–615  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

592 )
593
594 def test_basic_subquery_resultmap(self):
595 t = (
596 text("select id, name from user")
597 .columns(id=Integer, name=String)
598 .subquery()
599 )
600
601 stmt = select(table1.c.myid).select_from(
602 table1.join(t, table1.c.myid == t.c.id)
603 )
604 compiled = stmt.compile()
605 eq_(
606 compiled._create_result_map(),
607 {
608 "myid": (
609 "myid",
610 (table1.c.myid, "myid", "myid", "mytable_myid"),
611 table1.c.myid.type,
612 0,
613 )
614 },
615 )
616
617 def test_column_collection_ordered(self):
618 t = text("select a, b, c from foo").columns(

Callers

nothing calls this directly

Calls 9

textFunction · 0.90
selectFunction · 0.90
eq_Function · 0.90
_create_result_mapMethod · 0.80
subqueryMethod · 0.45
columnsMethod · 0.45
select_fromMethod · 0.45
joinMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected