summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-02-19 13:51:22 -0500
committermike bayer <mike_mp@zzzcomputing.com>2022-02-19 20:34:11 +0000
commit69e5dfde3ed6cbecae82459a82e0a1fda6228b0e (patch)
treedf28666f9a725f5e5f0c4f666917d3c8552dcc9a
parente120837b682a3a822c2dff136ad48b1ca9fb6ce2 (diff)
downloadsqlalchemy-69e5dfde3ed6cbecae82459a82e0a1fda6228b0e.tar.gz
remove never-used get_result_cursor_strategy() method
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
-rw-r--r--lib/sqlalchemy/dialects/mssql/base.py9
-rw-r--r--lib/sqlalchemy/engine/interfaces.py67
2 files changed, 0 insertions, 76 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py
index 2aff7d8b6..8c44c0b2d 100644
--- a/lib/sqlalchemy/dialects/mssql/base.py
+++ b/lib/sqlalchemy/dialects/mssql/base.py
@@ -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(
(
diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py
index aab6b2de8..860c1faf9 100644
--- a/lib/sqlalchemy/engine/interfaces.py
+++ b/lib/sqlalchemy/engine/interfaces.py
@@ -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."""