Npgsql.Bulk 0.9.0

Extension for Entity Framework Npgsql for Bulk Copy

Install-Package Npgsql.Bulk -Version 0.9.0
dotnet add package Npgsql.Bulk --version 0.9.0
<PackageReference Include="Npgsql.Bulk" Version="0.9.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Npgsql.Bulk --version 0.9.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Npgsql.Bulk, 0.9.0"
#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.9.0

// Install Npgsql.Bulk as a Cake Tool
#tool nuget:?package=Npgsql.Bulk&version=0.9.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

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

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

Release Notes

.Net 5 support

NuGet packages (2)

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

Package Downloads
Hikari
C#数据库连接池,管理多数据库连接 郑重说明:本库定位于数据库连接池,源码GitHub开源公开
BlueBitSoft.BlueUtility
Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.9.0 141,059 11/19/2020
0.8.4 10,704 11/6/2020
0.8.3.1 474 11/2/2020
0.8.3 347 10/30/2020
0.8.2 22,367 9/3/2020
0.8.1.1 74,443 4/18/2020
0.8.1 282 4/18/2020
0.8.0 17,164 1/18/2020
0.8.0-beta 273 1/5/2020
0.7.7.1 34,132 11/23/2019
0.7.7 8,465 11/14/2019
0.7.6.1 6,927 10/11/2019
0.7.6 1,271 10/6/2019
0.7.5 23,531 9/29/2019
0.7.4 3,666 7/20/2019
0.7.3 266 7/20/2019
0.7.2 6,601 6/25/2019
0.7.1 3,556 6/14/2019
0.7.0 4,381 5/19/2019
0.6.9 6,133 4/25/2019
0.6.8 3,768 4/3/2019
0.6.7 306 4/2/2019
0.6.6 1,007 3/22/2019
0.6.5 322 3/20/2019
0.6.4 1,160 3/2/2019
0.6.3 483 2/12/2019
0.6.2 7,171 11/1/2018
0.6.1 5,538 9/14/2018
0.6.0 500 9/13/2018
0.5.21 1,032 9/13/2018
0.5.20 754 8/23/2018
0.5.19 474 8/22/2018
0.5.18 487 8/21/2018
0.5.17 581 7/23/2018
0.5.16 813 5/23/2018
0.5.15 636 5/16/2018
0.5.14 584 5/1/2018
0.5.13 796 2/23/2018
0.5.12 664 1/10/2018
0.5.11 646 1/9/2018
0.5.10 665 12/26/2017
0.5.9 640 12/25/2017
0.5.8 785 12/11/2017
0.5.7 726 12/10/2017
0.5.6 623 11/16/2017
0.5.5 620 11/1/2017
0.5.4 598 10/25/2017
0.5.2 627 10/17/2017