diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-18 11:44:48 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-09-18 11:44:48 -0400 |
commit | f82f6d55dc05daf2ba0881ded98f5715b70ae3e3 (patch) | |
tree | 0686f4a11aa825fdc1994c566da78382e7dcf071 /test/sql/test_compiler.py | |
parent | e3f07f7206cf0d6a5f2ff9344a365f4657645338 (diff) | |
download | sqlalchemy-f82f6d55dc05daf2ba0881ded98f5715b70ae3e3.tar.gz |
- Added new method :meth:`.Select.with_statement_hint` and ORM
method :meth:`.Query.with_statement_hint` to support statement-level
hints that are not specific to a table.
fixes #3206
Diffstat (limited to 'test/sql/test_compiler.py')
-rw-r--r-- | test/sql/test_compiler.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index d47b58f1f..3e6b87351 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -2420,6 +2420,23 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL): dialect=dialect ) + def test_statement_hints(self): + + stmt = select([table1.c.myid]).\ + with_statement_hint("test hint one").\ + with_statement_hint("test hint two", 'mysql') + + self.assert_compile( + stmt, + "SELECT mytable.myid FROM mytable test hint one", + ) + + self.assert_compile( + stmt, + "SELECT mytable.myid FROM mytable test hint one test hint two", + dialect='mysql' + ) + def test_literal_as_text_fromstring(self): self.assert_compile( and_(text("a"), text("b")), |