UKBatch.Storage.EntityFrameworkCore
0.1.6-alpha
See the version list below for details.
dotnet add package UKBatch.Storage.EntityFrameworkCore --version 0.1.6-alpha
NuGet\Install-Package UKBatch.Storage.EntityFrameworkCore -Version 0.1.6-alpha
<PackageReference Include="UKBatch.Storage.EntityFrameworkCore" Version="0.1.6-alpha" />
<PackageVersion Include="UKBatch.Storage.EntityFrameworkCore" Version="0.1.6-alpha" />
<PackageReference Include="UKBatch.Storage.EntityFrameworkCore" />
paket add UKBatch.Storage.EntityFrameworkCore --version 0.1.6-alpha
#r "nuget: UKBatch.Storage.EntityFrameworkCore, 0.1.6-alpha"
#:package UKBatch.Storage.EntityFrameworkCore@0.1.6-alpha
#addin nuget:?package=UKBatch.Storage.EntityFrameworkCore&version=0.1.6-alpha&prerelease
#tool nuget:?package=UKBatch.Storage.EntityFrameworkCore&version=0.1.6-alpha&prerelease
UKBatch.Storage.EntityFrameworkCore
EF Core 10 persistent storage adapter for UKBatch — a plug-in replacement for the in-memory stores so batch definitions, execution history, and pending approval records survive a host restart. Supports PostgreSQL (Npgsql) and SQLite.
Status: part of the UKBatch 0.1.0-alpha package family.
Install
dotnet add package UKBatch.Storage.EntityFrameworkCore
Quick start
Register the EF stores after AddUKBatch — this replaces the default in-memory stores. No other
code changes: your jobs, batches, REST API, and dashboard keep working — only where the state lives
changes.
services.AddUKBatch(b => b.AddJob<MyJob>())
.AddUKBatchEntityFrameworkCoreStores(o => o.UsePostgres(
"Host=localhost;Database=ukbatch;Username=ukbatch;Password=…"));
// or SQLite (a single file — great for a single-node deployment or local dev):
// .AddUKBatchEntityFrameworkCoreStores(o => o.UseSqlite("Data Source=ukbatch.db"));
Provider selection is exclusive — one provider per deployment. Calling both UsePostgres and UseSqlite
is last-wins.
Try the storage swap
Sample.RestApi exposes a --storage flag so you can watch the exact same app run on each store:
dotnet run --project samples/Sample.RestApi -- --storage inmemory # default (volatile)
dotnet run --project samples/Sample.RestApi -- --storage ef-sqlite # DataSource=ukbatch-sample.db
dotnet run --project samples/Sample.RestApi -- --storage ef-pg \
--storage-connection "Host=localhost;Database=ukbatch;Username=…;Password=…"
samples/Sample.RestApi/smoke-restart-sqlite.sh triggers a batch, pauses it at an approval gate,
kill -9s the process, restarts over the same .db file, and shows the pending approval + execution
history still there.
Migrations
The package ships design-time migrations for both providers under Migrations/Postgres and
Migrations/Sqlite. Apply them in one of two ways:
- Production (recommended):
dotnet ef database update -c UKBatchDbContext(ops controls schema). - Dev/demo: set
o.MigrateOnStartup = trueto apply pending migrations at boot.
EnsureCreated() is not supported (no migration history, not evolvable).
Durability boundary
This package delivers durable record + re-decidability + orphan cleanup, not durable workflow
resume. After a restart: execution history persists, batch definitions are intact, and a pending
approval gate survives as a re-decidable record — but the batch it paused does not auto-resume, and
its in-flight executions are reaped to Failed. Mid-flight resume is a v0.2 concern.
The OrphanGracePeriod (default 2 min) is the window an interrupted, non-terminal execution is given
before the reaper marks it Failed — long enough to cover a normal graceful restart in flight. Set it to
TimeSpan.Zero to disable the reaper.
Schema versioning
The 0.1.0-alpha schema is the Initial migration for each provider. Forward-compatible columns
(Parameters/Steps JSON, BatchDefinitionId, SourceService/TargetService) are already in place,
so v0.2 additive changes ship as new migrations you apply with dotnet ef database update. Enums inside
JSON columns are stored as names (not ordinals), so a v0.2 reader round-trips a v0.1 blob.
License
MIT. See LICENSE in the repo root. Full docs: nspukcode-hub.github.io/UKBatch · GitHub.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- Cronos (>= 0.10.0)
- Microsoft.EntityFrameworkCore (>= 10.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.0)
- Microsoft.EntityFrameworkCore.Sqlite (>= 10.0.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.0)
- Polly (>= 8.5.0)
- UKBatch.Abstractions (>= 0.1.6-alpha)
- UKBatch.Core (>= 0.1.6-alpha)
-
net8.0
- Cronos (>= 0.10.0)
- Microsoft.EntityFrameworkCore (>= 8.0.27)
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.27)
- Microsoft.EntityFrameworkCore.Sqlite (>= 8.0.27)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 8.0.11)
- Polly (>= 8.5.0)
- UKBatch.Abstractions (>= 0.1.6-alpha)
- UKBatch.Core (>= 0.1.6-alpha)
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 |
|---|---|---|
| 0.2.2-alpha | 58 | 6/18/2026 |
| 0.2.1-alpha | 51 | 6/15/2026 |
| 0.2.0-alpha | 54 | 6/14/2026 |
| 0.1.6-alpha | 53 | 6/13/2026 |
| 0.1.5-alpha | 51 | 6/12/2026 |
| 0.1.4-alpha | 54 | 6/10/2026 |
| 0.1.3-alpha | 57 | 6/8/2026 |
| 0.1.1-alpha | 55 | 6/8/2026 |
| 0.1.0-alpha | 60 | 6/6/2026 |