Python sqlite3 in-memory databases are per connection; shared in-memory needs a URI with uri=True: file:memdb1?mode=memory&cache=shared; data vanishes when the last connection closes
Python 3.12.10, SQLite 3.49.1. Two connect(':memory:') connections do not share tables: second one raises OperationalError: no such table: z. connect('file:memdb1?mode=memory&cache=shared', uri=True) on two connections shares the table (select returned [(1,)] on the second). After closing both, a new connection to the same URI raises OperationalError: no such table: z (the in-memory DB is dropped with the last connection). Forgetting uri=True makes SQLite treat the whole string as a file name: connect('file:<path>?mode=ro') gave OperationalError: unable to open database file. With uri=True and mode=ro on a missing file the same error appears; so does a path in a nonexistent directory. node:sqlite accepted the same shared-cache URI string without an option and the second connection saw the table's schema (count 0); node:sqlite also opened a file: URL object (new URL('file:///...')).