cysqlite - a new sqlite driver

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Python developers finally get a usable alternative to the stdlib sqlite3 module's transaction handling, plus custom virtual table support and a working Pyodide/WASM build.

Read this as

A programmer named Charles Leifer has released an early version of cysqlite, a replacement for the SQLite database tool that comes built into the Python language. Its biggest difference is how it handles transactions, the units of work databases use to keep data safe, more faithfully than the standard version. The author also used the Claude Code AI assistant to build a browser version, which passed 115 of 116 tests.

cysqlite is a ground-up rewrite of Python's standard SQLite driver by Charles Leifer, maintainer of the pysqlite3 fork since 2018. It fixes transaction handling the standard library has never matched to SQLite's own autocommit behaviour, and adds custom virtual tables. Risk is low but real: version 0.1.4 is an early release, so adoption is best limited to side projects until it matures. Teams doing in-browser Python (Pyodide) gain most today.

Charles Leifer's cysqlite is a Cython-compiled C extension replacing Python's sqlite3 module, whose two transaction modes both deviate from SQLite's native autocommit. It supports custom virtual tables, absent from sqlite3. Simon Willison used Claude Code to build a 688KB emscripten WASM wheel (cysqlite-0.1.4, cp311, Emscripten 3.1.46) loadable via micropip into Pyodide 0.25.1 only, it fails on 0.27.5 due to an Emscripten version mismatch. The browser demo runs 115/116 tests (1 skipped), SQLite 3.51.2.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

cysqlite pysqlite3 Pyodide Claude Code SQLite Python

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading