So basically an empty string in isolation_level is the same as "DEFERRED"? This is confusing. I think it should have been implemented so that the value of the isolation_level attribute is DEFERRED when it is not specified in .connect().
On 10/25/19, David Raymond <david.raym...@tomtom.com> wrote: > https://docs.python.org/3.7/library/sqlite3.html#controlling-transactions > > "If you specify no isolation_level, a plain BEGIN is used, which is > equivalent to specifying DEFERRED." > > I believe the empty string qualifies as "no isolation_level" for this. > > > > -----Original Message----- > From: sqlite-users <sqlite-users-boun...@mailinglists.sqlite.org> On Behalf > Of Peng Yu > Sent: Friday, October 25, 2019 3:49 PM > To: SQLite mailing list <sqlite-users@mailinglists.sqlite.org> > Subject: [sqlite] What is the default value of isolation_level? > > Hi, > > isolation_level is an empty string by default as shown below. But the > python manual does not say that it can take an empty string. What does > an empty string mean? Is it equivalent to None? Thanks. > > https://docs.python.org/3/library/sqlite3.html#connection-objects > > """ > isolation_level > > Get or set the current default isolation level. None for > autocommit mode or one of “DEFERRED”, “IMMEDIATE” or “EXCLUSIVE”. See > section Controlling Transactions for a more detailed explanation. > """ > > $ cat main.py > #!/usr/bin/env python2 > import sqlite3 > import sys > conn=sqlite3.connect(sys.argv[1]) > print(repr(conn.isolation_level)) > > $ cat main.sh > #!/usr/bin/env bash > dbfile=$(mktemp -u) > ./main.py "$dbfile" > > $ ./main.sh > '' > > -- > Regards, > Peng > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > -- Regards, Peng _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users