From: Mike Bayer Date: Fri, 30 Apr 2010 19:00:48 +0000 (-0400) Subject: place docs for DBAPI-agnostic transaction_isolation setting for sqlite, pg [ticket... X-Git-Tag: rel_0_6_1~29^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4bb1f7ba27aa19e1228f85419208d547ce161e6;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git place docs for DBAPI-agnostic transaction_isolation setting for sqlite, pg [ticket:1784] --- diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 7de5cafad1..aa2048d4be 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -36,6 +36,14 @@ PostgreSQL 8.2 supports an ``INSERT...RETURNING`` syntax which SQLAlchemy suppor as well. A future release of SQLA will use this feature by default in lieu of sequence pre-execution in order to retrieve new primary key values, when available. +Transaction Isolation Level +--------------------------- + +:func:`create_engine` accepts an ``isolation_level`` parameter which results in +the command ``SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL `` +being invoked for every new connection. Valid values for this parameter are +``READ_COMMITTED``, ``READ_UNCOMMITTED``, ``REPEATABLE_READ``, and ``SERIALIZABLE``. + INSERT/UPDATE...RETURNING ------------------------- diff --git a/lib/sqlalchemy/dialects/postgresql/psycopg2.py b/lib/sqlalchemy/dialects/postgresql/psycopg2.py index 2a51a72397..6ae6c6c08a 100644 --- a/lib/sqlalchemy/dialects/postgresql/psycopg2.py +++ b/lib/sqlalchemy/dialects/postgresql/psycopg2.py @@ -25,9 +25,6 @@ psycopg2-specific keyword arguments which are accepted by :func:`~sqlalchemy.cre at a time are fetched over the wire to reduce conversational overhead. * *use_native_unicode* - Enable the usage of Psycopg2 "native unicode" mode per connection. True by default. -* *isolation_level* - Sets the transaction isolation level for each transaction - within the engine. Valid isolation levels are `READ_COMMITTED`, - `READ_UNCOMMITTED`, `REPEATABLE_READ`, and `SERIALIZABLE`. Transactions ------------ diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index ca0a39136c..ec3d7b8ac6 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -41,7 +41,15 @@ to the Table construct:: Table('sometable', metadata, Column('id', Integer, primary_key=True), sqlite_autoincrement=True) - + +Transaction Isolation Level +--------------------------- + +:func:`create_engine` accepts an ``isolation_level`` parameter which results in +the command ``PRAGMA read_uncommitted `` being invoked for every new +connection. Valid values for this parameter are ``SERIALIZABLE`` and +``READ UNCOMMITTED`` corresponding to a value of 0 and 1, respectively. + """ import datetime, re, time