]> 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:11 +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

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

index 2aff7d8b6df9c65ef4d3aaaf521a488acf80f46d..8c44c0b2d2b88abc801f6a8173fc96646273e0c2 100644 (file)
@@ -1622,7 +1622,6 @@ class MSExecutionContext(default.DefaultExecutionContext):
     _select_lastrowid = False
     _lastrowid = None
     _rowcount = None
-    _result_strategy = None
 
     def _opt_encode(self, statement):
 
@@ -1749,14 +1748,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 aab6b2de87675f3212660fc3a360bde156a94473..860c1faf95306eaf67cf28e7c1b86d6a50d9c94b 100644 (file)
@@ -2042,10 +2042,6 @@ class ExecutionContext:
            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()
 
@@ -2059,69 +2055,6 @@ class ExecutionContext:
 
         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."""