MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_update_hint

Method test_update_hint

test/dialect/mssql/test_compiler.py:207–221  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

205 )
206
207 def test_update_hint(self):
208 t = table("sometable", column("somecolumn"))
209 for targ in (None, t):
210 for darg in ("*", "mssql"):
211 self.assert_compile(
212 t.update()
213 .where(t.c.somecolumn == "q")
214 .values(somecolumn="x")
215 .with_hint(
216 "WITH (PAGLOCK)", selectable=targ, dialect_name=darg
217 ),
218 "UPDATE sometable WITH (PAGLOCK) "
219 "SET somecolumn=:somecolumn "
220 "WHERE sometable.somecolumn = :somecolumn_1",
221 )
222
223 def test_update_exclude_hint(self):
224 t = table("sometable", column("somecolumn"))

Callers

nothing calls this directly

Calls 7

tableFunction · 0.90
columnFunction · 0.90
assert_compileMethod · 0.80
with_hintMethod · 0.45
valuesMethod · 0.45
whereMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected