diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-24 22:50:58 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-01-24 22:50:58 +0000 |
commit | 770e1ddc1338f5b4ca603bd273b985955bd65126 (patch) | |
tree | f84cf04dc070382169ce98037d90fe3233a132d4 /test/dialect/test_postgresql.py | |
parent | d3e49722d19068ccc6cdd577748b4b8df158db9c (diff) | |
download | sqlalchemy-770e1ddc1338f5b4ca603bd273b985955bd65126.tar.gz |
- Connection has execution_options(), generative method
which accepts keywords that affect how the statement
is executed w.r.t. the DBAPI. Currently supports
"stream_results", causes psycopg2 to use a server
side cursor for that statement. Can also be set
upon select() and text() constructs directly as well
as ORM Query().
Diffstat (limited to 'test/dialect/test_postgresql.py')
-rw-r--r-- | test/dialect/test_postgresql.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py index c0a93afcf..952f633ae 100644 --- a/test/dialect/test_postgresql.py +++ b/test/dialect/test_postgresql.py @@ -1461,6 +1461,14 @@ class ServerSideCursorsTest(TestBase, AssertsExecutionResults): # ... but enabled for this one. assert result.cursor.name + # and this one + result = engine.connect().execution_options(stream_results=True).execute("select 1") + assert result.cursor.name + + # not this one + result = engine.connect().execution_options(stream_results=False).execute(s) + assert not result.cursor.name + def test_ss_explicitly_disabled(self): s = select([1]).execution_options(stream_results=False) result = ss_engine.execute(s) @@ -1517,7 +1525,7 @@ class ServerSideCursorsTest(TestBase, AssertsExecutionResults): s = text('select 42') result = engine.execute(s) assert not result.cursor.name - s = text('select 42', execution_options=dict(stream_results=True)) + s = text('select 42').execution_options(stream_results=True) result = engine.execute(s) assert result.cursor.name |