CockroachDB (Bulk)
This page contains the latest information of the releases of RepoDb.CockroachDb.BulkOperations library.
View the NuGet package here or download it directly here.
RepoDb.CockroachDb.BulkOperations (v0.0.1-alpha1) - Preview
Released: September 26, 2026
New
First (alpha) release of the bulk operations extension for RepoDb.CockroachDb, built on CockroachDbBulkCopy, a native binary COPY-based bulk writer from RepoDb.Connector.CockroachDb.
What’s included
- BulkInsert, BulkMerge, BulkUpdate, BulkDelete, and BulkDeleteByKey, each with an
Asyncoverload — callable against aCockroachDbConnection, aBaseRepository<TEntity, CockroachDbConnection>, or aDbRepository<CockroachDbConnection>, with an entity list, aDataTable, or anIDataReader(BulkDeleteByKeytakes a list of primary key values instead). - CockroachDbBulkImportIdentityBehavior (
KeepIdentitydefault,ReturnIdentity) — controls whether identity values are sent as-is or read back via aRETURNINGclause. - CockroachDbBulkImportPseudoTableType (
Auto,Memory,Physical) — selects the staging-table strategy. Unlike some other providers’ equivalent enum,Autogenuinely implements its row-count heuristic here:Physicalat 5,000 rows or more,Memorybelow that. - CockroachDbBulkInsertMapItem — explicit source-to-destination column mapping for
BulkInsert/BulkMerge/BulkUpdate, with an optionalCockroachDbTypeoverride per mapping, and up-front type-compatibility checking. - CockroachDbTraceKeys — the
traceKeyconstants for use with a custom ITrace. - A
BulkMergewithidentityBehavior: ReturnIdentitypre-assigns identities for the rows that will be inserted (nextval(pg_get_serial_sequence(...))) and then performs the whole upsert — matched and unmatched rows alike — through a singleINSERT ... OVERRIDING SYSTEM VALUE ... ON CONFLICT DO UPDATE ... RETURNINGstatement, rather than the multi-statement snapshot/update/insert sequence some other providers require for the same feature. - An internal type-coercing data reader converts every mapped value to its destination column’s actual CLR type before it reaches
CockroachDbBulkCopy— CockroachDB’sINT/INTEGERis a 64-bitINT8, and Npgsql’s binaryCOPYotherwise infers a 4-byteINT4from a plain .NETint, which CockroachDB rejects. - Referenced the
RepoDbpackagev1.17.0-alpha2. - Referenced the
RepoDb.CockroachDbpackagev0.0.1-alpha1. - References the
RepoDb.Connector.CockroachDbpackagev0.0.1-alpha1.
Known limitations (v1)
RepoDb.Connector.CockroachDbis an independent, unofficial ADO.NET provider for CockroachDB (a thin wrapper over Npgsql) — not affiliated with or endorsed by Cockroach Labs, and still in early development.- Requesting
CockroachDbBulkImportPseudoTableType.MemoryrunsSET experimental_enable_temp_tables = 'on';first — CockroachDB only supports temporary tables experimentally. - Every bulk call creates its own pseudo table and drops it once the call completes, rather than reusing one across calls.
- No
Unspecifiedidentity-behavior state — CockroachDbBulkImportIdentityBehavior defaults straight toKeepIdentity.