This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Kerrick Staley
Recipients Kerrick Staley
Date 2020-10-04.12:05:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601813111.02.0.183059099502.issue41930@roundup.psfhosted.org>
In-reply-to
Content
It would be useful to provide a wrapper (in the Python sqlite3 stdlib module) for the sqlite3_serialize API. This API allows you to get a database's content as a byte string, as if you had called open('foo.sqlite3', 'rb').read(). sqlite3_serialize can even be used for :memory: databases, which I think is the most interesting use-case.

Concretely, I'd propose adding a .serialize() method on sqlite3.Connection objects that returns a bytes object representing the serialized database. It would be similar to the .iterdump() method except that it would use the binary format instead of the text format, and it would return all the data at once instead of an iterator (because that's how the underlying sqlite API works).
History
Date User Action Args
2020-10-04 12:05:11Kerrick Staleysetrecipients: + Kerrick Staley
2020-10-04 12:05:11Kerrick Staleysetmessageid: <1601813111.02.0.183059099502.issue41930@roundup.psfhosted.org>
2020-10-04 12:05:11Kerrick Staleylinkissue41930 messages
2020-10-04 12:05:10Kerrick Staleycreate