Interface IPostgresCdcConnectionBuilder
Defines the contract for configuring Postgres CDC source and state store connections.
public interface IPostgresCdcConnectionBuilder
- Extension Methods
Methods
BindConfiguration(string)
Binds Postgres CDC source options from an IConfiguration section.
IPostgresCdcBuilder BindConfiguration(string sectionPath)
Parameters
sectionPathstringThe configuration section path (e.g., "Cdc:Source").
Returns
- IPostgresCdcBuilder
The builder for fluent chaining.
Exceptions
- ArgumentException
Thrown when
sectionPathis null or whitespace.
ConnectionFactory(Func<IServiceProvider, Func<NpgsqlConnection>>)
Sets a factory function that creates Postgres connections for the CDC source database.
IPostgresCdcBuilder ConnectionFactory(Func<IServiceProvider, Func<NpgsqlConnection>> connectionFactory)
Parameters
connectionFactoryFunc<IServiceProvider, Func<NpgsqlConnection>>A factory function that creates Postgres connections.
Returns
- IPostgresCdcBuilder
The builder for fluent chaining.
Exceptions
- ArgumentNullException
Thrown when
connectionFactoryis null.
ConnectionString(string)
Sets the connection string for the Postgres CDC source database.
IPostgresCdcBuilder ConnectionString(string connectionString)
Parameters
connectionStringstringThe Postgres connection string.
Returns
- IPostgresCdcBuilder
The builder for fluent chaining.
Exceptions
- ArgumentException
Thrown when
connectionStringis null or whitespace.
ConnectionStringName(string)
Resolves the source connection string from IConfiguration.GetConnectionString(name)
at registration time.
IPostgresCdcBuilder ConnectionStringName(string name)
Parameters
namestringThe connection string name in the
ConnectionStringssection.
Returns
- IPostgresCdcBuilder
The builder for fluent chaining.
Exceptions
- ArgumentException
Thrown when
nameis null or whitespace.
DataSource(NpgsqlDataSource)
Sets a pre-configured Npgsql.NpgsqlDataSource for the CDC source database.
Connections are created via dataSource.CreateConnection().
IPostgresCdcBuilder DataSource(NpgsqlDataSource dataSource)
Parameters
dataSourceNpgsqlDataSourceThe Npgsql data source.
Returns
- IPostgresCdcBuilder
The builder for fluent chaining.
Exceptions
- ArgumentNullException
Thrown when
dataSourceis null.
DataSourceFactory(Func<IServiceProvider, NpgsqlDataSource>)
Sets a factory function that creates an Npgsql.NpgsqlDataSource for the CDC source database.
IPostgresCdcBuilder DataSourceFactory(Func<IServiceProvider, NpgsqlDataSource> dataSourceFactory)
Parameters
dataSourceFactoryFunc<IServiceProvider, NpgsqlDataSource>A factory receiving IServiceProvider and returning an Npgsql.NpgsqlDataSource.
Returns
- IPostgresCdcBuilder
The builder for fluent chaining.
Exceptions
- ArgumentNullException
Thrown when
dataSourceFactoryis null.
WithStateStore(Action<ICdcRelationalStateStoreBuilder>)
Configures a separate connection for CDC state persistence.
IPostgresCdcBuilder WithStateStore(Action<ICdcRelationalStateStoreBuilder> configure)
Parameters
configureAction<ICdcRelationalStateStoreBuilder>An action to configure state store connection, schema, and table settings.
Returns
- IPostgresCdcBuilder
The builder for fluent chaining.
Exceptions
- ArgumentNullException
Thrown when
configureis null.