Itmo.Dev.Platform.Postgres 1.2.449

Prefix Reserved
dotnet add package Itmo.Dev.Platform.Postgres --version 1.2.449
                    
NuGet\Install-Package Itmo.Dev.Platform.Postgres -Version 1.2.449
                    
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="Itmo.Dev.Platform.Postgres" Version="1.2.449" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Itmo.Dev.Platform.Postgres" Version="1.2.449" />
                    
Directory.Packages.props
<PackageReference Include="Itmo.Dev.Platform.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 Itmo.Dev.Platform.Postgres --version 1.2.449
                    
#r "nuget: Itmo.Dev.Platform.Postgres, 1.2.449"
                    
#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 Itmo.Dev.Platform.Postgres@1.2.449
                    
#: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=Itmo.Dev.Platform.Postgres&version=1.2.449
                    
Install as a Cake Addin
#tool nuget:?package=Itmo.Dev.Platform.Postgres&version=1.2.449
                    
Install as a Cake Tool

Itmo.Dev.Platform.Postgres

Platform extensions for working with PostgreSQL database

Connection

You can obtain database connection using IPostgresConnectionProvider

var connection = await provider.GetConnectionAsync(cancellationToken);

Migrations

Package using FluentMigrator as it's migration engine, thus all FluentMigrator's migrations are compatible and will be executed.

Nevertheless, it is strongly recommended to inherit from SqlMigration and implement your migrations as raw sql queries.

[Migration(1, "Initial")]
public class InitialMigration : SqlMigration
{
    protected override string GetUpSql(IServiceProvider serviceProvider)
    {
        return """
        CREATE TABLE USERS
        (
            user_id bigint PRIMARY KEY,
            user_name text NOT NULL
        );
        """;
    }
    
    protected override string GetDownSql(IServiceProvider serviceProvider)
    {
        return """
        DROP TABLE USERS;
        """;
    }
}

Registration

Use extension methods on service collection to register Itmo.Dev.Platform.Postgres services and migrations.

Connection

To configure connection string bind configuration with such schema to configuration builder, using extension method's parameter.

{
  "Host" : "string",
  "Port" : 5432,
  "Database" : "string",
  "Username" : "string",
  "Password" : "string",
  "SslMode" : "string",
  "Pooling" : true
}
collection.AddPlatformPostgres(options => options.Bind("Database"));

Migrations

To register migrations call AddPlatformMigrations on service collection. Pass the assemblies containing migration classes.

collection.AddPlatformMigrations(typeof(IMigrationsAssemblyMarker).Assembly);

To run migrations, create scope and call UsePlatformMigrationsAsync on it.

using var scope = serviceProvider.CreateScope();
await scope.UsePlatformMigrationsAsync()
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
1.2.449 32 8/12/2026
1.2.447 39 8/12/2026
1.2.414 115 7/1/2026
1.2.412 111 6/30/2026
1.2.410 112 6/30/2026
1.2.406 106 6/30/2026
1.2.402 108 6/30/2026
1.2.398 116 6/30/2026
1.2.388 126 4/27/2026
1.2.384 121 4/11/2026
1.2.364 141 3/11/2026
1.2.356 142 3/2/2026
1.2.352 135 2/28/2026
1.2.350 136 2/28/2026
1.2.348 158 2/28/2026
1.2.334 147 2/14/2026
1.2.332 132 2/14/2026
1.2.330 136 2/14/2026
1.2.328 137 2/14/2026
1.2.324 225 12/13/2025
Loading failed

Updated .Common package