classification
Title: Sqlite3 has no option to provide open flags
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: ghaering Nosy List: berker.peksag, ghaering, palaviv, sleepycal
Priority: normal Keywords:

Created on 2015-08-18 11:42 by sleepycal, last changed 2016-06-16 17:33 by berker.peksag. This issue is now closed.

Messages (4)
msg248770 - (view) Author: Cal Leeming (sleepycal) Date: 2015-08-18 11:42
There are several flags which can be provided to Sqlite3 during connection [1]. Alternative libraries such as apsw provide the ability to use these flags [2], however it would be nice if `sqlite3` supported this out of the box.

Is there any reason why the wrapper for `sqlite3` does not allow flags to be passed in? If not, can we add it?

[1]: https://www.sqlite.org/c3ref/open.html
[2]: https://github.com/rogerbinns/apsw/blob/master/example-code.py#L466
msg248825 - (view) Author: Gerhard Häring (ghaering) * (Python committer) Date: 2015-08-19 09:50
It requires switch to the v2 open function of the SQLite C API. While we're at it, we can also enable URI filenames.
msg262523 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-03-27 14:11
URI filename support has been added in f13bb1e40fbc (Python 3.4+).

    db = sqlite3.connect('file:path/to/database?mode=ro', uri=True)

Here is a patch that adds a new flags parameter to sqlite3.connect().
msg264551 - (view) Author: Aviv Palivoda (palaviv) * Date: 2016-04-30 10:46
IMO this issue can be closed as the URI filename interface can be used instead of the flags. The URI interface parameters can override the flags given as specified in:
https://www.sqlite.org/c3ref/open.html
History
Date User Action Args
2016-06-16 17:33:38berker.peksagsetstatus: open -> closed
resolution: out of date
stage: patch review -> resolved
2016-04-30 10:46:37palavivsetnosy: + palaviv
messages: + msg264551
2016-03-27 14:11:36berker.peksagsetnosy: + berker.peksag
messages: + msg262523

dependencies: - Migrate sqlite3 module to _v2 API to enhance performance
stage: needs patch -> patch review
2016-03-23 10:28:16berker.peksagsetdependencies: + Migrate sqlite3 module to _v2 API to enhance performance
type: enhancement
stage: needs patch
2015-08-19 09:50:43ghaeringsetversions: + Python 3.6, - Python 3.4
nosy: + ghaering

messages: + msg248825

assignee: ghaering
2015-08-18 11:42:06sleepycalcreate