Closed ghost closed 1 year ago
It should support memory databases without issues; I use them myself. You don't need open_memory for that, as it's just a shortcut for open(":memory:")
, so you should be able to use makeStorage(":memory:")
to get the same result.
Thanks it does work. I tried it before but looking now see I forgot the second :
.
@johnmuhl, just to note, you can also use the URI version of it if you need to have multiple connections (within the same process) using the same in-memory DB: fm.makeStorage("file:/memdb1?vfs=memdb", sql, {OPEN_URI = true})
. memdb1
would be the name of the DB to reference in this case. If this approach is not used, then each ":memory:" DB is unique per-connection.
Thanks for the pointer I’m sure it’ll come in handy.
Is there some reason
makeStorage
shouldn't support in memory databases?I changed my
makeStorage
to usesqlite3.open_memory
and my application appears to run fine without any changes. I'd like to use an in memory db when writing tests and be able to use the same interface as in the application code.