orleans
orleans copied to clipboard
ADO.NET - Using Microsoft.Data.Sqlite for persistence?
Can this framework be used with Microsoft.Data.Sqlite for persistence?
When I install Microsoft.Data.Sqlite and configure it for usage, I get the following exception when I run the app:
System.Collections.Generic.KeyNotFoundException: 'The given key 'Microsoft.Data.Sqlite' was not present in the dictionary.'
But according to this line of code it should be possible to use it, right?
Config is setup like this:
.UseAdoNetClustering(e => { e.ConnectionString = "Data Source=database.db"; e.Invariant = "Microsoft.Data.Sqlite"; }) .AddAdoNetGrainStorage("test", e => { e.ConnectionString = "Data Source=database.db"; e.Invariant = "Microsoft.Data.Sqlite"; })
The latest version of Orleans is being used (7.0.0)
It looks like sqlite persistence is missing from here: https://github.com/dotnet/orleans/tree/main/src/AdoNet/Orleans.Persistence.AdoNet
I'm sure the team would appreciate a PR with adding support for Sqlite.
@DoubleDBE Just to add my two cents, as I also hit this recently. Using "pure" SQLite doesn't make sense, as all of your silos would need to have access to database file, unless you have only one silo :)
What I've been playing around lately is using rqlite as grain storage, feel free to take/use the code if you like it :)
@sec Can be used to persist data in developer environment or in single node installation for example in staging environment for testing purpose