Uh, the in_transaction being True after .commit() is cursed in autocommit=True, I didn't know about. Seems like using the connection context manager is safer.
I know, I'm not sure how the cpython team decided on that, but seems like it will drop data on the floor for the unwary, since a subsequent close() on the connection implies a rollback (it is not explicitly rolled-back, but that is effectively what happens).
simonw | a day ago
I got this working as a compiled WebAssembly wheel that works in Pyodide in a browser - here's a demo page that runs the tests: https://simonw.github.io/research/cysqlite-wasm-wheel/demo.html
The wheel is here: https://simonw.github.io/research/cysqlite-wasm-wheel/cysqlite-0.1.4-cp311-cp311-emscripten_3_1_46_wasm32.whl
You can load that in the Pyodide REPL and try it out here: https://tools.simonwillison.net/pyodide-repl
simonw | 3 hours ago
See also my blog post: https://simonwillison.net/2026/Feb/11/cysqlite/
simonw | a day ago
This is really exciting! I'm a longtime fan of
pysqlite3and I've always wanted custom Table-valued functions, looks like this gives me exactly that.[OP] coleifer | a day ago
Thanks, Simon I hope others like yourself find it useful. It's been a lot of fun to work on.
natfu | a day ago
Uh, the
in_transactionbeingTrueafter.commit()is cursed inautocommit=True, I didn't know about. Seems like using the connection context manager is safer.[OP] coleifer | a day ago
I know, I'm not sure how the cpython team decided on that, but seems like it will drop data on the floor for the unwary, since a subsequent
close()on the connection implies a rollback (it is not explicitly rolled-back, but that is effectively what happens).ngoldbaum | 19 hours ago
You should upload free-threaded cp314t wheels! See https://py-free-threading.github.io for more info but I’m also happy to help.