From 770e1ddc1338f5b4ca603bd273b985955bd65126 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 24 Jan 2010 22:50:58 +0000 Subject: - 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(). --- test/dialect/test_postgresql.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'test/dialect/test_postgresql.py') 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 -- cgit v1.2.1