Skip to content

Class ClickHouseEventSourcingServiceCollectionExtensions

Namespace: Cephalon.EventSourcing.ClickHouse.Hosting
Assembly: Cephalon.EventSourcing.ClickHouse.dll

Registers the ClickHouse event-store provider used by Cephalon hosts.

public static class ClickHouseEventSourcingServiceCollectionExtensions

objectClickHouseEventSourcingServiceCollectionExtensions

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

AddCephalonClickHouseEventSourcing(IServiceCollection, string, string, string, string, string)

Section titled “ AddCephalonClickHouseEventSourcing(IServiceCollection, string, string, string, string, string)”

Adds the ClickHouse event-store provider to the service collection.

public static IServiceCollection AddCephalonClickHouseEventSourcing(this IServiceCollection services, string host, string database, string tableName = "cephalon_event_streams", string username = "default", string password = "")

services IServiceCollection

The service collection to extend.

host string

The ClickHouse host address (e.g. “localhost”).

database string

The ClickHouse database that contains the event-streams table.

tableName string

The ClickHouse table name used for event stream rows. Defaults to cephalon_event_streams.

username string

The ClickHouse username. Defaults to “default”.

password string

The ClickHouse password. Defaults to empty.

IServiceCollection

The same service collection for fluent registration.

is registered using TryAdd semantics — a host that already registered a shared keeps its own instance.

Connection behaviour: A new ClickHouseConnection is created per operation. No long-lived connection object is held. Service resolution is safe without a live ClickHouse server — connections are only opened when operations are actually invoked.