Regira.DAL.PostgreSQL
6.1.2
dotnet add package Regira.DAL.PostgreSQL --version 6.1.2
NuGet\Install-Package Regira.DAL.PostgreSQL -Version 6.1.2
<PackageReference Include="Regira.DAL.PostgreSQL" Version="6.1.2" />
<PackageVersion Include="Regira.DAL.PostgreSQL" Version="6.1.2" />
<PackageReference Include="Regira.DAL.PostgreSQL" />
paket add Regira.DAL.PostgreSQL --version 6.1.2
#r "nuget: Regira.DAL.PostgreSQL, 6.1.2"
#:package Regira.DAL.PostgreSQL@6.1.2
#addin nuget:?package=Regira.DAL.PostgreSQL&version=6.1.2
#tool nuget:?package=Regira.DAL.PostgreSQL&version=6.1.2
Regira DAL — PostgreSQL
Regira DAL.PostgreSQL provides PostgreSQL backup/restore via pg_dump/pg_restore (settings, options, and backup/restore services — no CRUD or communicator surface).
Projects
| Project | Package | Backend | CRUD | Backup / Restore |
|---|---|---|---|---|
DAL.PostgreSQL |
Regira.DAL.PostgreSQL |
PostgreSQL | — | ✓ (pg_dump) |
Installation
<PackageReference Include="Regira.DAL.PostgreSQL" Version="6.*" />
PgSettings
| Property | Type | Description |
|---|---|---|
Host |
string |
Hostname |
DatabaseName |
string |
Target database |
Username |
string? |
Auth username |
Password |
string? |
Auth password |
Port |
string |
Default "5432" |
var settings = new PgSettings("localhost", "mydb", "postgres", "pass");
PgBackupService / PgRestoreService
Requires pg_dump / pg_restore executables. Supports schema-specific backups.
var settings = new PgSettings("localhost", "mydb", "postgres", "pass");
IProcessHelper processHelper = new ProcessHelper(); // Regira.System
var options = new PgOptions
{
DbSettings = settings,
ToolsDirectory = "/usr/lib/postgresql/16/bin",
BackupSchemas = ["public", "reports"],
Overwrite = true
};
// third parameter is a nullable ILogger — pass null (or an injected logger)
IMemoryFile backup = await new PgBackupService(options, processHelper, null).Backup();
await new PgRestoreService(options, processHelper, null).Restore(backup);
PgRestoreService can also create the target database if it does not exist:
await pgRestore.Create(connection, "new_database");
bool exists = await pgRestore.Exists(connection, "new_database");
BackupRestoreManager
Standalone manager — useful when you want both backup and restore from the same object.
var settings = new PgSettings("localhost", "mydb", "postgres", "pass");
var options = new PgOptions { DbSettings = settings };
IProcessHelper processHelper = new ProcessHelper(); // Regira.System
var mgr = new BackupRestoreManager(processHelper, options);
mgr.Backup(settings, "sourceDb", "/backups/snapshot.dump"); // synchronous (void)
await mgr.Restore(settings, "targetDb", "/backups/snapshot.dump", overwrite: true);
Backup/Restore contracts
Both services implement the shared contracts from Common:
public interface IDbBackupService { Task<IMemoryFile> Backup(); }
public interface IDbRestoreService { Task Restore(IMemoryFile file); }
Overview
- Index — Settings, backup/restore, and BackupRestoreManager
- Examples — Schema-specific backup, create and restore
License
Apache License 2.0 — this package contains no license validation and no runtime limits. See LICENSE. A few companion packages are commercially licensed with a free tier; see the licensing overview.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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 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. |
-
net10.0
- Dapper (>= 2.1.79)
- Npgsql (>= 10.0.3)
- Regira.System (>= 6.1.2)
-
net8.0
- Dapper (>= 2.1.79)
- Npgsql (>= 10.0.3)
- Regira.System (>= 6.1.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.