You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
I opened a pull request for blob support in the pysqlite github repository: ghaering/pysqlite#93
I will do the needed changes for python3 and will post a patch soon.
palaviv commented on Feb 3, 2016
palavivmannequin
Mannequin
More actions
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.
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.
palaviv commented on Feb 6, 2017
palavivmannequin
Mannequin
More actions
Uploading patch after fixes from berker CR.
The blob_open API 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.
palaviv commented on Feb 24, 2017
palavivmannequin
Mannequin
More actions
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.
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.
Activity
jimminter commentedon Aug 21, 2015
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).
palaviv commentedon Jan 30, 2016
I opened a pull request for blob support in the pysqlite github repository:
ghaering/pysqlite#93
I will do the needed changes for python3 and will post a patch soon.
palaviv commentedon Feb 3, 2016
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.
palaviv commentedon Aug 16, 2016
Pinging as mentioned in the devguide.
serhiy-storchaka commentedon Aug 16, 2016
Added comments on Rietveld. The patch contains typos and violates PEP-7 and PEP-12. And there are questions about API.
palaviv commentedon Aug 18, 2016
Thanks for the review Serhiy. Attached is the updated patch after the changes.
palaviv commentedon Feb 4, 2017
Pinging again. I think this would be a great enhancement to the sqlite module.
serhiy-storchaka commentedon Feb 5, 2017
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.
palaviv commentedon Feb 5, 2017
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.
serhiy-storchaka commentedon Feb 6, 2017
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.
palaviv commentedon Feb 6, 2017
Uploading patch after fixes from berker CR.
The
blob_openAPI can can have the following options:a. No default (mandatory parameter).
b. default read-only
c. default write-only
I don't think that there is enough differences between the possible API's to justify sending a message to the mailing lists.
palaviv commentedon Feb 24, 2017
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
gh-69093: Don't allow instantiation of sqlite3.Blob objects (GH-91570)
gh-69093: improve sqlite3.Connection.blobopen() error handling (GH-91571
gh-69093: Add context manager support to sqlite3.Blob (GH-91562)
gh-69093: sqlite3 blob doc amendments (GH-91561)
gh-69093: Add indexing and slicing support to sqlite3.Blob (#91599)
erlend-aasland commentedon Apr 22, 2022
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.
erlend-aasland commentedon Apr 22, 2022
cc. @eamanu, @nightlark
pythongh-69093: Fix Setup.local.in rule for _sqlite3
gh-69093: Fix Setup.local.in rule for _sqlite3 (GH-93380)
pythongh-69093: Fix Setup.local.in rule for _sqlite3 (pythonGH-93380)
gh-69093: Fix Setup.local.in rule for _sqlite3 (GH-93380)