Link Search Menu Expand Document

Releases for RepoDb.ClickHouse.BulkOperations


View the NuGet package here or download it directly here.

RepoDb.ClickHouse.BulkOperations - Preview

Released: TBA

New

First release of the bulk operations extension for RepoDb.ClickHouse, providing BulkInsert, BulkMerge, BulkUpdate, BulkDelete, and BulkDeleteByKey, each with an Async overload, callable against a ClickHouseConnection, a table name, or a DataTable. #1242

What’s included

  • BulkInsert, BulkMerge, BulkUpdate, BulkDelete, and BulkDeleteByKey — matched by qualifiers or primary key; see Operations (ClickHouse) for the full SQL generated by each.
  • An internal ClickHouseBulkCopy class, adapting ClickHouse.Driver’s own native Copy.ClickHouseBulkCopy to the ColumnMappings-based API the rest of the library expects.
  • ClickHouseBulkImportIdentityBehavior (KeepIdentity default; ReturnIdentity always throws NotSupportedException, since ClickHouse has no identity/scope-identity mechanism).
  • ClickHouseBulkImportPseudoTableType (Auto, Memory, Physical) — selects the staging-table strategy backing BulkMerge/BulkUpdate/BulkDelete/BulkDeleteByKey. BulkInsert never uses a pseudo table.
  • ClickHouseBulkInsertMapItem — explicit source-to-destination column mapping for BulkInsert/BulkMerge/BulkUpdate, with an optional explicit ClickHouse type name override.
  • Referenced the RepoDb package.
  • Referenced the RepoDb.ClickHouse package.
  • Referenced the ClickHouse.Driver package v1.3.0.

Known limitations (v1)

  • ClickHouseBulkImportPseudoTableType.Auto and Memory both currently resolve to Physical regardless of row count — the internal resolution logic returns Physical on every outcome, so the session-private Memory-engine staging path is implemented but not yet exercised.
  • BulkMerge, BulkUpdate, BulkDelete and BulkDeleteByKey report the number of rows staged into the pseudo table, not a confirmed post-mutation count — ALTER TABLE ... UPDATE/DELETE are asynchronous mutations, and neither they nor a plain INSERT report a reliable affected-row figure through ClickHouse.Driver.
  • Every bulk call against BulkMerge/BulkUpdate/BulkDelete/BulkDeleteByKey creates its own physical staging table (DROP TABLE IF EXISTS + CREATE TABLE ... ENGINE = MergeTree ORDER BY tuple() AS SELECT ... WHERE (1 = 0)) and drops it once the call completes, rather than reusing one across calls.
  • BulkInsert/BulkMerge never return generated identity values — identityBehavior: ReturnIdentity always throws NotSupportedException.