From: Mike Bayer Date: Fri, 30 May 2014 16:27:42 +0000 (-0400) Subject: - changelog + docs for pg8000 transaction isolation level X-Git-Tag: rel_0_9_5~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c9ea32a20dab2cb12ee95e1db08b819b8944e6d0;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - changelog + docs for pg8000 transaction isolation level --- diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst index 633a3bddaf..5d39f1b965 100644 --- a/doc/build/changelog/changelog_09.rst +++ b/doc/build/changelog/changelog_09.rst @@ -14,6 +14,14 @@ .. changelog:: :version: 0.9.5 + .. change:: + :tags: feature, postgresql + :versions: 1.0.0 + :pullreq: github:88 + + Added support for AUTOCOMMIT isolation level when using the pg8000 + DBAPI. Pull request courtesy Tony Locke. + .. change:: :tags: bug, postgresql :tickets: 3021 diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index bcbf0b12cc..92467ad39a 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -73,8 +73,15 @@ Valid values for ``isolation_level`` include: * ``REPEATABLE READ`` * ``SERIALIZABLE`` -The :mod:`~sqlalchemy.dialects.postgresql.psycopg2` dialect also offers the special level ``AUTOCOMMIT``. See -:ref:`psycopg2_isolation_level` for details. +The :mod:`~sqlalchemy.dialects.postgresql.psycopg2` and +:mod:`~sqlalchemy.dialects.postgresql.pg8000` dialects also offer the +special level ``AUTOCOMMIT``. + +.. seealso:: + + :ref:`psycopg2_isolation_level` + + :ref:`pg8000_isolation_level` .. _postgresql_schema_reflection: diff --git a/lib/sqlalchemy/dialects/postgresql/pg8000.py b/lib/sqlalchemy/dialects/postgresql/pg8000.py index edb1afc390..8ed7c9423d 100644 --- a/lib/sqlalchemy/dialects/postgresql/pg8000.py +++ b/lib/sqlalchemy/dialects/postgresql/pg8000.py @@ -25,6 +25,30 @@ in postgresql.conf). Set the "encoding" parameter on create_engine(), to the same as the client encoding, usually "utf-8". +.. _pg8000_isolation_level: + +pg8000 Transaction Isolation Level +------------------------------------- + +The pg8000 dialect offers the same isolation level settings as that +of the :ref:`psycopg2 ` dialect: + +* ``READ COMMITTED`` +* ``READ UNCOMMITTED`` +* ``REPEATABLE READ`` +* ``SERIALIZABLE`` +* ``AUTOCOMMIT`` + +.. versionadded:: 0.9.5 support for AUTOCOMMIT isolation level when using + pg8000. + +.. seealso:: + + :ref:`postgresql_isolation_level` + + :ref:`psycopg2_isolation_level` + + """ from ... import util, exc import decimal diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index 6867650c5c..25fafa59c6 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -144,6 +144,12 @@ The psycopg2 dialect supports these constants for isolation level: .. versionadded:: 0.8.2 support for AUTOCOMMIT isolation level when using psycopg2. +.. seealso:: + + :ref:`postgresql_isolation_level` + + :ref:`pg8000_isolation_level` + NOTICE logging ---------------