MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_with_hint_table

Method test_with_hint_table

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

Source from the content-addressed store, hash-verified

6387 )
6388
6389 def test_with_hint_table(self):
6390 stmt = (
6391 select(table1)
6392 .select_from(
6393 table1.join(table2, table1.c.myid == table2.c.otherid)
6394 )
6395 .with_hint(table1, "use some_hint")
6396 )
6397
6398 # note that some dialects instead use the "with_select_hint"
6399 # hook to put the 'hint' up front
6400 eq_ignore_whitespace(
6401 str(stmt),
6402 "SELECT mytable.myid, mytable.name, mytable.description "
6403 "FROM mytable [use some_hint] "
6404 "JOIN myothertable ON mytable.myid = myothertable.otherid",
6405 )
6406
6407 def test_with_hint_statement(self):
6408 stmt = (

Callers

nothing calls this directly

Calls 5

selectFunction · 0.90
eq_ignore_whitespaceFunction · 0.90
with_hintMethod · 0.45
select_fromMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected