Class SqlServerProjectionStoreOptions
- Namespace
- Excalibur.EventSourcing.SqlServer
- Assembly
- Excalibur.EventSourcing.SqlServer.dll
Configuration options for the SQL Server projection store.
public sealed class SqlServerProjectionStoreOptions
- Inheritance
-
SqlServerProjectionStoreOptions
- Inherited Members
Remarks
Supports connection string or connection factory patterns. The projection store uses JSON serialization for projection data with MERGE for upserts.
Properties
ConnectionString
Gets or sets the SQL Server connection string.
[Required]
public string? ConnectionString { get; set; }
Property Value
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
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
dbo.
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 default schema — and a consumer who created the table in a named schema got a table the store could not find, with no error until the first read. A schema setting the data access does not use is worse than none, because it reads as supported.
TableName
Gets or sets the table name for projections.
public string? TableName { get; set; }
Property Value
Remarks
When null, defaults to the projection type name.
Methods
Validate()
Validates the options and throws if invalid.
public void Validate()
Exceptions
- InvalidOperationException
Thrown when required options are missing.