![]() |
VOOZH | about |
dotnet add package Itmo.Dev.Platform.Postgres --version 1.2.388
NuGet\Install-Package Itmo.Dev.Platform.Postgres -Version 1.2.388
<PackageReference Include="Itmo.Dev.Platform.Postgres" Version="1.2.388" />
<PackageVersion Include="Itmo.Dev.Platform.Postgres" Version="1.2.388" />Directory.Packages.props
<PackageReference Include="Itmo.Dev.Platform.Postgres" />Project file
paket add Itmo.Dev.Platform.Postgres --version 1.2.388
#r "nuget: Itmo.Dev.Platform.Postgres, 1.2.388"
#:package Itmo.Dev.Platform.Postgres@1.2.388
#addin nuget:?package=Itmo.Dev.Platform.Postgres&version=1.2.388Install as a Cake Addin
#tool nuget:?package=Itmo.Dev.Platform.Postgres&version=1.2.388Install as a Cake Tool
Platform extensions for working with PostgreSQL database
You can obtain database connection using IPostgresConnectionProvider
var connection = await provider.GetConnectionAsync(cancellationToken);
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;
""";
}
}
Use extension methods on service collection to register Itmo.Dev.Platform.Postgres services and migrations.
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"));
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.388 | 115 | 4/27/2026 |
| 1.2.384 | 113 | 4/11/2026 |
| 1.2.364 | 132 | 3/11/2026 |
| 1.2.356 | 128 | 3/2/2026 |
| 1.2.352 | 123 | 2/28/2026 |
| 1.2.350 | 125 | 2/28/2026 |
| 1.2.348 | 142 | 2/28/2026 |
| 1.2.334 | 138 | 2/14/2026 |
| 1.2.332 | 120 | 2/14/2026 |
| 1.2.330 | 125 | 2/14/2026 |
| 1.2.328 | 126 | 2/14/2026 |
| 1.2.324 | 212 | 12/13/2025 |
| 1.2.318 | 205 | 11/16/2025 |
| 1.2.308 | 248 | 10/9/2025 |
| 1.2.298 | 238 | 10/5/2025 |
| 1.2.296 | 228 | 10/5/2025 |
| 1.2.288 | 268 | 5/17/2025 |
| 1.2.275 | 188 | 5/10/2025 |
| 1.2.271 | 208 | 5/10/2025 |
| 1.2.269 | 189 | 5/10/2025 |
Updated .Common package