les*_*ode 6 .net sqlite ado.net
我正在通过ADO.NET提供程序尝试SQLite 3.7.13的内存中共享缓存功能.以下连接字符串有效,但会生成非共享缓存db:
Data Source=:memory:
Run Code Online (Sandbox Code Playgroud)
当我尝试以下任何一个时:
Data Source=:memory:?cache=shared
Data Source=file::memory:?cache=shared
Data Source=file:x?mode=memory&cache=shared
Run Code Online (Sandbox Code Playgroud)
ArgumentException打开连接时我得到以下信息:
Invalid ConnectionString format for parameter "Data Source"
Run Code Online (Sandbox Code Playgroud)
对于SQLite内存中的共享缓存数据库,连接字符串应该是什么样的?
les*_*ode 18
看起来虽然共享缓存功能在SQLite中,但当时System.Data.SQLite的最新版本(1.0.81.0)还不支持FullUri功能.看起来1.0.82.0版本工作,连接字符串应该是:
FullUri=file::memory:?cache=shared
Run Code Online (Sandbox Code Playgroud)