MCPcopy Index your code
hub / github.com/sqlalchemy/sqlalchemy / test_correlated_update_seven

Method test_correlated_update_seven

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

Source from the content-addressed store, hash-verified

361 )
362
363 def test_correlated_update_seven(self):
364 table1 = self.tables.mytable
365 table2 = self.tables.myothertable
366
367 u = (
368 table1.update()
369 .values(name="foo")
370 .where(table2.c.otherid == table1.c.myid)
371 )
372
373 # this is the "default_enhanced" compiler. there's no UPDATE FROM
374 # in the base compiler.
375 # See also test/dialect/mssql/test_compiler->test_update_from().
376 self.assert_compile(
377 u,
378 "UPDATE mytable SET name=:name "
379 "FROM myothertable WHERE myothertable.otherid = mytable.myid",
380 )
381
382 def test_binds_that_match_columns(self):
383 """test bind params named after column names

Callers

nothing calls this directly

Calls 4

assert_compileMethod · 0.80
whereMethod · 0.45
valuesMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected