Itmo.Dev.Platform.Postgres 1.2.318

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Itmo.Dev.Platform.Postgres --version 1.2.318
                    
NuGet\Install-Package Itmo.Dev.Platform.Postgres -Version 1.2.318
                    
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.318" />
                    
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.318" />
                    
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.318
                    
#r "nuget: Itmo.Dev.Platform.Postgres, 1.2.318"
                    
#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.318
                    
#: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.318
                    
Install as a Cake Addin
#tool nuget:?package=Itmo.Dev.Platform.Postgres&version=1.2.318
                    
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 net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.324 152 12/13/2025
1.2.318 149 11/16/2025
1.2.308 199 10/9/2025
1.2.298 184 10/5/2025
1.2.296 180 10/5/2025
1.2.288 210 5/17/2025
1.2.275 134 5/10/2025
1.2.271 159 5/10/2025
1.2.269 144 5/10/2025
1.2.261 286 2/16/2025
1.2.255 241 2/6/2025
1.2.253 218 2/3/2025
1.1.174 1,547 10/25/2024
1.1.105 447 5/4/2024 1.1.105 is deprecated because it is no longer maintained.
1.1.102 313 5/4/2024 1.1.102 is deprecated because it is no longer maintained.
1.1.101 345 4/26/2024 1.1.101 is deprecated because it is no longer maintained.
1.1.100 307 4/22/2024 1.1.100 is deprecated because it is no longer maintained.
1.1.99 300 4/21/2024 1.1.99 is deprecated because it is no longer maintained.
1.1.98 303 4/21/2024 1.1.98 is deprecated because it is no longer maintained.
1.1.97 307 4/19/2024 1.1.97 is deprecated because it is no longer maintained.
1.1.96 295 4/18/2024 1.1.96 is deprecated because it is no longer maintained.
1.1.95 297 4/18/2024 1.1.95 is deprecated because it is no longer maintained.
1.1.94 401 2/13/2024 1.1.94 is deprecated because it is no longer maintained.
1.1.93 355 2/10/2024 1.1.93 is deprecated because it is no longer maintained.
1.1.91 314 2/10/2024 1.1.91 is deprecated because it is no longer maintained.
1.1.90 309 2/10/2024 1.1.90 is deprecated because it is no longer maintained.
1.1.89 743 2/3/2024 1.1.89 is deprecated because it is no longer maintained.
1.1.86 313 2/1/2024 1.1.86 is deprecated because it is no longer maintained.
1.1.85 363 1/30/2024 1.1.85 is deprecated because it is no longer maintained.
1.1.83 439 1/27/2024 1.1.83 is deprecated because it is no longer maintained.
1.1.82 616 1/5/2024 1.1.82 is deprecated because it is no longer maintained.
1.1.81 448 1/3/2024 1.1.81 is deprecated because it is no longer maintained.
1.1.80 301 12/30/2023 1.1.80 is deprecated because it is no longer maintained.
1.1.79 274 12/30/2023 1.1.79 is deprecated because it is no longer maintained.
1.1.78 296 12/30/2023 1.1.78 is deprecated because it is no longer maintained.
1.1.77 338 12/28/2023 1.1.77 is deprecated because it is no longer maintained.
1.1.76 314 12/27/2023 1.1.76 is deprecated because it is no longer maintained.
1.1.75 1,088 12/9/2023 1.1.75 is deprecated because it is no longer maintained.
1.1.73 479 11/30/2023 1.1.73 is deprecated because it is no longer maintained.
1.1.72 346 11/27/2023 1.1.72 is deprecated because it is no longer maintained.
1.1.71 305 11/27/2023 1.1.71 is deprecated because it is no longer maintained.
1.1.70 314 11/27/2023 1.1.70 is deprecated because it is no longer maintained.
1.1.69 279 11/27/2023 1.1.69 is deprecated because it is no longer maintained.
1.1.67 313 11/25/2023 1.1.67 is deprecated because it is no longer maintained.
1.1.66 285 11/25/2023 1.1.66 is deprecated because it is no longer maintained.
1.1.65 320 11/23/2023 1.1.65 is deprecated because it is no longer maintained.
1.1.64 288 11/23/2023 1.1.64 is deprecated because it is no longer maintained.
1.1.62 720 11/18/2023 1.1.62 is deprecated because it is no longer maintained.
1.1.61 304 11/18/2023 1.1.61 is deprecated because it is no longer maintained.
1.1.60 278 11/17/2023 1.1.60 is deprecated because it is no longer maintained.
1.1.59 310 11/16/2023 1.1.59 is deprecated because it is no longer maintained.
1.0.58 283 11/13/2023 1.0.58 is deprecated because it is no longer maintained.
1.0.57 275 11/12/2023 1.0.57 is deprecated because it is no longer maintained.
1.0.56 307 11/12/2023 1.0.56 is deprecated because it is no longer maintained.
1.0.54 377 11/7/2023 1.0.54 is deprecated because it is no longer maintained.
1.0.53 305 11/4/2023 1.0.53 is deprecated because it is no longer maintained.
1.0.52 313 10/29/2023 1.0.52 is deprecated because it is no longer maintained.
1.0.51 281 10/29/2023 1.0.51 is deprecated because it is no longer maintained.
1.0.50 283 10/29/2023 1.0.50 is deprecated because it is no longer maintained.
1.0.48 631 10/29/2023 1.0.48 is deprecated because it is no longer maintained.

Updated .Common package