Repository navigation
Allow incremental I/O to blobs in sqlite3 #69093
Description
Activity
SQLite supports incremental I/O to blobs, i.e. the capability to stream reads and writes to blobs without having to load the entire blob into memory first. See https://www.sqlite.org/c3ref/blob_open.html for more details on the C API.
It'd be nice if it were possible to do this in Python using sqlite3 (it is already possible with apsw).
- addedtype-featureA feature request or enhancementA feature request or enhancement
on Aug 21, 2015 - addedextension-modulesC modules in the Modules dirC modules in the Modules dir
on Jan 16, 2016 I opened a pull request for blob support in the pysqlite github repository:
ghaering/pysqlite#93I will do the needed changes for python3 and will post a patch soon.
I did the needed changes for the pull request at pysqlite for porting to python3. I will continue updating the patch if there will be changes in pysqlite and vice versa.
Pinging as mentioned in the devguide.
Thanks for the review Serhiy. Attached is the updated patch after the changes.
Pinging again. I think this would be a great enhancement to the sqlite module.
Sorry Aviv, I just forget about this issue.
Added new comments on Rietveld. Many lines in sqlite3.rst still are too long.
It would be worth to ask other developers about wanted interface.
Thanks for the CR Serhiy. Attached is a new patch after the fixes from the CR.
What other developers should I ask? The interface is file like and is the same as apsw.
apsw has different order of arguments for blobopen(), all arguments are mandatory, and the parameter for read/write mode is called "writeable" rather than "readonly". This part of API needs to be discussed. Ask for discussion on mailing lists: Python-Ideas and maybe Python-List.
Uploading patch after fixes from berker CR.
The
blob_openAPI can can have the following options:- The table, column and row must be mandatory parameters.
- The read/write permissions can have the following options:
a. No default (mandatory parameter).
b. default read-only
c. default write-only - The dbname can be without a default of "main" and then it will be a mandatory parameter.
I don't think that there is enough differences between the possible API's to justify sending a message to the mailing lists.
I opened a PR in github. I tagged some other developers if that will not start a discussion on the API I will post in the python-ideas.
33 remaining items
Incremental I/O for blobs is now supported in the sqlite3 extension module in the upcoming Python 3.11 release. Thanks a lot to @palaviv, @JelleZijlstra, and everyone else who contributed by commenting and reviewing.
IMO, the implementation can benefit from further tweaks, but let's do that in separate issues if needed.
Reacted by Adrian Hänsler and Else, Someonecc. @eamanu, @nightlark
sqlite3#30356sqlite3#30680Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields: