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 /lib/sqlalchemy/engine/base.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 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index e74e00d84..3d192a9be 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -719,10 +719,10 @@ class Connection(Connectable): .. index:: single: thread safety; Connection """ - options = {} + _execution_options = util.frozendict() def __init__(self, engine, connection=None, close_with_result=False, - _branch=False, _options=None): + _branch=False, _execution_options=None): """Construct a new Connection. Connection objects are typically constructed by an @@ -736,8 +736,8 @@ class Connection(Connectable): self.__savepoint_seq = 0 self.__branch = _branch self.__invalid = False - if _options: - self.options = _options + if _execution_options: + self._execution_options = self._execution_options.union(_execution_options) def _branch(self): """Return a new Connection which references this Connection's @@ -750,7 +750,7 @@ class Connection(Connectable): return self.engine.Connection(self.engine, self.__connection, _branch=True) - def _with_options(self, **opt): + def execution_options(self, **opt): """Add keyword options to a Connection generatively. Experimental. May change the name/signature at @@ -763,7 +763,7 @@ class Connection(Connectable): """ return self.engine.Connection( self.engine, self.__connection, - _branch=self.__branch, _options=opt) + _branch=self.__branch, _execution_options=opt) @property def dialect(self): |