diff options
author | michele.simionato <devnull@localhost> | 2008-11-26 16:44:45 +0000 |
---|---|---|
committer | michele.simionato <devnull@localhost> | 2008-11-26 16:44:45 +0000 |
commit | 4584492f6ee10128e23364334b4d7f52c48bb471 (patch) | |
tree | c7789c99df16acd019562474cac3d3320f2215e2 /sqlplain/sqlite_support.py | |
parent | 1c20f230bb4d86c4f4cea4bf2b3212afac1325a9 (diff) | |
download | micheles-4584492f6ee10128e23364334b4d7f52c48bb471.tar.gz |
changed ``sqlplain`` to use isolation_level and not autocommit
Diffstat (limited to 'sqlplain/sqlite_support.py')
-rw-r--r-- | sqlplain/sqlite_support.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sqlplain/sqlite_support.py b/sqlplain/sqlite_support.py index 2aadf8c..1cd87fc 100644 --- a/sqlplain/sqlite_support.py +++ b/sqlplain/sqlite_support.py @@ -3,11 +3,10 @@ try: # Python 2.5 except ImportError: # Python < 2.5 from pysqlite2 import dbapi2 -def connect(fname, autocommit=True, **kw): - if autocommit: - level = None - else: - level = '' +ISOLATION_LEVELS = (None, "", "DEFERRED", "IMMEDIATE", "EXCLUSIVE") + +def connect(fname, isolation_level=None, **kw): dbapi2.register_converter('datetime', dbapi2.converters['TIMESTAMP']) return dbapi2.connect( - fname, isolation_level=level, detect_types=dbapi2.PARSE_DECLTYPES, **kw) + fname, isolation_level=isolation_level, + detect_types=dbapi2.PARSE_DECLTYPES, **kw) |