I tried this in your Python example:
import sqlite3
>>> db = sqlite3.connect("data.db")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
sqlite3.OperationalError: unable to open database file
Presumably that operation failed because there isn't a writable virtual filesystem. Would it be possible to provide one?