MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_for_update

Method test_for_update

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

Source from the content-addressed store, hash-verified

2217 )
2218
2219 def test_for_update(self):
2220 self.assert_compile(
2221 table1.select().where(table1.c.myid == 7).with_for_update(),
2222 "SELECT mytable.myid, mytable.name, mytable.description "
2223 "FROM mytable WHERE mytable.myid = :myid_1 FOR UPDATE",
2224 )
2225
2226 # not supported by dialect, should just use update
2227 self.assert_compile(
2228 table1.select()
2229 .where(table1.c.myid == 7)
2230 .with_for_update(nowait=True),
2231 "SELECT mytable.myid, mytable.name, mytable.description "
2232 "FROM mytable WHERE mytable.myid = :myid_1 FOR UPDATE",
2233 )
2234
2235 def test_alias(self):
2236 # 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