MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_correlated_update_two

Method test_correlated_update_two

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

Source from the content-addressed store, hash-verified

274 )
275
276 def test_correlated_update_two(self):
277 table1 = self.tables.mytable
278
279 mt = table1.alias()
280 u = update(table1).values(
281 {
282 table1.c.name: select(mt.c.name)
283 .where(mt.c.myid == table1.c.myid)
284 .scalar_subquery()
285 }
286 )
287 self.assert_compile(
288 u,
289 "UPDATE mytable SET name=(SELECT mytable_1.name FROM "
290 "mytable AS mytable_1 WHERE "
291 "mytable_1.myid = mytable.myid)",
292 )
293
294 def test_correlated_update_three(self):
295 table1 = self.tables.mytable

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected