Skip to content

Commit

Permalink
Document sqlite3.connect() as implicitly opening transactions in the …
Browse files Browse the repository at this point in the history
…new PEP-249 manual commit mode
  • Loading branch information
geryogam committed Nov 27, 2022
1 parent dfc2732 commit 86b8244
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2467,10 +2467,9 @@ It is suggested to set *autocommit* to ``False``,
which implies :pep:`249`-compliant transaction control.
This means:

* :mod:`!sqlite3` ensures that a transaction is always open,
so :meth:`Connection.commit` and :meth:`Connection.rollback`
will implicitly open a new transaction immediately after closing
the pending one.
* :func:`connect`, :meth:`Connection.commit`, and :meth:`Connection.rollback`
implicitly open a new transaction to ensure that a transaction is always
open.
:mod:`!sqlite3` uses ``BEGIN DEFERRED`` statements when opening transactions.
* Transactions should be committed explicitly using :meth:`!commit`.
* Transactions should be rolled back explicitly using :meth:`!rollback`.
Expand Down

0 comments on commit 86b8244

Please sign in to comment.