]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Propose Result as immediate replacement for ResultProxy
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 21 Apr 2020 16:51:13 +0000 (12:51 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 1 May 2020 20:09:24 +0000 (16:09 -0400)
commitaded39f68c29e44a50c85be1ddb370d3d1affe9d
tree0855ecfe2ecf5092f1e350c33f460571f495f1b8
parent18ce4f9937c2d6753acbb054b4990c7da298a5d7
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
31 files changed:
doc/build/changelog/migration_14.rst
doc/build/changelog/migration_20.rst
doc/build/changelog/unreleased_14/result.rst [new file with mode: 0644]
doc/build/core/tutorial.rst
lib/sqlalchemy/cextension/resultproxy.c
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/engine/__init__.py
lib/sqlalchemy/engine/cursor.py [new file with mode: 0644]
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/result.py
lib/sqlalchemy/engine/row.py
lib/sqlalchemy/exc.py
lib/sqlalchemy/future/__init__.py
lib/sqlalchemy/future/result.py [deleted file]
lib/sqlalchemy/orm/exc.py
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/testing/fixtures.py
lib/sqlalchemy/testing/suite/test_insert.py
test/aaa_profiling/test_memusage.py
test/aaa_profiling/test_resultset.py
test/base/test_result.py [new file with mode: 0644]
test/base/test_utils.py
test/engine/test_execute.py
test/orm/test_unitofworkv2.py
test/orm/test_versioning.py
test/sql/test_compiler.py
test/sql/test_resultset.py