MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_correlated_update_five

Method test_correlated_update_five

test/sql/test_update.py:332–345  ·  test/sql/test_update.py::UpdateTest.test_correlated_update_five
(self)

Source from the content-addressed store, hash-verified

330 )
331
332 def test_correlated_update_five(self):
333 table1 = self.tables.mytable
334 table2 = self.tables.myothertable
335
336 class="cm"># test one that is actually correlated...
337 s = select(table2.c.othername).where(table2.c.otherid == table1.c.myid)
338 u = table1.update().where(table1.c.name == s.scalar_subquery())
339 self.assert_compile(
340 u,
341 class="st">"UPDATE mytable SET myid=:myid, name=:name, "
342 class="st">"description=:description WHERE mytable.name = "
343 class="st">"(SELECT myothertable.othername FROM myothertable "
344 class="st">"WHERE myothertable.otherid = mytable.myid)",
345 )
346
347 def test_correlated_update_six(self):
348 table1 = self.tables.mytable

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected