DB creates file despite URI param "mode=memory"
I've tried to open two different in-memory SQLite instances for unit testing purposes (within a Python/SQLAlchemy project). Using (what I call "named") databases applying URIs like "
sqlite+pysqlite:///file:should-not-exist?mode=memory&cache=shared" I expected that no database file is created on local filesystem due to the usage of
mode=memory URI parameter (see description of
But test case shows that this is not the case: I've found database file
./should-not-exist gets created by using the shown DB URI!
I've also found a statement "Note that in order for the special ":memory:" name to apply and to create a pure in-memory database, there must be no additional text in the filename." (found here), which - at least to me - contradicts the aforementioned statement regarding "mode=memory".
Is there anything to further consider to get two distinct in-memory SQLite databases?
My guess: The Python/SQLAlchemy layer is stripping off the query parameters before they reach SQLite.