summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/__init__.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-04-21 12:51:13 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-05-01 16:09:24 -0400
commitaded39f68c29e44a50c85be1ddb370d3d1affe9d (patch)
tree0855ecfe2ecf5092f1e350c33f460571f495f1b8 /lib/sqlalchemy/engine/__init__.py
parent18ce4f9937c2d6753acbb054b4990c7da298a5d7 (diff)
downloadsqlalchemy-aded39f68c29e44a50c85be1ddb370d3d1affe9d.tar.gz
Propose Result as immediate replacement for ResultProxy
As progress is made on the _future.Result, including breaking it out such that DBAPI behaviors are local to specific implementations, it becomes apparent that the Result object is a functional superset of ResultProxy and that basic operations like fetchone(), fetchall(), and fetchmany() behave pretty much exactly the same way on the new object. Reorganize things so that ResultProxy is now referred to as LegacyCursorResult, which subclasses CursorResult that represents the DBAPI-cursor version of Result, making use of a multiple inheritance pattern so that the functionality of Result is also available in non-DBAPI contexts, as will be necessary for some ORM patterns. Additionally propose the composition system for Result that will form the basis for ORM-alternative result systems such as horizontal sharding and dogpile cache. As ORM results will soon be coming directly from instances of Result, these extensions will instead build their own ResultFetchStrategies that perform the special steps to create composed or cached result sets. Also considering at the moment not emitting deprecation warnings for fetchXYZ() methods; the immediate issue is Keystone tests are calling upon it, but as the implementations here are proving to be not in any kind of conflict with how Result works, there's not too much issue leaving them around and deprecating at some later point. References: #5087 References: #4395 Fixes: #4959 Change-Id: I8091919d45421e3f53029b8660427f844fee0228
Diffstat (limited to 'lib/sqlalchemy/engine/__init__.py')
-rw-r--r--lib/sqlalchemy/engine/__init__.py32
1 files changed, 12 insertions, 20 deletions
diff --git a/lib/sqlalchemy/engine/__init__.py b/lib/sqlalchemy/engine/__init__.py
index db5f9dee7..8419cf920 100644
--- a/lib/sqlalchemy/engine/__init__.py
+++ b/lib/sqlalchemy/engine/__init__.py
@@ -25,6 +25,13 @@ from .base import Transaction # noqa
from .base import TwoPhaseTransaction # noqa
from .create import create_engine
from .create import engine_from_config
+from .cursor import BaseCursorResult # noqa
+from .cursor import BufferedColumnResultProxy # noqa
+from .cursor import BufferedColumnRow # noqa
+from .cursor import BufferedRowResultProxy # noqa
+from .cursor import CursorResult # noqa
+from .cursor import FullyBufferedResultProxy # noqa
+from .cursor import LegacyCursorResult # noqa
from .interfaces import Compiled # noqa
from .interfaces import Connectable # noqa
from .interfaces import CreateEnginePlugin # noqa
@@ -33,29 +40,14 @@ from .interfaces import ExceptionContext # noqa
from .interfaces import ExecutionContext # noqa
from .interfaces import TypeCompiler # noqa
from .mock import create_mock_engine
-from .result import BaseResult # noqa
-from .result import BaseRow # noqa
-from .result import BufferedColumnResultProxy # noqa
-from .result import BufferedColumnRow # noqa
-from .result import BufferedRowResultProxy # noqa
-from .result import FullyBufferedResultProxy # noqa
-from .result import LegacyRow # noqa
+from .result import Result # noqa
from .result import result_tuple # noqa
-from .result import ResultProxy # noqa
-from .result import Row # noqa
-from .result import RowMapping # noqa
+from .row import BaseRow # noqa
+from .row import LegacyRow # noqa
+from .row import Row # noqa
+from .row import RowMapping # noqa
from .util import connection_memoize # noqa
from ..sql import ddl # noqa
__all__ = ("create_engine", "engine_from_config", "create_mock_engine")
-
-
-def __go(lcls):
- from .. import future
- from . import result
-
- result._future_Result = future.Result
-
-
-__go(locals())