Alvecta.Foundation.Infrastructure.EF.Postgres 8.0.78

There is a newer version of this package available.
See the version list below for details.
dotnet add package Alvecta.Foundation.Infrastructure.EF.Postgres --version 8.0.78
                    
NuGet\Install-Package Alvecta.Foundation.Infrastructure.EF.Postgres -Version 8.0.78
                    
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="Alvecta.Foundation.Infrastructure.EF.Postgres" Version="8.0.78" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alvecta.Foundation.Infrastructure.EF.Postgres" Version="8.0.78" />
                    
Directory.Packages.props
<PackageReference Include="Alvecta.Foundation.Infrastructure.EF.Postgres" />
                    
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 Alvecta.Foundation.Infrastructure.EF.Postgres --version 8.0.78
                    
#r "nuget: Alvecta.Foundation.Infrastructure.EF.Postgres, 8.0.78"
                    
#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 Alvecta.Foundation.Infrastructure.EF.Postgres@8.0.78
                    
#: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=Alvecta.Foundation.Infrastructure.EF.Postgres&version=8.0.78
                    
Install as a Cake Addin
#tool nuget:?package=Alvecta.Foundation.Infrastructure.EF.Postgres&version=8.0.78
                    
Install as a Cake Tool

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 — an IDatabasePreMigrationAction that reads the first schema of the connection string's Search Path and runs CREATE SCHEMA IF NOT EXISTS for it, so DatabaseMigrator can migrate into a schema that does not exist yet. Without a search path it does nothing.
  • AlvectaFoundationEFPostgresStartup.ConfigureServices(IServiceCollection) — registers that action, plus IDatabaseConnectionsCleaner (clears the Npgsql connection pools) and IDatabaseExceptionHelper (classifies Postgres exceptions as user or network errors) from Alvecta.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 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. 
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
9.0.83 39 10/29/2026
9.0.82 43 10/29/2026
8.1.81 46 10/29/2026
8.0.80 41 10/28/2026
8.0.79 44 10/28/2026
8.0.78 43 10/28/2026
8.0.77 53 10/28/2026
7.1.76 73 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
Loading failed