Skip to content

Commit c443374

Browse files
committed
Adjust executemany() docs
Remove the `copy_records_to_table()` note as `executemany()` is almost as efficient now and rephrase the note about the new behavior with respect to atomicity.
1 parent c162909 commit c443374

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

asyncpg/connection.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -321,23 +321,17 @@ async def executemany(self, command: str, args, *, timeout: float=None):
321321
:param float timeout: Optional timeout value in seconds.
322322
:return None: This method discards the results of the operations.
323323
324-
.. note::
325-
326-
When inserting a large number of rows,
327-
use :meth:`Connection.copy_records_to_table()` instead,
328-
it is much more efficient for this purpose.
329-
330324
.. versionadded:: 0.7.0
331325
332326
.. versionchanged:: 0.11.0
333327
`timeout` became a keyword-only parameter.
334328
335329
.. versionchanged:: 0.22.0
336-
The execution was changed to be in an implicit transaction if there
337-
was no explicit transaction, so that it will no longer end up with
338-
partial success. If you still need the previous behavior to
339-
progressively execute many args, please use a loop with prepared
340-
statement instead.
330+
``executemany()`` is now an atomic operation, which means that
331+
either all executions succeed, or none at all. This is in contrast
332+
to prior versions, where the effect of already-processed iterations
333+
would remain in place when an error has occurred, unless
334+
``executemany()`` was called in a transaction.
341335
"""
342336
self._check_open()
343337
return await self._executemany(command, args, timeout)

0 commit comments

Comments
 (0)