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 erlendaasland
Recipients Kerrick Staley, erlendaasland
Date 2021-08-12.20:02:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1628798551.15.0.42340633909.issue41930@roundup.psfhosted.org>
In-reply-to
Content
I've been fiddling with this between others projects lately; the PR is mostly ready. The only remaining issue is how to include this in the Connection object:
- The serialize API was added as a compile-time option (SQLITE_ENABLE_DESERIALIZE) in SQLite 3.23.0
- The serialize API was included by default from SQLite 3.36.0, but can be disabled using the SQLITE_OMIT_DESERIALIZE compile-time option.

Solution 1: enable the Python sqlite3 serialize API if SQLITE_VERSION_NUMBER >= 3023000 and force people to build their SQLite library _with_ SQLITE_ENABLE_DESERIALIZE defined for SQLite versions 3.23.0 through 3.35.x and _without_ SQLITE_OMIT_DESERIALIZE defined for SQLite versions 3.36.0 and onward.

Solution 2: enable the Python sqlite3 serialize API if SQLITE_VERSION_NUMBER >= 3036000 and force people to build their SQLite library _without_ SQLITE_OMIT_DESERIALIZE defined.

Solution 3: build the Python sqlite3 serialize API as a "sub module" to _sqlite3 (for example _sqlite3._serialize) and add conditionally add it to sqlite3.Connection in Lib/sqlite3/__init__.py or Lib/sqlite3/dbapi2.py.

Solution 4: try to autodetect SQLite compile-time options in setup.py, autogenerate a sqlite-config.h header file, and conditionally enable the API based on that.

I suggest solution 2, as it adds little code (low maintenance), and will require no or minimal changes to the devguide, because (wild guess) in most cases SQLITE_OMIT_DESERIALIZE will not be a widely used compile-time option.

(For the python.org macOS and Windows installers, this will not be a problem, because we control the SQLite compile-time options.)
History
Date User Action Args
2021-08-12 20:02:31erlendaaslandsetrecipients: + erlendaasland, Kerrick Staley
2021-08-12 20:02:31erlendaaslandsetmessageid: <1628798551.15.0.42340633909.issue41930@roundup.psfhosted.org>
2021-08-12 20:02:31erlendaaslandlinkissue41930 messages
2021-08-12 20:02:31erlendaaslandcreate