ข้ามไปยังเนื้อหา

Class ClickHouseEventSourcingConfiguration

เนื้อหานี้ยังไม่ได้แปลเป็นภาษาไทย แสดงเป็นภาษาอังกฤษแทน

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

Holds the DDL template for bootstrapping the ClickHouse event-store table.

public static class ClickHouseEventSourcingConfiguration

objectClickHouseEventSourcingConfiguration

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

DDL template for creating the event streams table. The {0} placeholder must be substituted with the fully qualified table name.

public const string CreateTableSql = "\n CREATE TABLE IF NOT EXISTS {0} (\n stream_id String,\n stream_version Int64,\n event_type String,\n payload String,\n occurred_at_utc DateTime64(3, 'UTC'),\n appended_at_utc DateTime64(3, 'UTC')\n ) ENGINE = MergeTree()\n ORDER BY (stream_id, stream_version)"

string

The MergeTree engine is used for event streams because domain events are immutable — no deduplication or replacement is needed. The ORDER BY (stream_id, stream_version) clause makes per-stream range scans efficient and stores events in version order within each stream partition. Unlike ReplacingMergeTree, MergeTree does not merge duplicate rows — each appended event row is preserved permanently.