]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
remove never-used get_result_cursor_strategy() method
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 19 Feb 2022 18:51:22 +0000 (13:51 -0500)
committermike bayer <mike_mp@zzzcomputing.com>
Sat, 19 Feb 2022 20:34:16 +0000 (20:34 +0000)
This method I would assume got committed during the
1.4 engine refactor, where we moved from different kinds of
ResultProxy implementations to different strategy
classes instead.   These strategies are set up by
dialects by setting "self.cursor_fetch_strategy"
in the execution context.   The method here was
likely a previous iteration of that which got merged
but was never used.

Change-Id: Iec292428f41c2c245bf7ae78beaa14786c28846c
(cherry picked from commit ec4a4910aa9ecc516cf3b096cb053fd9be7f82cc)

lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/engine/interfaces.py

index 5d8e50213abc87a6930c7888287998efae19f0db..2006763b13bd18856aec643e41464909d7bb523a 100644 (file)
@@ -1625,7 +1625,6 @@ class MSExecutionContext(default.DefaultExecutionContext):
     _select_lastrowid = False
     _lastrowid = None
     _rowcount = None
-    _result_strategy = None
 
     def _opt_encode(self, statement):
 
@@ -1757,14 +1756,6 @@ class MSExecutionContext(default.DefaultExecutionContext):
             except Exception:
                 pass
 
-    def get_result_cursor_strategy(self, result):
-        if self._result_strategy:
-            return self._result_strategy
-        else:
-            return super(MSExecutionContext, self).get_result_cursor_strategy(
-                result
-            )
-
     def fire_sequence(self, seq, type_):
         return self._execute_scalar(
             (
index e86fa2b6e78553b687314ed3b92728d61b6b5a03..4f2524aef2dfa4155ab657592e7bc8798ccd4b41 100644 (file)
@@ -1418,10 +1418,6 @@ class ExecutionContext(object):
            set.  This replaces the practice of setting out parameters within
            the now-removed ``get_result_proxy()`` method.
 
-        .. seealso::
-
-            :meth:`.ExecutionContext.get_result_cursor_strategy`
-
         """
         raise NotImplementedError()
 
@@ -1435,69 +1431,6 @@ class ExecutionContext(object):
 
         raise NotImplementedError()
 
-    def get_result_cursor_strategy(self, result):
-        """Return a result cursor strategy for a given result object.
-
-        This method is implemented by the :class:`.DefaultDialect` and is
-        only needed by implementing dialects in the case where some special
-        steps regarding the cursor must be taken, such as manufacturing
-        fake results from some other element of the cursor, or pre-buffering
-        the cursor's results.
-
-        A simplified version of the default implementation is::
-
-            from sqlalchemy.engine.result import DefaultCursorFetchStrategy
-
-            class MyExecutionContext(DefaultExecutionContext):
-                def get_result_cursor_strategy(self, result):
-                    return DefaultCursorFetchStrategy.create(result)
-
-        Above, the :class:`.DefaultCursorFetchStrategy` will be applied
-        to the result object.   For results that are pre-buffered from a
-        cursor that might be closed, an implementation might be::
-
-
-            from sqlalchemy.engine.result import (
-                FullyBufferedCursorFetchStrategy
-            )
-
-            class MyExecutionContext(DefaultExecutionContext):
-                _pre_buffered_result = None
-
-                def pre_exec(self):
-                    if self.special_condition_prebuffer_cursor():
-                        self._pre_buffered_result = (
-                            self.cursor.description,
-                            self.cursor.fetchall()
-                        )
-
-                def get_result_cursor_strategy(self, result):
-                    if self._pre_buffered_result:
-                        description, cursor_buffer = self._pre_buffered_result
-                        return (
-                            FullyBufferedCursorFetchStrategy.
-                                create_from_buffer(
-                                    result, description, cursor_buffer
-                            )
-                        )
-                    else:
-                        return DefaultCursorFetchStrategy.create(result)
-
-        This method replaces the previous not-quite-documented
-        ``get_result_proxy()`` method.
-
-        .. versionadded:: 1.4  - result objects now interpret cursor results
-           based on a pluggable "strategy" object, which is delivered
-           by the :class:`.ExecutionContext` via the
-           :meth:`.ExecutionContext.get_result_cursor_strategy` method.
-
-        .. seealso::
-
-            :meth:`.ExecutionContext.get_out_parameter_values`
-
-        """
-        raise NotImplementedError()
-
     def handle_dbapi_exception(self, e):
         """Receive a DBAPI exception which occurred upon execute, result
         fetch, etc."""