DuckDB (Bulk)
This page contains the latest information of the releases of RepoDb.DuckDb.BulkOperations library.
View the NuGet package here or download it directly here.
RepoDb.DuckDb.BulkOperations (v0.0.1-alpha1) - Preview
Released: September 25, 2026
New
First (alpha) release of the bulk operations extension for RepoDb.DuckDb, built on DuckDB.NET’s native DuckDBAppender (via the DuckDbBulkAppender wrapper). #1348
What’s included
- BulkInsert, BulkMerge, BulkUpdate, BulkDelete, and BulkDeleteByKey, each with an
Asyncoverload — callable against aDuckDBConnection, aBaseRepository<TEntity, DuckDBConnection>, or aDbRepository<DuckDBConnection>, with an entity list, aDataTable, or anIDataReader(BulkDeleteByKeytakes a list of primary key values instead). - DuckDbBulkImportIdentityBehavior (
KeepIdentitydefault,ReturnIdentity) — controls whether identity values are sent as-is or read back.ReturnIdentityreads the generated values back via aRETURNINGclause on the same statement that loads the staged rows into the real table. - DuckDbBulkImportPseudoTableType (
Auto,Memory,Physical) — selects the staging-table strategy backingBulkInsert(whenReturnIdentityis used),BulkMerge,BulkUpdate,BulkDelete, andBulkDeleteByKey. - DuckDbBulkAppender / DuckDbBulkAppenderColumnMappingCollection — a public wrapper around
DuckDBAppenderthat every bulk operation writes through internally; usable directly for custom bulk-write scenarios. - DuckDbBulkInsertMapItem — explicit source-to-destination column mapping for
BulkInsert/BulkMerge/BulkUpdate, with the destination type always resolved from the table’s own schema (no per-mapping type override). - DuckDbTraceKeys — the
traceKeyconstants for use with a custom ITrace. BulkMerge/BulkUpdate/BulkDelete/BulkDeleteByKeyalways stage through a pseudo (temporary, by default) table;BulkInsertwrites straight into the target table unlessidentityBehaviorisReturnIdentity.- Referenced the
RepoDbpackagev1.17.0-alpha2. - Referenced the
RepoDb.DuckDbpackagev0.0.1-alpha1. - References the
DuckDB.NET.Data.Fullpackagev1.5.5.
Known limitations (v1)
DuckDbBulkImportPseudoTableType.Auto’s row-count-based resolution is not implemented yet — it currently maps straight toMemoryon every call, regardless of row count.BulkMergewithReturnIdentitydoes not use a single atomicMERGE: it snapshots matched/unmatched rows with aLEFT JOIN(ordered by the pseudo table’srowid), issues a separateUPDATE ... FROMfor the matches, then a separate insert-onlyINSERT ... WHERE NOT EXISTS ... RETURNINGfor the unmatched rows — three round trips instead of one, and the classification can go stale if another connection modifies the target table between the snapshot and the follow-up statements.- 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 — DuckDbBulkImportIdentityBehavior defaults straight toKeepIdentity. - DuckDbBulkInsertMapItem carries no per-mapping database-type override, unlike some other providers’ mapping classes — the destination column’s type is always taken from the table’s own schema.