Alvecta.Foundation.Infrastructure.EF.Postgres
9.0.83
dotnet add package Alvecta.Foundation.Infrastructure.EF.Postgres --version 9.0.83
NuGet\Install-Package Alvecta.Foundation.Infrastructure.EF.Postgres -Version 9.0.83
<PackageReference Include="Alvecta.Foundation.Infrastructure.EF.Postgres" Version="9.0.83" />
<PackageVersion Include="Alvecta.Foundation.Infrastructure.EF.Postgres" Version="9.0.83" />
<PackageReference Include="Alvecta.Foundation.Infrastructure.EF.Postgres" />
paket add Alvecta.Foundation.Infrastructure.EF.Postgres --version 9.0.83
#r "nuget: Alvecta.Foundation.Infrastructure.EF.Postgres, 9.0.83"
#:package Alvecta.Foundation.Infrastructure.EF.Postgres@9.0.83
#addin nuget:?package=Alvecta.Foundation.Infrastructure.EF.Postgres&version=9.0.83
#tool nuget:?package=Alvecta.Foundation.Infrastructure.EF.Postgres&version=9.0.83
Alvecta.Foundation.Infrastructure.EF.Postgres
PostgreSQL additions to Alvecta.Foundation.Infrastructure.EF: creates the target schema before
migrations run, and registers the Postgres implementations of the Alvecta.Utils.Db helpers.
It belongs to the Infrastructure layer. Dependencies: Alvecta.Foundation.Infrastructure.EF,
Alvecta.Utils.Db.Postgres and Npgsql.
What it contains
CreateSchemaPreMigrationAction— anIDatabasePreMigrationActionthat reads the first schema of the connection string'sSearch Pathand runsCREATE SCHEMA IF NOT EXISTSfor it, soDatabaseMigratorcan migrate into a schema that does not exist yet. Without a search path it does nothing.AlvectaFoundationEFPostgresStartup.ConfigureServices(IServiceCollection)— registers that action, plusIDatabaseConnectionsCleaner(clears the Npgsql connection pools) andIDatabaseExceptionHelper(classifies Postgres exceptions as user or network errors) fromAlvecta.Utils.Db.Postgres.
It does not configure the provider itself: IDbDataSourceProvider and IDbContextOptionsAction
come from another package, such as Alvecta.Foundation.Infrastructure.EF.AuroraDsql, or from your
own infrastructure project.
Usage
dotnet add package Alvecta.Foundation.Infrastructure.EF.Postgres
Call it from the composition root, next to the EF registrations:
using Alvecta.Foundation.Infrastructure.EF.Postgres;
AlvectaFoundationEFPostgresStartup.ConfigureServices(services);
With a connection string such as
Host=...;Database=postgres;Username=app;Search Path=Orders, the first
IDatabaseMigrator.MigrateAsync() creates the Orders schema and then applies the migrations into
it.
DatabaseMigrator needs exactly one IDatabasePreMigrationAction. When you do not use this package,
register NoneDatabasePreMigrationAction from Alvecta.Foundation.Infrastructure.EF instead.
| 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
- Alvecta.Foundation.Infrastructure.EF (>= 9.0.83)
- Alvecta.Utils.Db.Postgres (>= 8.4.79)
- Npgsql (>= 10.0.3)
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 |
|---|---|---|
| 9.0.83 | 31 | 10/29/2026 |
| 9.0.82 | 36 | 10/29/2026 |
| 8.1.81 | 42 | 10/29/2026 |
| 8.0.80 | 39 | 10/28/2026 |
| 8.0.79 | 43 | 10/28/2026 |
| 8.0.78 | 42 | 10/28/2026 |
| 8.0.77 | 52 | 10/28/2026 |
| 7.1.76 | 72 | 10/27/2026 |
| 7.1.75 | 86 | 10/26/2026 |
| 7.0.74 | 85 | 10/26/2026 |
| 7.0.73 | 87 | 10/23/2026 |
| 7.0.72 | 113 | 10/23/2026 |
| 7.0.71 | 89 | 10/23/2026 |
| 7.0.70 | 91 | 10/22/2026 |
| 7.0.69 | 93 | 10/21/2026 |
| 7.0.68 | 81 | 10/21/2026 |
| 7.0.67 | 94 | 10/20/2026 |
| 7.0.66 | 79 | 10/19/2026 |
| 7.0.65 | 89 | 10/19/2026 |
| 6.3.64 | 82 | 10/19/2026 |