Skip to content

Commit

Permalink
[3.11] pythongh-100021: Document that sqlite3's executemany() discard…
Browse files Browse the repository at this point in the history
…s resulting rows (python#103939)
  • Loading branch information
erlend-aasland committed Apr 28, 2023
1 parent 294398c commit 3aff9ba
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1363,12 +1363,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 @@ -1391,6 +1391,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

.. method:: executescript(sql_script, /)

Execute the SQL statements in *sql_script*.
Expand Down

0 comments on commit 3aff9ba

Please sign in to comment.