]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fixed up docs for execution_options() across all three locations.
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 9 Mar 2010 23:45:30 +0000 (18:45 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 9 Mar 2010 23:45:30 +0000 (18:45 -0500)
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/sql/expression.py

index 46907dfcf97ab89b3690a22c6911a0772539a649..ea62829543f1289875da40ef2142c324607a8676 100644 (file)
@@ -767,15 +767,20 @@ class Connection(Connectable):
         return self.engine.Connection(self.engine, self.__connection, _branch=True)
     
     def execution_options(self, **opt):
-        """Add keyword options to a Connection generatively.
+        """ Set non-SQL options for the connection which take effect during execution.
         
-        Experimental.  May change the name/signature at 
-        some point.
-        
-        If made public, strongly consider the name
-        "options()" so as to be consistent with
-        orm.Query.options().
+        The method returns a copy of this :class:`Connection` which references
+        the same underlying DBAPI connection, but also defines the given execution
+        options which will take effect for a call to :meth:`execute`.  As the new 
+        :class:`Connection` references the same underlying resource, it is probably
+        best to ensure that the copies would be discarded immediately, which
+        is implicit if used as in::
         
+            result = connection.execution_options(stream_results=True).execute(stmt)
+            
+        The options are the same as those accepted by 
+        :meth:`sqlalchemy.sql.expression.Executable.execution_options`.
+
         """
         return self.engine.Connection(
                     self.engine, self.__connection,
index a477ea54403b95d4d8845ed5f9068a40c64442f9..0f68e0a41d55a794a04a283a4862cb0b9a54d993 100644 (file)
@@ -691,14 +691,14 @@ class Query(object):
 
     @_generative()
     def execution_options(self, **kwargs):
-        """ Set non-SQL options for the resulting statement, 
-        such as dialect-specific options.
+        """ Set non-SQL options which take effect during execution.
         
-        The only option currently understood is ``stream_results=True``, 
-        only used by Psycopg2 to enable "server side cursors".  This option
-        only has a useful effect if used in conjunction with
-        :meth:`~sqlalchemy.orm.query.Query.yield_per()`,
-        which currently sets ``stream_results`` to ``True`` automatically.
+        The options are the same as those accepted by 
+        :meth:`sqlalchemy.sql.expression.Executable.execution_options`.
+        
+        Note that the ``stream_results`` execution option is enabled
+        automatically if the :meth:`~sqlalchemy.orm.query.Query.yield_per()`
+        method is used.
 
         """
         _execution_options = self._execution_options.copy()
index c559f3850bc0afa98f07bae398de8797f86bbe83..2e0a0b8032deedf5e6d380bd56193b1e3fb38751 100644 (file)
@@ -2235,7 +2235,13 @@ class _Generative(object):
 
 
 class Executable(_Generative):
-    """Mark a ClauseElement as supporting execution."""
+    """Mark a ClauseElement as supporting execution.
+    
+    :class:`Executable` is a superclass for all "statement" types
+    of objects, including :func:`select`, :func:`delete`, :func:`update`,
+    :func:`insert`, :func:`text`.
+     
+    """
 
     supports_execution = True
     _execution_options = util.frozendict()
@@ -2263,6 +2269,12 @@ class Executable(_Generative):
           of many DBAPIs.  The flag is currently understood only by the
           psycopg2 dialect.
 
+        See also:
+        
+            :meth:`sqlalchemy.engine.base.Connection.execution_options()`
+
+            :meth:`sqlalchemy.orm.query.Query.execution_options()`
+            
         """
         self._execution_options = self._execution_options.union(kw)