I'm trying out the in-memory shared cache feature of SQLite 3.7.13, via the ADO.NET provider. The following connect string works, but yields a non-shared-cache db:
Data Source=:memory:
When I try any of these:
Data Source=:memory:?cache=shared
Data Source=file::memory:?cache=shared
Data Source=file:x?mode=memory&cache=shared
I get the following ArgumentException
when opening a connection:
Invalid ConnectionString format for parameter "Data Source"
What should the connect string look like for SQLite in-memory shared-cache databases?
It looks like although the shared cache feature was in SQLite, the latest (1.0.81.0) version of System.Data.SQLite at the time didn't yet support the FullUri feature. Looks like the 1.0.82.0 version works, and the connection string should be:
FullUri=file::memory:?cache=shared
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With