Npgsql.Bulk 0.10.3

.NET 5.0 .NET Standard 2.0 .NET Framework 4.5
dotnet add package Npgsql.Bulk --version 0.10.3
NuGet\Install-Package Npgsql.Bulk -Version 0.10.3
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="Npgsql.Bulk" Version="0.10.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Npgsql.Bulk --version 0.10.3
#r "nuget: Npgsql.Bulk, 0.10.3"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Npgsql.Bulk as a Cake Addin
#addin nuget:?package=Npgsql.Bulk&version=0.10.3

// Install Npgsql.Bulk as a Cake Tool
#tool nuget:?package=Npgsql.Bulk&version=0.10.3

Npgsql.Bulk

Helper for performing COPY (bulk insert and update) operation easily, using Entity Framework + Npgsql.

.Net 4.5, Standard 2.0 are supported.

var uploader = new NpgsqlBulkUploader(context);
var data = GetALotOfData();

// To create a lot of objects
uploader.Insert(data);

// To update a lot of objects
uploader.Update(data);

For .Net 4.5 BulkSelect operation is implemented which emulates join in-memory table to DB table. Here is the example:

// We need DbContext first
var context = GetContext();                 

// Obtained a collection of 50k transactions
var transactions = GetListOfTransction();   

// Need to get prices from DB for all transactions, do it with 1 SQL call
var prices = context.Prices.BulkSelect(
    x => new { x.Ticker, x.TradedOn },                      // need to specify key for JOIN
    transactions.Select(x => new { x.Ticker, x.TradedOn })  // obtain key data from local objects
);

// Done, prices variable now contains List<Price> which matches the JOIN DB table to in-memory collection

Available on NuGet:

Install-Package Npgsql.Bulk
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Npgsql.Bulk:

Package Downloads
Hikari

C#数据库连接池,管理多数据库连接

BlueBitSoft.BlueUtility

Package Description

IIMes.Kernel

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.10.3 31,978 7/26/2022
0.10.2 2,649 7/25/2022
0.10.1 84,965 12/10/2021
0.10.0 939 12/10/2021
0.9.0 350,225 11/19/2020
0.8.4 20,889 11/6/2020
0.8.3.1 1,018 11/2/2020
0.8.3 525 10/30/2020
0.8.2 32,200 9/3/2020
0.8.1.1 102,059 4/18/2020
0.8.1 474 4/18/2020
0.8.0 33,766 1/18/2020
0.8.0-beta 361 1/5/2020
0.7.7.1 41,279 11/23/2019
0.7.7 9,581 11/14/2019
0.7.6.1 8,604 10/11/2019
0.7.6 3,333 10/6/2019
0.7.5 29,169 9/29/2019
0.7.4 3,897 7/20/2019
0.7.3 449 7/20/2019
0.7.2 6,822 6/25/2019
0.7.1 3,845 6/14/2019
0.7.0 6,316 5/19/2019
0.6.9 6,325 4/25/2019
0.6.8 3,958 4/3/2019
0.6.7 506 4/2/2019
0.6.6 2,315 3/22/2019
0.6.5 480 3/20/2019
0.6.4 1,350 3/2/2019
0.6.3 668 2/12/2019
0.6.2 16,606 11/1/2018
0.6.1 6,372 9/14/2018
0.6.0 713 9/13/2018
0.5.21 1,285 9/13/2018
0.5.20 997 8/23/2018
0.5.19 691 8/22/2018
0.5.18 697 8/21/2018
0.5.17 813 7/23/2018
0.5.16 1,074 5/23/2018
0.5.15 963 5/16/2018
0.5.14 877 5/1/2018
0.5.13 1,076 2/23/2018
0.5.12 937 1/10/2018
0.5.11 945 1/9/2018
0.5.10 937 12/26/2017
0.5.9 904 12/25/2017
0.5.8 1,079 12/11/2017
0.5.7 984 12/10/2017
0.5.6 858 11/16/2017
0.5.5 866 11/1/2017
0.5.4 826 10/25/2017
0.5.2 880 10/17/2017

Fix for duplicate insert