]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Result initial introduction
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 4 Jun 2019 21:29:20 +0000 (17:29 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 21 Feb 2020 22:53:33 +0000 (17:53 -0500)
commitf559f378c47811b5528ad1769cb86925e85fd1e5
treefd8325501a96cf1e4280c15f267f63b2af7b5f97
parent93b7767d00267ebe149cabcae7246b6796352eb8
Result initial introduction

This builds on cc718cccc0bf8a01abdf4068c7ea4f3 which moved
RowProxy to Row, allowing Row to be more like a named tuple.

- KeyedTuple in ORM is replaced with Row

- ResultSetMetaData broken out into "simple" and "cursor" versions
  for ORM and Core, as well as LegacyCursor version.

- Row now has _mapping attribute that supplies full mapping behavior.
Row and SimpleRow both have named tuple behavior otherwise.
LegacyRow has some mapping features on the tuple which emit
deprecation warnings (e.g. keys(), values(), etc).   the biggest
change for mapping->tuple is the behavior of __contains__ which
moves from testing of "key in row" to "value in row".

- ResultProxy breaks into ResultProxy and FutureResult (interim),
the latter has the newer APIs.   Made available to dialects
using execution options.

- internal reflection methods and most tests move off of implicit
Row mapping behavior and move to row._mapping, result.mappings()
method using future result

- a new strategy system for cursor handling replaces the various
subclasses of RowProxy

- some execution context adjustments. We will leave EC in but
refined things like get_result_proxy() and out parameter handling.
Dialects for 1.4 will need to adjust from get_result_proxy()
to get_result_cursor_strategy(), if they are using this method

- out parameter handling now accommodated by get_out_parameter_values()
EC method.   Oracle changes for this.  external dialect for
DB2 for example will also need to adjust for this.

- deprecate case_insensitive flag for engine / result, this
feature is not used

mapping-methods on Row are deprecated, and replaced with
Row._mapping.<meth>, including:

   row.keys()  -> use row._mapping.keys()
   row.items()  -> use row._mapping.items()
   row.values() -> use row._mapping.values()
   key in row  -> use key in row._mapping
   int in row  -> use int < len(row)

Fixes: #4710
Fixes: #4878
Change-Id: Ieb9085e9bcff564359095b754da9ae0af55679f0
66 files changed:
doc/build/changelog/migration_14.rst
doc/build/changelog/migration_20.rst
doc/build/changelog/unreleased_14/4710.rst [new file with mode: 0644]
doc/build/changelog/unreleased_14/4710_row.rst [deleted file]
doc/build/changelog/unreleased_14/4878.rst [new file with mode: 0644]
doc/build/core/connections.rst
doc/build/core/future.rst [new file with mode: 0644]
doc/build/core/index.rst
doc/build/core/tutorial.rst
doc/build/index.rst
doc/build/orm/loading_columns.rst
doc/build/orm/query.rst
doc/build/orm/tutorial.rst
lib/sqlalchemy/cextension/resultproxy.c
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/mysql/mysqlconnector.py
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/postgresql/psycopg2.py
lib/sqlalchemy/engine/__init__.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/create.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/interfaces.py
lib/sqlalchemy/engine/result.py
lib/sqlalchemy/engine/row.py [new file with mode: 0644]
lib/sqlalchemy/ext/baked.py
lib/sqlalchemy/future/__init__.py
lib/sqlalchemy/future/result.py [new file with mode: 0644]
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/persistence.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/testing/profiling.py
lib/sqlalchemy/testing/suite/test_results.py
lib/sqlalchemy/testing/warnings.py
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/_collections.py
regen_callcounts.tox.ini
test/aaa_profiling/test_resultset.py
test/aaa_profiling/test_zoomark.py
test/base/test_utils.py
test/dialect/postgresql/test_types.py
test/dialect/test_sqlite.py
test/orm/test_assorted_eager.py
test/orm/test_deprecations.py
test/orm/test_loading.py
test/orm/test_pickled.py
test/orm/test_query.py
test/orm/test_unitofwork.py
test/profiles.txt
test/requirements.py
test/sql/test_compiler.py
test/sql/test_defaults.py
test/sql/test_deprecations.py
test/sql/test_functions.py
test/sql/test_insert_exec.py
test/sql/test_query.py
test/sql/test_resultset.py
test/sql/test_returning.py
test/sql/test_type_expressions.py
test/sql/test_types.py
test/sql/test_unicode.py