Class PostgresDataChangeEvent
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
Changes
Gets the collection of column changes for this event.
public IReadOnlyList<PostgresDataChange> Changes { get; init; }
Property Value
CommitTime
Gets the commit timestamp of the transaction.
public DateTimeOffset CommitTime { get; init; }
Property Value
FullTableName
Gets the fully qualified table name (schema.table).
public string FullTableName { get; }
Property Value
KeyColumns
Gets the columns that identify the row (primary key or replica identity columns).
public IReadOnlyList<PostgresDataChange> KeyColumns { get; init; }
Property Value
Position
Gets the LSN (Log Sequence Number) position of this change.
public PostgresCdcPosition Position { get; init; }
Property Value
SchemaName
Gets the schema name of the affected table.
public string SchemaName { get; init; }
Property Value
TableName
Gets the name of the affected table.
public string TableName { get; init; }
Property Value
TransactionId
Gets the transaction ID that produced this change.
public uint TransactionId { get; init; }
Property Value
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
positionPostgresCdcPositionschemaNamestringtableNamestringtransactionIduintcommitTimeDateTimeOffsetkeyColumnsIReadOnlyList<PostgresDataChange>
Returns
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
positionPostgresCdcPositionschemaNamestringtableNamestringtransactionIduintcommitTimeDateTimeOffsetnewValuesIReadOnlyList<PostgresDataChange>
Returns
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
positionPostgresCdcPositionschemaNamestringtableNamestringtransactionIduintcommitTimeDateTimeOffset
Returns
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
positionPostgresCdcPositionschemaNamestringtableNamestringtransactionIduintcommitTimeDateTimeOffsetchangesIReadOnlyList<PostgresDataChange>keyColumnsIReadOnlyList<PostgresDataChange>