summaryrefslogtreecommitdiff
path: root/test/dialect/test_postgresql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-01-24 22:50:58 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2010-01-24 22:50:58 +0000
commit770e1ddc1338f5b4ca603bd273b985955bd65126 (patch)
treef84cf04dc070382169ce98037d90fe3233a132d4 /test/dialect/test_postgresql.py
parentd3e49722d19068ccc6cdd577748b4b8df158db9c (diff)
downloadsqlalchemy-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.py10
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