Table of Contents

Class PostgresProjectionStoreOptions

Namespace
Excalibur.EventSourcing.Postgres
Assembly
Excalibur.EventSourcing.Postgres.dll

Configuration options for the Postgres projection store.

public sealed class PostgresProjectionStoreOptions
Inheritance
PostgresProjectionStoreOptions
Inherited Members

Remarks

Supports connection string, Npgsql.NpgsqlDataSource, or DI-resolved data source patterns. The projection store uses JSONB for efficient JSON querying with Postgres-native operators.

Properties

ConnectionString

Gets or sets the Postgres connection string.

[Required]
public string? ConnectionString { get; set; }

Property Value

string

DestinationKind

Gets or sets which apply path owns this destination.

public ProjectionDestinationKind? DestinationKind { get; set; }

Property Value

ProjectionDestinationKind?

null by default, meaning NOT STATED -- the kind is then derived from the projection's registered mode, and falls back to Positioned only when nothing is registered. Set it explicitly to override the derivation; an explicit value always wins.

Remarks

NULLABLE DELIBERATELY. A non-nullable value here could not distinguish "the consumer chose Positioned" from "nobody said", so every producer was forced to assert something it had not been told -- and the apply path was then declarable twice, here and on the projection's mode, with nothing reconciling the two. The third state is what lets the mode be the single declaration.

JsonSerializerOptions

Gets or sets the JSON serializer options for projection data.

public JsonSerializerOptions? JsonSerializerOptions { get; set; }

Property Value

JsonSerializerOptions

Remarks

When null, defaults to camelCase naming with no indentation.

SchemaName

Gets or sets the schema holding the projection table.

public string SchemaName { get; set; }

Property Value

string

The schema name. Defaults to public.

Remarks

Honoured by every statement the store runs, which is the only form of this setting worth having. The store previously addressed the table unqualified, so it resolved through the connection's search_path — a setting the store neither configured nor read, which made two deployments with the same table name under different search paths address different tables while being indistinguishable to this framework.

Case is significant. The store quotes both identifiers, and Postgres preserves the case inside double quotes, so public and Public name two different schemas. The value is used exactly as written: only letters, digits and underscores are accepted.

TableName

Gets or sets the table name for projections.

public string? TableName { get; set; }

Property Value

string

Remarks

When null, defaults to the projection type name converted to snake_case.

Methods

Validate()

Validates the options and throws if invalid.

public void Validate()

Exceptions

InvalidOperationException

Thrown when required options are missing.