]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
pass executemany context to _repr_params
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 9 Oct 2019 17:55:19 +0000 (13:55 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 11 Oct 2019 15:11:42 +0000 (11:11 -0400)
commit9488480abea15298ded6996aa13b42edf134e467
tree6d6e6a0cac425ea848642d6d065dbecbd8f07a7b
parentcab08ea1834ac519f124789b835afa6832972b1c
pass executemany context to _repr_params

Fixed bug where parameter repr as used in logging and error reporting needs
additional context in order to distinguish between a list of parameters for
a single statement and a list of parameter lists, as the "list of lists"
structure could also indicate a single parameter list where the first
parameter itself is a list, such as for an array parameter.   The
engine/connection now passes in an additional boolean indicating how the
parameters should be considered.  The only SQLAlchemy backend that expects
arrays as parameters is that of  psycopg2 which uses pyformat parameters,
so this issue has not been too apparent, however as other drivers that use
positional gain more features it is important that this be supported. It
also eliminates the need for the parameter repr function to guess based on
the parameter structure passed.

Fixes: #4902
Change-Id: I086246ee0eb51484adbefd83e07295fa56576c5f
doc/build/changelog/unreleased_13/4902.rst [new file with mode: 0644]
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/exc.py
lib/sqlalchemy/sql/util.py
lib/sqlalchemy/testing/__init__.py
lib/sqlalchemy/testing/assertions.py
test/base/test_except.py
test/engine/test_logging.py