PgBulk.Abstractions
2.0.1
dotnet add package PgBulk.Abstractions --version 2.0.1
NuGet\Install-Package PgBulk.Abstractions -Version 2.0.1
<PackageReference Include="PgBulk.Abstractions" Version="2.0.1" />
<PackageVersion Include="PgBulk.Abstractions" Version="2.0.1" />
<PackageReference Include="PgBulk.Abstractions" />
paket add PgBulk.Abstractions --version 2.0.1
#r "nuget: PgBulk.Abstractions, 2.0.1"
#:package PgBulk.Abstractions@2.0.1
#addin nuget:?package=PgBulk.Abstractions&version=2.0.1
#tool nuget:?package=PgBulk.Abstractions&version=2.0.1
PgBulk
High-performance bulk operations for PostgreSQL using Npgsql binary import (COPY ... FROM STDIN BINARY).
Features
- Bulk Insert — fast binary import of large datasets
- Bulk Merge (Upsert) — insert or update using primary key or custom key columns
- Bulk Sync — replace table contents (delete + insert) with optional
WHEREclause - EF Core integration — extension methods on
DbContextwith automatic table/column mapping - Manual mapping — use without EF Core by defining table mappings explicitly
- CancellationToken support throughout all async operations
- Configurable timeout —
CommandTimeoutproperty (default:0= infinite, appropriate for bulk workloads) - Multi-target:
net8.0,net9.0,net10.0
Installation
dotnet add package PgBulk.EFCore
Or for usage without EF Core:
dotnet add package PgBulk
Quick Start (EF Core)
using PgBulk.EFCore;
// Bulk insert
await dbContext.BulkInsertAsync(entities);
// Bulk upsert (merge) — matches on primary key
await dbContext.BulkMergeAsync(entities);
// Bulk sync — deletes rows not in the collection, then inserts all
await dbContext.BulkSyncAsync(entities);
// With options
await dbContext.BulkInsertAsync(entities,
timeoutOverride: 120,
onConflictIgnore: true,
cancellationToken: ct);
Quick Start (Manual Mapping)
var provider = new ManualTableInformationProvider()
.AddTableMapping<MyEntity>("my_table", c => c.Automap());
var bulk = new ManualBulkOperator(connectionString, provider);
await bulk.InsertAsync(entities, onConflictIgnore: false);
Custom Merge Keys
By default, merge uses the primary key. To merge on different columns:
var keyProvider = new EntityManualTableKeyProvider<MyEntity>();
await keyProvider.AddKeyColumn(e => e.ExternalId, dbContext);
await dbContext.BulkMergeAsync(entities, tableKeyProvider: keyProvider);
Timeout Configuration
The default CommandTimeout is 0 (infinite), which is appropriate for bulk operations on large datasets. Override per-call or per-operator:
// Per-call via extension method
await dbContext.BulkInsertAsync(entities, timeoutOverride: 300);
// Per-operator instance
var op = dbContext.GetBulkOperator(timeoutOverride: 300);
// or
op.CommandTimeout = 300;
License
| 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 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 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
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on PgBulk.Abstractions:
| Package | Downloads |
|---|---|
|
PgBulk
High-performance bulk operations (insert, merge, sync) for PostgreSQL using Npgsql binary import. |
|
|
PgBulk.EFCore
High-performance bulk operations (insert, merge, sync) for PostgreSQL using Npgsql binary import. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.1 | 56 | 2/20/2026 |
| 2.0.0 | 152 | 2/19/2026 |
| 1.2.2 | 2,065 | 12/14/2023 |
| 1.2.0 | 332 | 12/14/2023 |
| 1.1.3 | 2,722 | 11/6/2023 |
| 1.1.2 | 987 | 9/25/2023 |
| 1.1.1 | 479 | 9/20/2023 |
| 1.1.0 | 283 | 9/20/2023 |
| 1.0.9 | 1,992 | 7/1/2022 |
| 1.0.8 | 915 | 6/30/2022 |
| 1.0.7 | 900 | 6/29/2022 |
| 1.0.3 | 915 | 6/29/2022 |
| 1.0.2 | 916 | 6/29/2022 |
| 1.0.1 | 928 | 6/29/2022 |
| 1.0.0 | 943 | 6/29/2022 |