diff options
| author | Gord Thompson <gord@gordthompson.com> | 2020-02-22 06:44:05 -0700 |
|---|---|---|
| committer | Gord Thompson <gord@gordthompson.com> | 2020-03-24 12:15:02 -0600 |
| commit | 64e8303debd8064d7d9c01c3300cca5f54c02db1 (patch) | |
| tree | 4d2953bc2a5f31bc8b16ef9788914185caa8d9df /lib/sqlalchemy/dialects/sqlite/base.py | |
| parent | e6b6ec78e6d6f96537eaf542f469a7e88134e9fc (diff) | |
| download | sqlalchemy-64e8303debd8064d7d9c01c3300cca5f54c02db1.tar.gz | |
Implement autocommit isolation level for pysqlite
Fixes: #5164
Change-Id: I190b9de552dfed9f2a33babf82e42465ef09c82a
Diffstat (limited to 'lib/sqlalchemy/dialects/sqlite/base.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/sqlite/base.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py index a63ce0033..c79357176 100644 --- a/lib/sqlalchemy/dialects/sqlite/base.py +++ b/lib/sqlalchemy/dialects/sqlite/base.py @@ -168,8 +168,8 @@ work when using the pysqlite driver. .. _sqlite_isolation_level: -Transaction Isolation Level ----------------------------- +Transaction Isolation Level / Autocommit +---------------------------------------- SQLite supports "transaction isolation" in a non-standard way, along two axes. One is that of the @@ -185,6 +185,15 @@ and ``"READ UNCOMMITTED"`` corresponding to a value of 0 and 1, respectively. SQLite defaults to ``SERIALIZABLE``, however its behavior is impacted by the pysqlite driver's default behavior. +When using the pysqlite driver, the ``"AUTOCOMMIT"`` isolation level is also +available, which will alter the pysqlite connection using the ``.isolation_level`` +attribute on the DBAPI connection and set it to None for the duration +of the setting. + +.. versionadded:: 1.3.16 added support for SQLite AUTOCOMMIT isolation level + when using the pysqlite / sqlite3 SQLite driver. + + The other axis along which SQLite's transactional locking is impacted is via the nature of the ``BEGIN`` statement used. The three varieties are "deferred", "immediate", and "exclusive", as described at |
