Table of Contents

Interface IPostgresCdcConnectionBuilder

Namespace
Excalibur.Cdc.Postgres
Assembly
Excalibur.Cdc.Postgres.dll

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

sectionPath string

The configuration section path (e.g., "Cdc:Source").

Returns

IPostgresCdcBuilder

The builder for fluent chaining.

Exceptions

ArgumentException

Thrown when sectionPath is 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

connectionFactory Func<IServiceProvider, Func<NpgsqlConnection>>

A factory function that creates Postgres connections.

Returns

IPostgresCdcBuilder

The builder for fluent chaining.

Exceptions

ArgumentNullException

Thrown when connectionFactory is null.

ConnectionString(string)

Sets the connection string for the Postgres CDC source database.

IPostgresCdcBuilder ConnectionString(string connectionString)

Parameters

connectionString string

The Postgres connection string.

Returns

IPostgresCdcBuilder

The builder for fluent chaining.

Exceptions

ArgumentException

Thrown when connectionString is null or whitespace.

ConnectionStringName(string)

Resolves the source connection string from IConfiguration.GetConnectionString(name) at registration time.

IPostgresCdcBuilder ConnectionStringName(string name)

Parameters

name string

The connection string name in the ConnectionStrings section.

Returns

IPostgresCdcBuilder

The builder for fluent chaining.

Exceptions

ArgumentException

Thrown when name is 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

dataSource NpgsqlDataSource

The Npgsql data source.

Returns

IPostgresCdcBuilder

The builder for fluent chaining.

Exceptions

ArgumentNullException

Thrown when dataSource is 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

dataSourceFactory Func<IServiceProvider, NpgsqlDataSource>

A factory receiving IServiceProvider and returning an Npgsql.NpgsqlDataSource.

Returns

IPostgresCdcBuilder

The builder for fluent chaining.

Exceptions

ArgumentNullException

Thrown when dataSourceFactory is null.

WithStateStore(Action<ICdcRelationalStateStoreBuilder>)

Configures a separate connection for CDC state persistence.

IPostgresCdcBuilder WithStateStore(Action<ICdcRelationalStateStoreBuilder> configure)

Parameters

configure Action<ICdcRelationalStateStoreBuilder>

An action to configure state store connection, schema, and table settings.

Returns

IPostgresCdcBuilder

The builder for fluent chaining.

Exceptions

ArgumentNullException

Thrown when configure is null.