Skip to content

gh-100021: Document that sqlite3's executemany() discards resulting rows #103939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1530,12 +1530,12 @@ Cursor objects

For every item in *parameters*,
repeatedly execute the :ref:`parameterized <sqlite3-placeholders>`
SQL statement *sql*.
:abbr:`DML (Data Manipulation Language)` SQL statement *sql*.

Uses the same implicit transaction handling as :meth:`~Cursor.execute`.

:param str sql:
A single SQL :abbr:`DML (Data Manipulation Language)` statement.
A single SQL DML statement.

:param parameters:
An :term:`!iterable` of parameters to bind with
Expand All @@ -1558,6 +1558,13 @@ Cursor objects
# cur is an sqlite3.Cursor object
cur.executemany("INSERT INTO data VALUES(?)", rows)

.. note::

Any resulting rows are discarded,
including DML statements with `RETURNING clauses`_.

.. _RETURNING clauses: https://www.sqlite.org/lang_returning.html

.. deprecated-removed:: 3.12 3.14

:exc:`DeprecationWarning` is emitted if
Expand Down