Rulealize.Plugin.SqliteStore
1.0.0
dotnet add package Rulealize.Plugin.SqliteStore --version 1.0.0
NuGet\Install-Package Rulealize.Plugin.SqliteStore -Version 1.0.0
<PackageReference Include="Rulealize.Plugin.SqliteStore" Version="1.0.0" />
<PackageVersion Include="Rulealize.Plugin.SqliteStore" Version="1.0.0" />
<PackageReference Include="Rulealize.Plugin.SqliteStore" />
paket add Rulealize.Plugin.SqliteStore --version 1.0.0
#r "nuget: Rulealize.Plugin.SqliteStore, 1.0.0"
#:package Rulealize.Plugin.SqliteStore@1.0.0
#addin nuget:?package=Rulealize.Plugin.SqliteStore&version=1.0.0
#tool nuget:?package=Rulealize.Plugin.SqliteStore&version=1.0.0
Rulealize.Plugin.SqliteStore
A store for Rulealize rule sets that keep instances: every state document in a SQLite database.
| Plugin id | Rulealize.Plugin.SqliteStore |
| Namespace | sqlite |
| Reserved prefix | none |
| Depends on | Rulealize.Abstraction, Microsoft.Data.Sqlite |
| Specification | doc/specification.md |
A rule set whose uses declares a many keeps each instance as a document of its own, and names
the store that keeps them in requires. This is one such store. It registers no operation and no
schema; a rule set names it and the host opens it:
"requires": [
{ "plugin": "Rulealize.Plugin.TypeSchema" },
{ "plugin": "Rulealize.Plugin.SqliteStore" }
]
RuleContext month = new RuleRuntime()
.LoadPluginsFrom("plugin")
.AddPlugin(new SqliteStorePlugin())
.UseStore(SqliteStorePlugin.Id, new SqliteStateStore("Data Source=state.db"))
.CreateContext(monthDocument, heldDocuments, startDocuments);
CommittedTransition done = await month.ApplyAsync(
"""{ "input": "submit", "at": { "claims": "1" }, "args": { "by": "ann" } }""");
The host references this package and hands the plugin over with AddPlugin, rather than leaving
it in the plugin folder, because it names SqliteStateStore to open one, and UseStore takes a
store of the type the loaded plugin declared.
A position is where it was when the process starts again. One table, rulealize_state, made
the first time a session is opened, a row per document with a version. A session reads in one
snapshot, and on commit refuses with StateConflictException a write to a document that moved
since it was read, then keeps all of it or none of it.
Keys are those a MemoryStateStore gives: 1, 2, …, one more than the collection holds.
A walk over a rule set kept in memory, and a host kept here, write the same commit documents.
One database is one position. It holds one rule set's own document and the instances it keeps; two rule sets that each keep instances are kept in two databases.
Building
dotnet build. Rulealize.Abstraction and Microsoft.Data.Sqlite restore from nuget.org like
any other package, so this repository builds on its own.
dotnet test runs the store's own tests, in test/: a month that keeps its claims, and a ledger
that keeps a month per key, each kept in a SQLite file of its own through the Rulealize runtime,
and sessions opened directly where two have to race. The runtime and the vocabularies come from
nuget.org; the plugin under test is this repository's, handed to the runtime as an instance.
License
Apache-2.0.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Data.Sqlite (>= 10.0.12)
- Rulealize.Abstraction (>= 0.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 139 | 10/24/2026 |