MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_non_correlated_select

Method test_non_correlated_select

test/sql/test_delete.py:119–132  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

117 )
118
119 def test_non_correlated_select(self):
120 table1, table2 = self.tables.mytable, self.tables.myothertable
121
122 # test a non-correlated WHERE clause
123 s = select(table2.c.othername).where(table2.c.otherid == 7)
124 self.assert_compile(
125 delete(table1).where(table1.c.name == s.scalar_subquery()),
126 "DELETE FROM mytable "
127 "WHERE mytable.name = ("
128 "SELECT myothertable.othername "
129 "FROM myothertable "
130 "WHERE myothertable.otherid = :otherid_1"
131 ")",
132 )
133
134 def test_correlated_select(self):
135 table1, table2 = self.tables.mytable, self.tables.myothertable

Callers

nothing calls this directly

Calls 5

selectFunction · 0.90
deleteFunction · 0.90
assert_compileMethod · 0.80
whereMethod · 0.45
scalar_subqueryMethod · 0.45

Tested by

no test coverage detected