Python 3.12, built-in sqlite3 package on MacOS Sonoma 14.5, using PyCharm community edition.
I'm attempting to create an in-memory sqlite3 database that can be closed and reopened for each query.
The reason for this is that I want to be able to override the sqlite specific functions and allow the same program to be used with a different sql library and a suitable connection function.
I see the python.org sqlite3 documentation describes the use of ':Memory:' for non-persistent connections (which works), and refers to sqlite documentation for persistent connections.
That documentation says to use con = sqlite3.connect('file::memory:?cache=shared') in order to set up a persistent connection that can be opened and closed within the same process.
When I do that, I find that the connect function has created a disk file with the 'file::memory:?cache=shared' filename. This is a file, not an in-memory database!
Does anyone here know whether Python's sqlite3 supports cached memory databases and what I might be doing wrong (or any recommended alternative approaches)?
I found an two similar question on this board but the described problem is different in those situations.
Thank you!