MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_correlated_update_four

Method test_correlated_update_four

test/sql/test_update.py:317–330  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

315 )
316
317 def test_correlated_update_four(self):
318 table1 = self.tables.mytable
319 table2 = self.tables.myothertable
320
321 # test a non-correlated WHERE clause
322 s = select(table2.c.othername).where(table2.c.otherid == 7)
323 u = update(table1).where(table1.c.name == s.scalar_subquery())
324 self.assert_compile(
325 u,
326 "UPDATE mytable SET myid=:myid, name=:name, "
327 "description=:description WHERE mytable.name = "
328 "(SELECT myothertable.othername FROM myothertable "
329 "WHERE myothertable.otherid = :otherid_1)",
330 )
331
332 def test_correlated_update_five(self):
333 table1 = self.tables.mytable

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected