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

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


On Tue, Sep 22, 2015 at 5:12 PM, Sol T <sol433tt at gmail.com> wrote:

> I know I can do this per connection, however how can I have it set to
> default? Does this need to be compiled into python?
>

If you need to compile sqlite you might want to look at apsw:
https://github.com/rogerbinns/apsw

Cheers


>
> On Tue, Sep 22, 2015 at 2:04 PM, Ryan Stuart <ryan.stuart.85 at gmail.com>
> wrote:
>
>> 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 (
>> https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.execute).
>> 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.
>>
>> Cheers
>>
>>
>>>
>>> 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
>>
>
>


-- 
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/c9391928/attachment.html>


More information about the Python-list mailing list