PouryaKit.Persistence.Postgres
0.1.0-preview.1
See the version list below for details.
dotnet add package PouryaKit.Persistence.Postgres --version 0.1.0-preview.1
NuGet\Install-Package PouryaKit.Persistence.Postgres -Version 0.1.0-preview.1
<PackageReference Include="PouryaKit.Persistence.Postgres" Version="0.1.0-preview.1" />
<PackageVersion Include="PouryaKit.Persistence.Postgres" Version="0.1.0-preview.1" />
<PackageReference Include="PouryaKit.Persistence.Postgres" />
paket add PouryaKit.Persistence.Postgres --version 0.1.0-preview.1
#r "nuget: PouryaKit.Persistence.Postgres, 0.1.0-preview.1"
#:package PouryaKit.Persistence.Postgres@0.1.0-preview.1
#addin nuget:?package=PouryaKit.Persistence.Postgres&version=0.1.0-preview.1&prerelease
#tool nuget:?package=PouryaKit.Persistence.Postgres&version=0.1.0-preview.1&prerelease

PouryaKit.Persistence.Postgres
Each Module's EF Core data in its own PostgreSQL schema. UsePouryaKitPostgres gives a Module its DbContext on Npgsql, keeps its migrations history in that schema and makes the DbContext the Module's Unit of Work. Modules may share one connection string, and each keeps its own schema.
Install
dotnet add package PouryaKit.Persistence.Postgres --prerelease
When to use it
- You give a Module its database and schema: this is the package a Module references to store its aggregates.
- A unique value should come back as the Error of your choice.
- A number must be gap-free, such as one sequence of invoice numbers per year.
- You are adding a migration.
It brings PouryaKit.Persistence and PouryaKit.Persistence.EFCore. Add PouryaKit.Persistence.Dapper for reads in SQL and PouryaKit.Messaging.Wolverine.EFCore for deliveries.
Quick start
Declare the Module's store in its Composition Root, as the Proving Sample's Catalog does:
module.UsePouryaKitPostgres<CatalogDbContext>(connectionName: "app", schema: "catalog");
module.MapPouryaKitUniqueConstraint<CatalogDbContext>(
ProductConfiguration.NameIndex,
ProductErrors.NameInUse
);
Number sequences take a registration of their own, and a migration of the Module that calls CreateNumberSequenceTable with its schema, or the first number throws:
module.AddPouryaKitNumberSequences();
A command asks for the next number inside its Unit of Work:
var number = await sequences.NextAsync($"stock-count:{year}", cancellationToken);
What you get
- A schema per Module, with its own migrations history, on one or several databases.
- A violated unique index read back as the Error the Module mapped.
- Gap-free numbers per scope key, given back when the Operation rolls back.
The Host applies no migration at startup. Apply each Module's migrations yourself; in tests, HostFixture of PouryaKit.Testing applies them.
Learn more
| 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
- EFCore.NamingConventions (>= 10.0.1)
- Npgsql.EntityFrameworkCore.PostgreSQL (>= 10.0.3)
- PouryaKit.Persistence.EFCore (>= 0.1.0-preview.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on PouryaKit.Persistence.Postgres:
| Package | Downloads |
|---|---|
|
PouryaKit.Testing
Test against the hosted application: PostgreSQL in a Testcontainers container, data reset between tests, Operations through a Gateway, deliveries awaited and dead letters replayed. |
|
|
PouryaKit.Reporting.Module
The Kit's report Module: report jobs generated in the background, stored through the Host's file storage and served to their requester by a time-limited link. |
|
|
PouryaKit.AI.Postgres
Text stored by its embedding and searched by meaning with pgvector in PostgreSQL, within the tenant, in the Operation's Unit of Work. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.2 | 80 | 11/1/2026 |
| 0.1.0-preview.1 | 87 | 10/31/2026 |
| 0.1.0-preview.0.28 | 80 | 10/26/2026 |