MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_join_with_hint

Method test_join_with_hint

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

Source from the content-addressed store, hash-verified

150 )
151
152 def test_join_with_hint(self):
153 t1 = table(
154 "t1",
155 column("a", Integer),
156 column("b", String),
157 column("c", String),
158 )
159 t2 = table(
160 "t2",
161 column("a", Integer),
162 column("b", Integer),
163 column("c", Integer),
164 )
165 join = (
166 t1.join(t2, t1.c.a == t2.c.a)
167 .select()
168 .with_hint(t1, "WITH (NOLOCK)")
169 )
170 self.assert_compile(
171 join,
172 "SELECT t1.a, t1.b, t1.c, t2.a AS a_1, t2.b AS b_1, t2.c AS c_1 "
173 "FROM t1 WITH (NOLOCK) JOIN t2 ON t1.a = t2.a",
174 )
175
176 def test_insert(self):
177 t = table("sometable", column("somecolumn"))

Callers

nothing calls this directly

Calls 6

tableFunction · 0.90
columnFunction · 0.90
assert_compileMethod · 0.80
with_hintMethod · 0.45
selectMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected