SQLite Forum

DB creates file despite URI param "mode=memory"
Login
Hello,

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 `mode=memory` [here](https://sqlite.org/uri.html#coreqp)).

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](https://sqlite.org/inmemorydb.html)), 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?


Thanks

Christian