CasCap.Common.Configuration.Sqlite
5.2.1
Prefix Reserved
dotnet add package CasCap.Common.Configuration.Sqlite --version 5.2.1
NuGet\Install-Package CasCap.Common.Configuration.Sqlite -Version 5.2.1
<PackageReference Include="CasCap.Common.Configuration.Sqlite" Version="5.2.1" />
<PackageVersion Include="CasCap.Common.Configuration.Sqlite" Version="5.2.1" />
<PackageReference Include="CasCap.Common.Configuration.Sqlite" />
paket add CasCap.Common.Configuration.Sqlite --version 5.2.1
#r "nuget: CasCap.Common.Configuration.Sqlite, 5.2.1"
#:package CasCap.Common.Configuration.Sqlite@5.2.1
#addin nuget:?package=CasCap.Common.Configuration.Sqlite&version=5.2.1
#tool nuget:?package=CasCap.Common.Configuration.Sqlite&version=5.2.1
CasCap.Common.Configuration.Sqlite
.NET 10/11 EF Core SQLite authority for complete typed runtime controls with immutable revision audit and expected-revision publication.
Installation
dotnet add package CasCap.Common.Configuration.Sqlite
Usage
Register AddSqliteRuntimeConfiguration(settings, connectionString, baseline) before dependent
hosted services. Consume the standard IOptionsMonitor<T>; a valid initial durable publication
is required. Expired controls return to the captured startup baseline, not a preceding revision.
See the consumer guide
for typed validation, polling and optional shared Redis cache-aside.
The uncached
IRuntimeConfigurationPublisher<T>
publishes complete snapshots; the concrete SqliteRuntimeConfigurationStore<T> also exposes
ReadRevisionAsync for immutable historical reads. Dedicated restore, as-of and paginated history
APIs are deferred.
Configuration Examples
using CasCap.Common.Configuration.Runtime.Models;
using CasCap.Common.Configuration.Sqlite.Extensions;
services.AddSqliteRuntimeConfiguration(
new RuntimeConfigurationOptions
{
Scope = new RuntimeConfigurationScope("example-application", "example-environment"),
ContractId = "controls",
RefreshInterval = TimeSpan.FromSeconds(5),
},
"Data Source=configuration.db;Pooling=False;Default Timeout=5",
new Controls());
Controls is the application's validated, non-secret DTO. Application, arbitrary environment and
contract identify independent heads in the same file. One registered scope/contract per host is
supported. File location and connection settings remain deployment configuration.
Schema and Operations
Apply real EF migrations externally, before startup. The runtime never calls EnsureCreated,
Migrate or publishes an initial revision. Generate/review offline SQL and verify model drift:
dotnet ef migrations script --project src\CasCap.Common.Configuration.Sqlite --configuration Release
dotnet ef migrations has-pending-model-changes --project src\CasCap.Common.Configuration.Sqlite --configuration Release
The offline design-time factory never opens a file. Apply reviewed SQL or run an explicitly configured migration context against the operator-selected file in a serialized external step. SQLite cannot generate EF idempotent scripts; select the appropriate migration range.
Owned tables are cascap_config_revisions, cascap_config_heads and
cascap_config_migrations_history; application tables are untouched. EF's SQLite migrator also
uses its framework-owned __EFMigrationsLock table. Do not remove that lock while a migration is
running. A separate application context must use its own migration history and serialized migrator.
SQLite permits one writer at a time. A non-deferred write transaction reads the expected head,
appends the journal and advances the head atomically. Stale revisions, primary-key publication
races and SQLite busy/locked errors (5/6, including extended variants) become sanitized
DbUpdateConcurrencyException; no automatic retry or phantom audit append occurs. Re-read the
authority before deciding whether to retry. Other storage/constraint errors remain failures.
The connection's timeout bounds SQLite's own lock wait; cancellation does not interrupt every
synchronous native SQLite operation.
Sharing a file shares permissions and contention, not independently enforceable SQL roles. Use durable local storage and operator-managed backups/checkpoints. Redis does not replicate files, provide SQLite high availability or authorize a writable WAL file on a multi-node network filesystem. Use PostgreSQL when multiple highly available writers are needed.
Validation
The experimental source-build AOT pilot adds generated-metadata/explicit-validator registration and compiled models/queries, including explicit typed date comparers. Published JIT and .NET 11 Linux amd64 native processes use real fixture-owned files and managed migrations. EF analysis warnings remain visible; this does not establish production or normal prebuilt NuGet AOT compatibility.
The permanent runtime acceptance suite uses real disposable files, real migrations, shared-file preservation, first/existing-head races and direct/cache-aside HTTP hosts. The root Compose test runner runs the same SQLite classes without PostgreSQL.
| 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. net11.0 is compatible. |
-
net10.0
- CasCap.Common.Configuration.Runtime (>= 5.2.1)
- Microsoft.EntityFrameworkCore.Sqlite (>= 10.0.14)
-
net11.0
- CasCap.Common.Configuration.Runtime (>= 5.2.1)
- Microsoft.EntityFrameworkCore.Sqlite (>= 11.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.