RepoDb.CockroachDb.BulkOperations
0.0.1-alpha1
Prefix Reserved
dotnet add package RepoDb.CockroachDb.BulkOperations --version 0.0.1-alpha1
NuGet\Install-Package RepoDb.CockroachDb.BulkOperations -Version 0.0.1-alpha1
<PackageReference Include="RepoDb.CockroachDb.BulkOperations" Version="0.0.1-alpha1" />
<PackageVersion Include="RepoDb.CockroachDb.BulkOperations" Version="0.0.1-alpha1" />
<PackageReference Include="RepoDb.CockroachDb.BulkOperations" />
paket add RepoDb.CockroachDb.BulkOperations --version 0.0.1-alpha1
#r "nuget: RepoDb.CockroachDb.BulkOperations, 0.0.1-alpha1"
#:package RepoDb.CockroachDb.BulkOperations@0.0.1-alpha1
#addin nuget:?package=RepoDb.CockroachDb.BulkOperations&version=0.0.1-alpha1&prerelease
#tool nuget:?package=RepoDb.CockroachDb.BulkOperations&version=0.0.1-alpha1&prerelease
<div align="center"> <a href="https://repodb.net/tutorial/get-started-cockroachdb/"><image src="CockroachDB.png" style="width:256px;" /></a> <br/> <span style="font-size:28px;font-weight:bold;"><a href="https://repodb.net/tutorial/get-started-cockroachdb/"><strong>RepoDb.CockroachDb.BulkOperations</strong></a></span> <br/> <span style="font-size:16px;">A high-performance data productivity platform for bulk operations on CockroachDB in .NET.</span> </div>
<br/>
RepoDb.CockroachDb.BulkOperations
A high-performant extension library of RepoDB that does bulk operations towards a CockroachDB database. It uses the CockroachDbBulkCopy class of RepoDb.Connector.CockroachDb (Npgsql binary COPY) to load the data into the database.
Important Pages
- GitHub Home — core library and source code.
- Website — full documentation, API reference, and blog.
- Limitations — CockroachDB-specific caveats, including bulk staging tables.
Core Features
Community
- GitHub Issues — bug reports and feature requests.
- Microsoft Teams — live Q&A.
- GitHub Discussions — ask questions and share ideas.
- X / Twitter — news and updates.
License
Apache-2.0 — Copyright © 2026 Michael Camara Pendon
Installation
Install-Package RepoDb.CockroachDb.BulkOperations
Then initialize the bootstrapper once at application startup:
GlobalConfiguration
.Setup()
.UseCockroachDb();
Async Methods
Every synchronous operation has a corresponding Async overload.
BulkInsert
Inserts a list of entities into the database in bulk. Returns the number of inserted rows.
using (var connection = new CockroachDbConnection(ConnectionString))
{
var customers = GetCustomers();
var insertedRows = connection.BulkInsert<Customer>(customers);
}
Or via table-name:
using (var connection = new CockroachDbConnection(ConnectionString))
{
var customers = GetCustomers();
var insertedRows = connection.BulkInsert("Customer", customers);
}
Or via a DataTable:
using (var connection = new CockroachDbConnection(ConnectionString))
{
var table = GetCustomersAsDataTable();
var insertedRows = connection.BulkInsert("Customer", table);
}
Returning generated identities:
using (var connection = new CockroachDbConnection(ConnectionString))
{
var customers = GetCustomers(); // Id not set
connection.BulkInsert<Customer>(customers, identityBehavior: CockroachDbBulkImportIdentityBehavior.ReturnIdentity);
// customers[i].Id now holds the generated identity for each row
}
BulkMerge
Upserts a list of entities in bulk — inserts new rows and updates existing ones based on the defined qualifiers. Returns the number of affected rows.
using (var connection = new CockroachDbConnection(ConnectionString))
{
var customers = GetCustomers();
var mergedRows = connection.BulkMerge<Customer>(customers);
}
Or with qualifiers:
using (var connection = new CockroachDbConnection(ConnectionString))
{
var customers = GetCustomers();
var mergedRows = connection.BulkMerge<Customer>(customers, qualifiers: e => new { e.LastName, e.DateOfBirth });
}
Or via a DataTable:
using (var connection = new CockroachDbConnection(ConnectionString))
{
var table = GetCustomersAsDataTable();
var mergedRows = connection.BulkMerge("Customer", table);
}
BulkUpdate
Updates existing rows in the database in bulk, matched by the defined qualifiers. Returns the number of updated rows.
using (var connection = new CockroachDbConnection(ConnectionString))
{
var customers = GetCustomers();
var rows = connection.BulkUpdate<Customer>(customers);
}
Or with qualifiers:
using (var connection = new CockroachDbConnection(ConnectionString))
{
var customers = GetCustomers();
var rows = connection.BulkUpdate<Customer>(customers, qualifiers: e => new { e.LastName, e.DateOfBirth });
}
BulkDelete
Deletes existing rows from the database in bulk, matched by the defined qualifiers. Returns the number of deleted rows.
using (var connection = new CockroachDbConnection(ConnectionString))
{
var customers = GetCustomers();
var deletedRows = connection.BulkDelete<Customer>(customers);
}
Or with qualifiers:
using (var connection = new CockroachDbConnection(ConnectionString))
{
var customers = GetCustomers();
var deletedRows = connection.BulkDelete<Customer>(customers, qualifiers: e => new { e.LastName, e.DateOfBirth });
}
BulkDeleteByKey
Deletes existing rows from the database in bulk, matched by their primary (or identity) key value alone — no entities or DataTable involved, just the list of key values to remove. Returns the number of deleted rows.
using (var connection = new CockroachDbConnection(ConnectionString))
{
var primaryKeys = new [] { 10045L, 10046L, 10047L };
var deletedRows = connection.BulkDeleteByKey("Customer", primaryKeys);
}
Notes
BulkMerge, BulkUpdate, BulkDelete, BulkDeleteByKey, and BulkInsert with ReturnIdentity stage rows in a pseudo table before applying them. Staging runs DDL (CREATE/ALTER/DROP TABLE), and CockroachDB commits any open transaction before DDL by default (autocommit_before_ddl). Memory staging (what the default Auto uses below 5,000 rows) also switches on experimental_enable_temp_tables for the session. See the Limitations page for details.
| 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
- RepoDb (>= 1.17.0-alpha2)
- RepoDb.CockroachDb (>= 0.0.1-alpha1)
- RepoDb.Connector.CockroachDb (>= 0.0.1-alpha1)
-
net8.0
- RepoDb (>= 1.17.0-alpha2)
- RepoDb.CockroachDb (>= 0.0.1-alpha1)
- RepoDb.Connector.CockroachDb (>= 0.0.1-alpha1)
-
net9.0
- RepoDb (>= 1.17.0-alpha2)
- RepoDb.CockroachDb (>= 0.0.1-alpha1)
- RepoDb.Connector.CockroachDb (>= 0.0.1-alpha1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.1-alpha1 | 0 | 9/26/2026 |