[New-bugs-announce] [issue41930] Wrap sqlite3_serialize API in sqlite3 module

Kerrick Staley report at bugs.python.org
Sun Oct 4 08:05:11 EDT 2020


New submission from Kerrick Staley <kerrick at kerrickstaley.com>:

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).

----------
components: Library (Lib)
messages: 377935
nosy: Kerrick Staley
priority: normal
severity: normal
status: open
title: Wrap sqlite3_serialize API in sqlite3 module
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41930>
_______________________________________


More information about the New-bugs-announce mailing list