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

Method test_insert_from_select

test/sql/test_compiler.py:7780–7792  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7778 )
7779
7780 def test_insert_from_select(self):
7781 astring = Column("a", String)
7782 aint = Column("a", Integer)
7783 m = MetaData()
7784 Table("t1", m, astring)
7785 t2 = Table("t2", m, aint)
7786
7787 stmt = t2.insert().from_select(["a"], select(astring)).returning(aint)
7788 comp = stmt.compile(dialect=postgresql.dialect())
7789 eq_(
7790 comp._create_result_map(),
7791 {"a": ("a", (aint, "a", "a", "t2_a"), aint.type, 0)},
7792 )
7793
7794 def test_nested_api(self):
7795 from sqlalchemy.engine.cursor import CursorResultMetaData

Callers

nothing calls this directly

Calls 11

ColumnClass · 0.90
MetaDataClass · 0.90
TableClass · 0.90
selectFunction · 0.90
eq_Function · 0.90
from_selectMethod · 0.80
_create_result_mapMethod · 0.80
returningMethod · 0.45
insertMethod · 0.45
compileMethod · 0.45
dialectMethod · 0.45

Tested by

no test coverage detected