Claudalisk.Persistence
0.1.0-alpha.5
dotnet add package Claudalisk.Persistence --version 0.1.0-alpha.5
NuGet\Install-Package Claudalisk.Persistence -Version 0.1.0-alpha.5
<PackageReference Include="Claudalisk.Persistence" Version="0.1.0-alpha.5" />
<PackageVersion Include="Claudalisk.Persistence" Version="0.1.0-alpha.5" />
<PackageReference Include="Claudalisk.Persistence" />
paket add Claudalisk.Persistence --version 0.1.0-alpha.5
#r "nuget: Claudalisk.Persistence, 0.1.0-alpha.5"
#:package Claudalisk.Persistence@0.1.0-alpha.5
#addin nuget:?package=Claudalisk.Persistence&version=0.1.0-alpha.5&prerelease
#tool nuget:?package=Claudalisk.Persistence&version=0.1.0-alpha.5&prerelease
Claudalisk.Persistence
EF Core on PostgreSQL for module contexts: one connection and one transaction per scope, the unit of work and the migration runner.
Setup
services.AddClaudaliskPersistence(connectionString);
services.AddModuleDbContext<OrderingDbContext>("ordering");
AddClaudaliskPersistenceregisters the data source, the scope's connection,IUnitOfWorkandDatabaseInitializer. A host has one database, so calling it again with another connection string throws.AddModuleDbContext<T>(schema)registers a context in its own schema, with its migration history in<schema>."__EFMigrationsHistory"and snake_case names. Each context needs its own schema.UseClaudaliskModuleSchemadoes the same inside anAddDbContextcall you write yourself.
One connection and one transaction
Every module context in a scope uses the scope's connection, and IUnitOfWork.RunAsync begins one transaction on it. Each context takes part in that transaction. This is EF Core's documented pattern for sharing a connection and a transaction.
- A nested
RunAsyncjoins the outer transaction. It commits or rolls back with the outer call. - A failed concurrency check surfaces as
ConcurrencyConflictException.
What the guard refuses
A module context is refused, when its options are built or validated, if it:
- is pooled with
AddDbContextPool. Each context needs its own scope's connection, and a pool reuses context instances across scopes. See the EF Core notes on DbContext pooling. - sets an execution strategy, which is what
EnableRetryOnFailuredoes. A retrying strategy does not work with a transaction that the unit of work began. See connection resiliency. Retry the wholeRunAsynccall instead.
Both refusals throw InvalidOperationException with a message that says what to do. UseClaudaliskModuleSchema also throws when AddClaudaliskPersistence was not called.
Migrations
DatabaseInitializer.MigrateAsync moves migration histories, adopts baselines, then migrates each context in registration order. GetPendingMigrationsAsync lists what is pending as schema: migration. GetMigrations lists every migration of every context, applied or not, as ModuleMigration(Schema, Id) in registration order, so a host can print them without touching EF Core types.
Call MigrateAsync outside a unit of work. Migrations manage their own transactions, so inside RunAsync it throws InvalidOperationException.
AddClaudaliskMigrationBaseline(schema, migration, replaces) and AddClaudaliskMovedMigrationHistory(from, to) support resetting a module's migrations and moving tables out of a shared context. Both change history that was already applied, so follow the migration runbooks and get the owner's approval first.
| 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
- Claudalisk.Persistence.Abstractions (>= 0.1.0-alpha.5)
- EFCore.NamingConventions (>= 10.0.1)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.15)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.4)
-
net11.0
- Claudalisk.Persistence.Abstractions (>= 0.1.0-alpha.5)
- EFCore.NamingConventions (>= 11.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 11.0.0)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 11.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Claudalisk.Persistence:
| Package | Downloads |
|---|---|
|
Claudalisk.Jobs.PostgreSql
The PostgreSQL transport of Claudalisk.Jobs: the jobs table, FOR UPDATE SKIP LOCKED claims and LISTEN/NOTIFY. |
|
|
Claudalisk.Scheduling
Cron schedules from configuration that queue commands as jobs of the scheduler's own jobs module, once per scheduled time. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-alpha.5 | 87 | 11/24/2026 |
| 0.1.0-alpha.4 | 161 | 11/22/2026 |
| 0.1.0-alpha.3 | 84 | 11/22/2026 |
| 0.1.0-alpha.2 | 77 | 11/21/2026 |
| 0.1.0-alpha.1 | 673 | 11/8/2026 |