]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
document create_engine.isolation_level for PG
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 13 Jul 2022 15:02:37 +0000 (11:02 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 13 Jul 2022 15:03:08 +0000 (11:03 -0400)
Change-Id: I06eaede9e021eb0790929168e9bedb0c8b58140a
References: #8252
(cherry picked from commit a3a3299b5b9728a432ba900754047844ecfb98d6)

lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/dialects/postgresql/base.py

index 735cc3cff82880cb43bb61c80da9a34e0656a41b..3c22b9b7c964637f5bd8b5197415f48bd0714203 100644 (file)
@@ -433,7 +433,10 @@ Valid values for ``isolation_level`` include:
 * ``SERIALIZABLE``
 * ``SNAPSHOT`` - specific to SQL Server
 
-.. versionadded:: 1.2 added AUTOCOMMIT isolation level setting
+There are also more options for isolation level configurations, such as
+"sub-engine" objects linked to a main :class:`.Engine` which each apply
+different isolation level settings.  See the discussion at
+:ref:`dbapi_autocommit` for background.
 
 .. seealso::
 
index 26af6eb799f4fa8c8a82ebb83b64c55fc2380a44..95e9cd1b37d6b0f6ffed7fe13bc75340695d4a9a 100644 (file)
@@ -238,6 +238,11 @@ MySQLdb, MySQL-Client, MySQL-Connector Python, and PyMySQL.   Using it,
 the database connection will return true for the value of
 ``SELECT @@autocommit;``.
 
+There are also more options for isolation level configurations, such as
+"sub-engine" objects linked to a main :class:`.Engine` which each apply
+different isolation level settings.  See the discussion at
+:ref:`dbapi_autocommit` for background.
+
 .. seealso::
 
     :ref:`dbapi_autocommit`
index dbaced5db533e8a9977e7334e13c1c4376da4333..23d4a49feebb578e89510471d827a76e1a47ac60 100644 (file)
@@ -148,7 +148,7 @@ Transaction Isolation Level
 ---------------------------
 
 Most SQLAlchemy dialects support setting of transaction isolation level
-using the :paramref:`_sa.create_engine.execution_options` parameter
+using the :paramref:`_sa.create_engine.isolation_level` parameter
 at the :func:`_sa.create_engine` level, and at the :class:`_engine.Connection`
 level via the :paramref:`.Connection.execution_options.isolation_level`
 parameter.
@@ -166,9 +166,7 @@ To set isolation level using :func:`_sa.create_engine`::
 
     engine = create_engine(
         "postgresql+pg8000://scott:tiger@localhost/test",
-        execution_options={
-            "isolation_level": "REPEATABLE READ"
-        }
+        isolation_level = "REPEATABLE READ"
     )
 
 To set using per-connection execution options::
@@ -180,6 +178,11 @@ To set using per-connection execution options::
         with conn.begin():
             # ... work with transaction
 
+There are also more options for isolation level configurations, such as
+"sub-engine" objects linked to a main :class:`.Engine` which each apply
+different isolation level settings.  See the discussion at
+:ref:`dbapi_autocommit` for background.
+
 Valid values for ``isolation_level`` on most PostgreSQL dialects include:
 
 * ``READ COMMITTED``
@@ -190,10 +193,10 @@ Valid values for ``isolation_level`` on most PostgreSQL dialects include:
 
 .. seealso::
 
-    :ref:`postgresql_readonly_deferrable`
-
     :ref:`dbapi_autocommit`
 
+    :ref:`postgresql_readonly_deferrable`
+
     :ref:`psycopg2_isolation_level`
 
     :ref:`pg8000_isolation_level`