is this close to what you had in mind?
https://gist.github.com/pims/711549577759ad1341f1a90860f1f3a...
https://gist.github.com/pims/711549577759ad1341f1a90860f1f3a...
Just tried this and it works great!
I changed app.py to this:
import sqlite3
print(sqlite3.connect(":memory:").execute(
"select sqlite_version()"
).fetchone()[0])
And it output "3.39.2" - but the same code in my regular Python interpreter output "3.40.1", which demonstrates that the WASM Python there has its own WASM-compiled SQLite.