classification
Title: sqlite3.Row always read as tuple when supplied to executemany
Type: behavior Stage:
Components: Extension Modules Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ghaering, tony.wu
Priority: normal Keywords:

Created on 2020-09-22 00:43 by tony.wu, last changed 2020-09-22 00:52 by tony.wu.

Files
File name Uploaded Description Edit
row_substitution.py tony.wu, 2020-09-22 00:43 A script that demonstrates the unexpected behavior
Messages (1)
msg377295 - (view) Author: Tony Wu (tony.wu) * Date: 2020-09-22 00:43
Supplying a sequence or sqlite3.Row objects to sqlite3.Connection.executemany will cause the Row objects to be interpreted as Sequences instead of Mappings even if the statement to be executed uses named parameter substitution.

That is, values in the Rows are accessed using their numerical indices instead of column names.

This script demonstrate how this is unexpected behavior.

Issue found in Python 3.8.5 and 3.7.6.
History
Date User Action Args
2020-09-22 00:52:26tony.wusetnosy: + ghaering
2020-09-22 00:43:13tony.wucreate