Itmo.Dev.Platform.Postgres 1.2.384

Prefix Reserved
dotnet add package Itmo.Dev.Platform.Postgres --version 1.2.384
                    
NuGet\Install-Package Itmo.Dev.Platform.Postgres -Version 1.2.384
                    
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.384" />
                    
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.384" />
                    
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.384
                    
#r "nuget: Itmo.Dev.Platform.Postgres, 1.2.384"
                    
#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.384
                    
#: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.384
                    
Install as a Cake Addin
#tool nuget:?package=Itmo.Dev.Platform.Postgres&version=1.2.384
                    
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.384 82 4/11/2026
1.2.364 102 3/11/2026
1.2.356 95 3/2/2026
1.2.352 95 2/28/2026
1.2.350 98 2/28/2026
1.2.348 113 2/28/2026
1.2.334 109 2/14/2026
1.2.332 95 2/14/2026
1.2.330 104 2/14/2026
1.2.328 100 2/14/2026
1.2.324 193 12/13/2025
1.2.318 181 11/16/2025
1.2.308 224 10/9/2025
1.2.298 214 10/5/2025
1.2.296 208 10/5/2025
1.2.288 241 5/17/2025
1.2.275 163 5/10/2025
1.2.271 190 5/10/2025
1.2.269 169 5/10/2025
1.2.261 320 2/16/2025
Loading failed

Updated .Common package