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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CasCap.Common.Configuration.Sqlite" Version="5.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CasCap.Common.Configuration.Sqlite" Version="5.2.1" />
                    
Directory.Packages.props
<PackageReference Include="CasCap.Common.Configuration.Sqlite" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CasCap.Common.Configuration.Sqlite --version 5.2.1
                    
#r "nuget: CasCap.Common.Configuration.Sqlite, 5.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package CasCap.Common.Configuration.Sqlite@5.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CasCap.Common.Configuration.Sqlite&version=5.2.1
                    
Install as a Cake Addin
#tool nuget:?package=CasCap.Common.Configuration.Sqlite&version=5.2.1
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
5.2.1 92 11/21/2026
5.2.0 98 11/14/2026
5.1.0 101 11/5/2026
5.0.0 112 11/1/2026