Sqlite pragma statement "locking_mode" set to "EXCLUSIVE" by default

Ryan Stuart ryan.stuart.85 at gmail.com
Tue Sep 22 06:04:31 CEST 2015

On Thu, Sep 17, 2015 at 2:24 PM, sol433tt <sol433tt at gmail.com> wrote:

> I would like to have the Sqlite pragma statement "locking_mode" set to
> "EXCLUSIVE" by default (RO database). Does this need to be compiled in? How
> might this be achieved?

You can issue any PRAGA statement you like using the execute method on a
connection as per the documentation (
For information on the specific PRAGMA option you need, see
https://www.sqlite.org/pragma.html#pragma_locking_mode. I can't see any
mention of it being a compile time PRAGMA.


> There is some performance to be gained. I have a number of python scripts,
> and don't want to alter the pragma statement for every script. This
> computer never writes to the databases.
> thank you
> --
> https://mail.python.org/mailman/listinfo/python-list

Ryan Stuart, B.Eng
Software Engineer

W: http://www.kapiche.com/
M: +61-431-299-036
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150922/240ca534/attachment.html>

More information about the Python-list mailing list