From 91460c00b2d921a94d4820c45ecc28d073767731 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Mon, 27 Jun 2022 10:52:19 +0200 Subject: [PATCH 01/10] gh-94017: Improve clarity of sqlite3 transaction handling docs --- Doc/library/sqlite3.rst | 94 ++++++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 38 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index a99485b6ba7bc4..24d6c6a715464c 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -406,9 +406,14 @@ Connection Objects .. attribute:: isolation_level - Get or set the current default isolation level. :const:`None` for autocommit mode or - one of "DEFERRED", "IMMEDIATE" or "EXCLUSIVE". See section - :ref:`sqlite3-controlling-transactions` for a more detailed explanation. + Get or set the current default isolation level. + Set to :const:`None` to disable implicit transaction handling, + or one of "", "DEFERRED", "IMMEDIATE" or "EXCLUSIVE". + Defaults to the former (`""`), unless overridden at :func:`connect`, + using the *isolation_level* parameter. + "" and "DEFERRED" carry the same meaning; + they both imply deferred isolation level. + See :ref:`sqlite3-controlling-transactions` for more details. .. attribute:: in_transaction @@ -868,7 +873,7 @@ Cursor Objects .. method:: execute(sql[, parameters]) - Executes an SQL statement. Values may be bound to the statement using + Execute an SQL statement. Values may be bound to the statement using :ref:`placeholders `. :meth:`execute` will only execute a single SQL statement. If you try to execute @@ -876,13 +881,19 @@ Cursor Objects :meth:`executescript` if you want to execute multiple SQL statements with one call. + If :attr:`isolation_level` is not :const:`None`, + *sql* is an INSERT, UPDATE, DELETE, or REPLACE statement, + and there is no open transaction, + ``sqlite3`` will implicitly open a new transaction. + .. method:: executemany(sql, seq_of_parameters) - Executes a :ref:`parameterized ` SQL command + Execute a :ref:`parameterized ` SQL command against all parameter sequences or mappings found in the sequence - *seq_of_parameters*. The :mod:`sqlite3` module also allows using an + *seq_of_parameters*. The ``sqlite3`` module also allows using an :term:`iterator` yielding parameters instead of a sequence. + Uses the same implicit transaction handling as :meth:`~Cursor.execute`. .. literalinclude:: ../includes/sqlite3/executemany_1.py @@ -893,12 +904,13 @@ Cursor Objects .. method:: executescript(sql_script) - This is a nonstandard convenience method for executing multiple SQL statements - at once. It issues a ``COMMIT`` statement first, then executes the SQL script it - gets as a parameter. This method disregards :attr:`isolation_level`; any - transaction control must be added to *sql_script*. + Execute multiple SQL statements at once. + If there is a pending transaciton, + an implicit ``COMMIT`` statement is executed first. + This method disregards :attr:`isolation_level`; + any transaction control must be added to *sql_script*. - *sql_script* can be an instance of :class:`str`. + *sql_script* must be a :class:`string `. Example: @@ -1425,33 +1437,39 @@ This section shows recipes for common adapters and converters. Controlling Transactions ------------------------ -The underlying ``sqlite3`` library operates in ``autocommit`` mode by default, -but the Python :mod:`sqlite3` module by default does not. - -``autocommit`` mode means that statements that modify the database take effect -immediately. A ``BEGIN`` or ``SAVEPOINT`` statement disables ``autocommit`` -mode, and a ``COMMIT``, a ``ROLLBACK``, or a ``RELEASE`` that ends the -outermost transaction, turns ``autocommit`` mode back on. - -The Python :mod:`sqlite3` module by default issues a ``BEGIN`` statement -implicitly before a Data Modification Language (DML) statement (i.e. -``INSERT``/``UPDATE``/``DELETE``/``REPLACE``). - -You can control which kind of ``BEGIN`` statements :mod:`sqlite3` implicitly -executes via the *isolation_level* parameter to the :func:`connect` -call, or via the :attr:`isolation_level` property of connections. -If you specify no *isolation_level*, a plain ``BEGIN`` is used, which is -equivalent to specifying ``DEFERRED``. Other possible values are ``IMMEDIATE`` -and ``EXCLUSIVE``. - -You can disable the :mod:`sqlite3` module's implicit transaction management by -setting :attr:`isolation_level` to ``None``. This will leave the underlying -``sqlite3`` library operating in ``autocommit`` mode. You can then completely -control the transaction state by explicitly issuing ``BEGIN``, ``ROLLBACK``, -``SAVEPOINT``, and ``RELEASE`` statements in your code. - -Note that :meth:`~Cursor.executescript` disregards -:attr:`isolation_level`; any transaction control must be added explicitly. +The ``sqlite3`` module does not adhere to the transaction handling recommended +by PEP 249. +Instead of keeping a transaction open and requiring the user to use the +:meth:`~Connection.commit` and :meth:`~Connection.rollback` methods, +``sqlite3`` only implicitly opens new transactions before +:meth:`~Cursor.execute` and :meth:`~Cursor.executemany` executes any of the +following statements: + +* INSERT +* UPDATE +* DELETE +* REPLACE + +In addition, any pending transaction is implicitly committed in +:meth:`~Cursor.executescript`, before execution of the given SQL script. +No other implicit transaction handling is performed. + +You can control which kind of ``BEGIN`` statements ``sqlite3`` implicitly +executes via the :attr:`isolation_level` connection attribute. + +The ``sqlite3`` module lets the user choose bypass its transaction handling, by +setting :attr:`isolation_level` to :const:`None`. +This leaves the underlying SQLite library in autocommit mode, +but also allows the user to perform any transaction handling using explicit SQL +statements. +The SQLite library autocommit mode can be queried using the +:attr:`in_transaction` connection attribute. + +.. note:: + + PEP 249's autocommit concept must not be mistaken for SQLite's autocommit + mode. + Though related, they are different concepts with different semantics. .. versionchanged:: 3.6 :mod:`sqlite3` used to implicitly commit an open transaction before DDL From a531aa8c65484cc4e5c1a06eb6d156089d0ce4ee Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Mon, 27 Jun 2022 11:03:43 +0200 Subject: [PATCH 02/10] Incorporate additional changes from gh-93823 --- Doc/library/sqlite3.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 24d6c6a715464c..1460e54c8c427e 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -417,8 +417,11 @@ Connection Objects .. attribute:: in_transaction + This read-only attribute corresponds to the low-level SQLite autocommit + mode. + :const:`True` if a transaction is active (there are uncommitted changes), - :const:`False` otherwise. Read-only attribute. + :const:`False` otherwise. .. versionadded:: 3.2 @@ -884,14 +887,14 @@ Cursor Objects If :attr:`isolation_level` is not :const:`None`, *sql* is an INSERT, UPDATE, DELETE, or REPLACE statement, and there is no open transaction, - ``sqlite3`` will implicitly open a new transaction. + a transaction is implicitly opened before executing *sql*. .. method:: executemany(sql, seq_of_parameters) Execute a :ref:`parameterized ` SQL command against all parameter sequences or mappings found in the sequence - *seq_of_parameters*. The ``sqlite3`` module also allows using an + *seq_of_parameters*. It is also possible to use an :term:`iterator` yielding parameters instead of a sequence. Uses the same implicit transaction handling as :meth:`~Cursor.execute`. @@ -907,7 +910,7 @@ Cursor Objects Execute multiple SQL statements at once. If there is a pending transaciton, an implicit ``COMMIT`` statement is executed first. - This method disregards :attr:`isolation_level`; + No other implicit transaction control is performed; any transaction control must be added to *sql_script*. *sql_script* must be a :class:`string `. From b09fab17aadbc19e1b118cd3b79842d9d2aada61 Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Tue, 28 Jun 2022 01:25:53 +0200 Subject: [PATCH 03/10] Update Doc/library/sqlite3.rst --- Doc/library/sqlite3.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 1460e54c8c427e..ec0acc5e82a1c6 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -411,8 +411,8 @@ Connection Objects or one of "", "DEFERRED", "IMMEDIATE" or "EXCLUSIVE". Defaults to the former (`""`), unless overridden at :func:`connect`, using the *isolation_level* parameter. - "" and "DEFERRED" carry the same meaning; - they both imply deferred isolation level. + Both "" and "DEFERRED" carry the same meaning; + they imply deferred isolation level. See :ref:`sqlite3-controlling-transactions` for more details. .. attribute:: in_transaction From f9f4f97c675cdcf38b7daffb4fbd5791c0f27f10 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Tue, 28 Jun 2022 14:24:56 +0200 Subject: [PATCH 04/10] Adjust wording --- Doc/library/sqlite3.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 1460e54c8c427e..5d4efe851c59c3 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -1442,9 +1442,9 @@ Controlling Transactions The ``sqlite3`` module does not adhere to the transaction handling recommended by PEP 249. -Instead of keeping a transaction open and requiring the user to use the -:meth:`~Connection.commit` and :meth:`~Connection.rollback` methods, -``sqlite3`` only implicitly opens new transactions before +If the connection attribute :attr:`isolation_level` is not :const:`None`, +the following implicit transaction handling is performed: +New transactions are implicitly opened before :meth:`~Cursor.execute` and :meth:`~Cursor.executemany` executes any of the following statements: @@ -1456,11 +1456,13 @@ following statements: In addition, any pending transaction is implicitly committed in :meth:`~Cursor.executescript`, before execution of the given SQL script. No other implicit transaction handling is performed. +Use the :meth:`~Connection.commit` and :meth:`~Connection.rollback` method +to respectively commit and roll back pending transactions. You can control which kind of ``BEGIN`` statements ``sqlite3`` implicitly executes via the :attr:`isolation_level` connection attribute. -The ``sqlite3`` module lets the user choose bypass its transaction handling, by +The ``sqlite3`` module lets the user bypass its transaction handling by setting :attr:`isolation_level` to :const:`None`. This leaves the underlying SQLite library in autocommit mode, but also allows the user to perform any transaction handling using explicit SQL From 576c760d7dff714f1821cd988a8dd2ab0ea1c8c9 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Tue, 28 Jun 2022 14:30:00 +0200 Subject: [PATCH 05/10] Make it clearer that SQLite autocommit mode is a concept belonging to the underlying library --- Doc/library/sqlite3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 748899b5224933..245f8d73239571 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -1467,7 +1467,7 @@ setting :attr:`isolation_level` to :const:`None`. This leaves the underlying SQLite library in autocommit mode, but also allows the user to perform any transaction handling using explicit SQL statements. -The SQLite library autocommit mode can be queried using the +The underlying SQLite library autocommit mode can be queried using the :attr:`in_transaction` connection attribute. .. note:: From a530b3e8034e698575faea8628fa9a51b1ca5cca Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Fri, 1 Jul 2022 23:48:46 +0200 Subject: [PATCH 06/10] Address reviews --- Doc/library/sqlite3.rst | 64 +++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 37 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 245f8d73239571..2df16eea3177cd 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -406,19 +406,18 @@ Connection Objects .. attribute:: isolation_level - Get or set the current default isolation level. + Get or set the isolation level. Set to :const:`None` to disable implicit transaction handling, - or one of "", "DEFERRED", "IMMEDIATE" or "EXCLUSIVE". - Defaults to the former (`""`), unless overridden at :func:`connect`, - using the *isolation_level* parameter. - Both "" and "DEFERRED" carry the same meaning; - they imply deferred isolation level. + or to one of the ``"DEFERRED"``, ``"IMMEDIATE"``, or ``"EXCLUSIVE"`` + transaction handling modes. + If not overridden by the *isolation_level* parameter of :func:`connect`, + the default is ``""``, which is an alias for ``"DEFERRED"``. See :ref:`sqlite3-controlling-transactions` for more details. .. attribute:: in_transaction - This read-only attribute corresponds to the low-level SQLite autocommit - mode. + This read-only attribute corresponds to the low-level SQLite + `autocommit mode`_. :const:`True` if a transaction is active (there are uncommitted changes), :const:`False` otherwise. @@ -884,8 +883,8 @@ Cursor Objects :meth:`executescript` if you want to execute multiple SQL statements with one call. - If :attr:`isolation_level` is not :const:`None`, - *sql* is an INSERT, UPDATE, DELETE, or REPLACE statement, + If :attr:`~Connection.isolation_level` is not :const:`None`, + *sql* is an ``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is no open transaction, a transaction is implicitly opened before executing *sql*. @@ -1441,45 +1440,36 @@ Controlling Transactions ------------------------ The ``sqlite3`` module does not adhere to the transaction handling recommended -by PEP 249. -If the connection attribute :attr:`isolation_level` is not :const:`None`, -the following implicit transaction handling is performed: -New transactions are implicitly opened before -:meth:`~Cursor.execute` and :meth:`~Cursor.executemany` executes any of the -following statements: - -* INSERT -* UPDATE -* DELETE -* REPLACE - -In addition, any pending transaction is implicitly committed in -:meth:`~Cursor.executescript`, before execution of the given SQL script. +by :pep:`249`. +If the connection attribute :attr:`~Connection.isolation_level` +is not :const:`None`, +new transactions are implicitly opened before +:meth:`~Cursor.execute` and :meth:`~Cursor.executemany` executes +``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statements. + +The :meth:`~Cursor.executescript` method implicitly commits +any pending transaction before execution of the given SQL script. No other implicit transaction handling is performed. -Use the :meth:`~Connection.commit` and :meth:`~Connection.rollback` method +Use the :meth:`~Connection.commit` and :meth:`~Connection.rollback` methods to respectively commit and roll back pending transactions. You can control which kind of ``BEGIN`` statements ``sqlite3`` implicitly -executes via the :attr:`isolation_level` connection attribute. +executes via the :attr:`~Connection.isolation_level` attribute. The ``sqlite3`` module lets the user bypass its transaction handling by -setting :attr:`isolation_level` to :const:`None`. -This leaves the underlying SQLite library in autocommit mode, -but also allows the user to perform any transaction handling using explicit SQL -statements. +setting :attr:`~Connection.isolation_level` to :const:`None`. +This leaves the underlying SQLite library in `autocommit mode`_, +but also allows the user to perform their own transaction handling +using explicit SQL statements. The underlying SQLite library autocommit mode can be queried using the -:attr:`in_transaction` connection attribute. - -.. note:: - - PEP 249's autocommit concept must not be mistaken for SQLite's autocommit - mode. - Though related, they are different concepts with different semantics. +:attr:`~Connection.in_transaction` attribute. .. versionchanged:: 3.6 :mod:`sqlite3` used to implicitly commit an open transaction before DDL statements. This is no longer the case. +.. _autocommit mode: https://sqlite.org/lang_transaction.html + Using :mod:`sqlite3` efficiently -------------------------------- From 1473e948d54b18755dcef8daf421e11f48d7ebf7 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Sun, 3 Jul 2022 22:55:55 +0200 Subject: [PATCH 07/10] Last rewrite, I promise --- Doc/library/sqlite3.rst | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 2df16eea3177cd..26e8182c05630a 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -406,13 +406,15 @@ Connection Objects .. attribute:: isolation_level - Get or set the isolation level. - Set to :const:`None` to disable implicit transaction handling, - or to one of the ``"DEFERRED"``, ``"IMMEDIATE"``, or ``"EXCLUSIVE"`` - transaction handling modes. + This attribute controls the :ref:`transaction handling + ` performed by ``sqlite3``. + If set to :const:`None`, transactions are never implicitly opened. + If set to one of ``"DEFERRED"``, ``"IMMEDIATE"``, or ``"EXCLUSIVE"``, + the strings representing the underlying SQLite `transaction behaviour`_, + transactions are implicitly opened before some DML statements. + If not overridden by the *isolation_level* parameter of :func:`connect`, the default is ``""``, which is an alias for ``"DEFERRED"``. - See :ref:`sqlite3-controlling-transactions` for more details. .. attribute:: in_transaction @@ -1441,34 +1443,37 @@ Controlling Transactions The ``sqlite3`` module does not adhere to the transaction handling recommended by :pep:`249`. + If the connection attribute :attr:`~Connection.isolation_level` is not :const:`None`, new transactions are implicitly opened before :meth:`~Cursor.execute` and :meth:`~Cursor.executemany` executes ``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statements. - -The :meth:`~Cursor.executescript` method implicitly commits -any pending transaction before execution of the given SQL script. -No other implicit transaction handling is performed. Use the :meth:`~Connection.commit` and :meth:`~Connection.rollback` methods to respectively commit and roll back pending transactions. +You can chose the underlying SQLite `transaction behaviour`_, +that is the kind of ``BEGIN`` statements ``sqlite3`` implicitly executes, +via the :attr:`~Connection.isolation_level` attribute. -You can control which kind of ``BEGIN`` statements ``sqlite3`` implicitly -executes via the :attr:`~Connection.isolation_level` attribute. - -The ``sqlite3`` module lets the user bypass its transaction handling by -setting :attr:`~Connection.isolation_level` to :const:`None`. +If :attr:`~Connection.isolation_level` is set to :const:`None`, +no transactions are implicitly opened at all. This leaves the underlying SQLite library in `autocommit mode`_, but also allows the user to perform their own transaction handling using explicit SQL statements. The underlying SQLite library autocommit mode can be queried using the :attr:`~Connection.in_transaction` attribute. +The :meth:`~Cursor.executescript` method implicitly commits +any pending transaction before execution of the given SQL script, +regardless of the value of :attr:`~Connection.isolation_level`, + .. versionchanged:: 3.6 :mod:`sqlite3` used to implicitly commit an open transaction before DDL statements. This is no longer the case. -.. _autocommit mode: https://sqlite.org/lang_transaction.html +.. _autocommit mode: https://www.sqlite.org/lang_transaction.html#implicit_versus_explicit_transactions + +.. _transaction behaviour: https://www.sqlite.org/lang_transaction.html#deferred_immediate_and_exclusive_transactions Using :mod:`sqlite3` efficiently From 7aa11d5ecbf2b40f8ec592a45364498f44827a31 Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Sun, 3 Jul 2022 23:05:20 +0200 Subject: [PATCH 08/10] Typo Co-authored-by: Alex Waygood --- Doc/library/sqlite3.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 26e8182c05630a..d33f736b8d3995 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -1451,7 +1451,7 @@ new transactions are implicitly opened before ``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statements. Use the :meth:`~Connection.commit` and :meth:`~Connection.rollback` methods to respectively commit and roll back pending transactions. -You can chose the underlying SQLite `transaction behaviour`_, +You can choose the underlying SQLite `transaction behaviour`_, that is the kind of ``BEGIN`` statements ``sqlite3`` implicitly executes, via the :attr:`~Connection.isolation_level` attribute. From 741866884470677b70e876c29414871722e527ed Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Wed, 6 Jul 2022 21:09:49 +0200 Subject: [PATCH 09/10] Address most of CAM's review --- Doc/library/sqlite3.rst | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index d33f736b8d3995..51f8a01722cb36 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -410,7 +410,7 @@ Connection Objects ` performed by ``sqlite3``. If set to :const:`None`, transactions are never implicitly opened. If set to one of ``"DEFERRED"``, ``"IMMEDIATE"``, or ``"EXCLUSIVE"``, - the strings representing the underlying SQLite `transaction behaviour`_, + corresponding to the underlying `SQLite transaction behaviour`_, transactions are implicitly opened before some DML statements. If not overridden by the *isolation_level* parameter of :func:`connect`, @@ -1451,8 +1451,9 @@ new transactions are implicitly opened before ``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statements. Use the :meth:`~Connection.commit` and :meth:`~Connection.rollback` methods to respectively commit and roll back pending transactions. -You can choose the underlying SQLite `transaction behaviour`_, -that is the kind of ``BEGIN`` statements ``sqlite3`` implicitly executes, +You can choose the underlying `SQLite transaction behaviour`_ — +that is, whether and what type of ``BEGIN`` statements ``sqlite3`` +implicitly executes – via the :attr:`~Connection.isolation_level` attribute. If :attr:`~Connection.isolation_level` is set to :const:`None`, @@ -1465,15 +1466,17 @@ The underlying SQLite library autocommit mode can be queried using the The :meth:`~Cursor.executescript` method implicitly commits any pending transaction before execution of the given SQL script, -regardless of the value of :attr:`~Connection.isolation_level`, +regardless of the value of :attr:`~Connection.isolation_level`. .. versionchanged:: 3.6 :mod:`sqlite3` used to implicitly commit an open transaction before DDL statements. This is no longer the case. -.. _autocommit mode: https://www.sqlite.org/lang_transaction.html#implicit_versus_explicit_transactions +.. _autocommit mode: + https://www.sqlite.org/lang_transaction.html#implicit_versus_explicit_transactions -.. _transaction behaviour: https://www.sqlite.org/lang_transaction.html#deferred_immediate_and_exclusive_transactions +.. _SQLite transaction behaviour: + https://www.sqlite.org/lang_transaction.html#deferred_immediate_and_exclusive_transactions Using :mod:`sqlite3` efficiently From be859ae46ce5f08005a38ea6f93b8a94f02399b9 Mon Sep 17 00:00:00 2001 From: Erlend Egeberg Aasland Date: Wed, 6 Jul 2022 22:43:37 +0200 Subject: [PATCH 10/10] Update Doc/library/sqlite3.rst Co-authored-by: CAM Gerlach --- Doc/library/sqlite3.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 51f8a01722cb36..821bb053a30392 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -411,7 +411,8 @@ Connection Objects If set to :const:`None`, transactions are never implicitly opened. If set to one of ``"DEFERRED"``, ``"IMMEDIATE"``, or ``"EXCLUSIVE"``, corresponding to the underlying `SQLite transaction behaviour`_, - transactions are implicitly opened before some DML statements. + implicit :ref:`transaction management + ` is performed. If not overridden by the *isolation_level* parameter of :func:`connect`, the default is ``""``, which is an alias for ``"DEFERRED"``.