MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_basic_subquery_resultmap

Method test_basic_subquery_resultmap

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

Source from the content-addressed store, hash-verified

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