MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_table_valued_one

Method test_table_valued_one

test/sql/test_functions.py:1787–1805  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1785 )
1786
1787 def test_table_valued_one(self):
1788 assets_transactions = table(
1789 "assets_transactions", column("id"), column("contents", JSON)
1790 )
1791
1792 jb = func.jsonb_each(assets_transactions.c.contents).table_valued(
1793 "key", "value"
1794 )
1795
1796 stmt = select(assets_transactions.c.id, jb.c.key, jb.c.value).join(
1797 jb, true()
1798 )
1799
1800 self.assert_compile(
1801 stmt,
1802 "SELECT assets_transactions.id, anon_1.key, anon_1.value "
1803 "FROM assets_transactions "
1804 "JOIN jsonb_each(assets_transactions.contents) AS anon_1 ON true",
1805 )
1806
1807 def test_table_valued_two(self):
1808 """

Callers

nothing calls this directly

Calls 7

tableFunction · 0.90
columnFunction · 0.90
selectFunction · 0.90
trueFunction · 0.90
assert_compileMethod · 0.80
table_valuedMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected