ClickHouseBulkDbSetting

A setting class used to control mutation-wait blocking for the ClickHouse bulk operations.

This class extends ClickHouseDbSetting and implements IClickHouseBulkDbSetting with an IsWaitForMutationsEnabled property, consulted by BulkMerge/BulkUpdate/BulkDelete in RepoDb.ClickHouse.BulkOperations to decide whether to block until their ALTER TABLE mutation completes.

Unlike ClickHouseDbSetting, it is not registered automatically — ClickHouseBootstrap maps the base ClickHouseDbSetting by default. Register this class yourself only if you need mutation-wait blocking.

Properties

Name Description
IsWaitForMutationsEnabled Whether BulkMerge/BulkUpdate/BulkDelete block until their ALTER TABLE mutation completes. Defaults to true on this class, but has no effect unless this setting is registered in place of the plain ClickHouseDbSetting.
BulkColumnMappingsBehavior Gets or sets the ClickHouseBulkColumnMappingsBehavior value that defines how the columns of the source are aligned with the columns of the destination table when no explicit mappings were passed to a bulk operation. Explicit mappings always take precedence over this setting. The default value is Automatic.

The plain Update/UpdateAll/Delete/DeleteAll operations never consult this setting and always return as soon as their mutation is queued.

Usability

Pass an instance directly to UseClickHouse() in place of the default settings object.

GlobalConfiguration
    .Setup()
    .UseClickHouse(new ClickHouseBulkDbSetting { IsWaitForMutationsEnabled = true });

This requires RepoDb.ClickHouse.BulkOperations to be installed, since that’s where this class lives.

To opt into fail-fast column mapping validation for the bulk operations:

GlobalConfiguration
    .Setup()
    .UseClickHouse(new ClickHouseBulkDbSetting
    {
        BulkColumnMappingsBehavior = ClickHouseBulkColumnMappingsBehavior.Strict
    });