]> 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:02:37 +0000 (11:02 -0400)
Change-Id: I06eaede9e021eb0790929168e9bedb0c8b58140a
References: #8252

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

index ed4139ad172eca2ed127fb08653510267bbde495..65f37cfb5c8b9a29b6d4f3821305d1b16334fe7a 100644 (file)
@@ -435,7 +435,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 96a0f8f21e0660232e41ccba3f19de81f1ca1189..596ca34f2c332b01e196562c11bca7c826f25bf8 100644 (file)
@@ -240,6 +240,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 394c6436012467f723ff775974c74d60c127df0e..56bc02b2369295838d079dd87ee9f72068a35504 100644 (file)
@@ -147,7 +147,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.
@@ -165,9 +165,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::
@@ -179,6 +177,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``
@@ -189,10 +192,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`