Table of Contents

Class PostgresDataChangeEvent

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

Represents a data change event captured from Postgres logical replication.

public sealed class PostgresDataChangeEvent
Inheritance
PostgresDataChangeEvent
Inherited Members

Properties

ChangeType

Gets the type of change (Insert, Update, Delete, Truncate).

public PostgresDataChangeType ChangeType { get; init; }

Property Value

PostgresDataChangeType

Changes

Gets the collection of column changes for this event.

public IReadOnlyList<PostgresDataChange> Changes { get; init; }

Property Value

IReadOnlyList<PostgresDataChange>

CommitTime

Gets the commit timestamp of the transaction.

public DateTimeOffset CommitTime { get; init; }

Property Value

DateTimeOffset

FullTableName

Gets the fully qualified table name (schema.table).

public string FullTableName { get; }

Property Value

string

KeyColumns

Gets the columns that identify the row (primary key or replica identity columns).

public IReadOnlyList<PostgresDataChange> KeyColumns { get; init; }

Property Value

IReadOnlyList<PostgresDataChange>

Position

Gets the LSN (Log Sequence Number) position of this change.

public PostgresCdcPosition Position { get; init; }

Property Value

PostgresCdcPosition

SchemaName

Gets the schema name of the affected table.

public string SchemaName { get; init; }

Property Value

string

TableName

Gets the name of the affected table.

public string TableName { get; init; }

Property Value

string

TransactionId

Gets the transaction ID that produced this change.

public uint TransactionId { get; init; }

Property Value

uint

Methods

CreateDelete(PostgresCdcPosition, string, string, uint, DateTimeOffset, IReadOnlyList<PostgresDataChange>)

Creates a new instance for a delete operation.

public static PostgresDataChangeEvent CreateDelete(PostgresCdcPosition position, string schemaName, string tableName, uint transactionId, DateTimeOffset commitTime, IReadOnlyList<PostgresDataChange> keyColumns)

Parameters

position PostgresCdcPosition
schemaName string
tableName string
transactionId uint
commitTime DateTimeOffset
keyColumns IReadOnlyList<PostgresDataChange>

Returns

PostgresDataChangeEvent

CreateInsert(PostgresCdcPosition, string, string, uint, DateTimeOffset, IReadOnlyList<PostgresDataChange>)

Creates a new instance for an insert operation.

public static PostgresDataChangeEvent CreateInsert(PostgresCdcPosition position, string schemaName, string tableName, uint transactionId, DateTimeOffset commitTime, IReadOnlyList<PostgresDataChange> newValues)

Parameters

position PostgresCdcPosition
schemaName string
tableName string
transactionId uint
commitTime DateTimeOffset
newValues IReadOnlyList<PostgresDataChange>

Returns

PostgresDataChangeEvent

CreateTruncate(PostgresCdcPosition, string, string, uint, DateTimeOffset)

Creates a new instance for a truncate operation.

public static PostgresDataChangeEvent CreateTruncate(PostgresCdcPosition position, string schemaName, string tableName, uint transactionId, DateTimeOffset commitTime)

Parameters

position PostgresCdcPosition
schemaName string
tableName string
transactionId uint
commitTime DateTimeOffset

Returns

PostgresDataChangeEvent

CreateUpdate(PostgresCdcPosition, string, string, uint, DateTimeOffset, IReadOnlyList<PostgresDataChange>, IReadOnlyList<PostgresDataChange>)

Creates a new instance for an update operation.

public static PostgresDataChangeEvent CreateUpdate(PostgresCdcPosition position, string schemaName, string tableName, uint transactionId, DateTimeOffset commitTime, IReadOnlyList<PostgresDataChange> changes, IReadOnlyList<PostgresDataChange> keyColumns)

Parameters

position PostgresCdcPosition
schemaName string
tableName string
transactionId uint
commitTime DateTimeOffset
changes IReadOnlyList<PostgresDataChange>
keyColumns IReadOnlyList<PostgresDataChange>

Returns

PostgresDataChangeEvent