Interface ICdcRelationalStateStoreBuilder
Extends ICdcStateStoreBuilder with relational-specific settings (schema name, connection string) for SQL Server and Postgres CDC state stores.
public interface ICdcRelationalStateStoreBuilder : ICdcStateStoreBuilder
Examples
cdc.UseSqlServer(sql =>
{
sql.ConnectionString(sourceConnectionString)
.WithStateStore(state =>
{
state.ConnectionString(stateConnectionString)
.SchemaName("dbo")
.TableName("CdcProcessingState");
});
});
Remarks
Non-relational providers (DynamoDB, Firestore, CosmosDB, MongoDB) use ICdcStateStoreBuilder directly and do not implement these methods.
Methods
BindConfiguration(string)
Binds state store options from an IConfiguration section, narrowing the inherited return type so relational-only members remain chainable after this call.
ICdcRelationalStateStoreBuilder BindConfiguration(string sectionPath)
Parameters
sectionPathstringThe configuration section path.
Returns
- ICdcRelationalStateStoreBuilder
The builder for fluent chaining, typed as ICdcRelationalStateStoreBuilder.
ConnectionString(string)
Sets the state store connection string directly.
ICdcRelationalStateStoreBuilder ConnectionString(string connectionString)
Parameters
connectionStringstringThe state store connection string.
Returns
- ICdcRelationalStateStoreBuilder
The builder for fluent chaining.
Exceptions
- ArgumentException
Thrown when
connectionStringis null or whitespace.
ConnectionStringName(string)
Resolves the state store connection string from IConfiguration.GetConnectionString(name)
at DI resolution time.
ICdcRelationalStateStoreBuilder ConnectionStringName(string name)
Parameters
namestringThe connection string name in the
ConnectionStringssection.
Returns
- ICdcRelationalStateStoreBuilder
The builder for fluent chaining.
Exceptions
- ArgumentException
Thrown when
nameis null or whitespace.
SchemaName(string)
Sets the database schema for the CDC checkpoint table.
ICdcRelationalStateStoreBuilder SchemaName(string schema)
Parameters
schemastringThe schema name.
Returns
- ICdcRelationalStateStoreBuilder
The builder for fluent chaining.
Exceptions
- ArgumentException
Thrown when
schemais null or whitespace.
TableName(string)
Sets the table name for CDC checkpoint persistence, narrowing the inherited return type from ICdcStateStoreBuilder so relational-only members (e.g. ConnectionString(string), SchemaName(string)) remain chainable after this call.
ICdcRelationalStateStoreBuilder TableName(string tableName)
Parameters
tableNamestringThe table name.
Returns
- ICdcRelationalStateStoreBuilder
The builder for fluent chaining, typed as ICdcRelationalStateStoreBuilder.