MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_for_update

Method test_for_update

test/sql/test_compiler.py:2195–2209  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2193 )
2194
2195 def test_for_update(self):
2196 self.assert_compile(
2197 table1.select().where(table1.c.myid == 7).with_for_update(),
2198 "SELECT mytable.myid, mytable.name, mytable.description "
2199 "FROM mytable WHERE mytable.myid = :myid_1 FOR UPDATE",
2200 )
2201
2202 # not supported by dialect, should just use update
2203 self.assert_compile(
2204 table1.select()
2205 .where(table1.c.myid == 7)
2206 .with_for_update(nowait=True),
2207 "SELECT mytable.myid, mytable.name, mytable.description "
2208 "FROM mytable WHERE mytable.myid = :myid_1 FOR UPDATE",
2209 )
2210
2211 def test_alias(self):
2212 # test the alias for a table1. column names stay the same,

Callers

nothing calls this directly

Calls 4

assert_compileMethod · 0.80
with_for_updateMethod · 0.45
whereMethod · 0.45
selectMethod · 0.45

Tested by

no test coverage detected