Table of Contents

Struct PostgresCdcPosition

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

Represents a position in the Postgres Write-Ahead Log (WAL) for CDC tracking.

public readonly struct PostgresCdcPosition : IEquatable<PostgresCdcPosition>, IComparable<PostgresCdcPosition>
Implements
Inherited Members

Constructors

PostgresCdcPosition(NpgsqlLogSequenceNumber)

Initializes a new instance of the PostgresCdcPosition struct.

public PostgresCdcPosition(NpgsqlLogSequenceNumber lsn)

Parameters

lsn NpgsqlLogSequenceNumber

PostgresCdcPosition(string)

Initializes a new instance of the PostgresCdcPosition struct from an LSN string.

public PostgresCdcPosition(string lsnString)

Parameters

lsnString string

PostgresCdcPosition(ulong)

Initializes a new instance of the PostgresCdcPosition struct from a 64-bit value.

public PostgresCdcPosition(ulong lsnValue)

Parameters

lsnValue ulong

Fields

Start

Represents the start of the WAL (position 0/0).

public static readonly PostgresCdcPosition Start

Field Value

PostgresCdcPosition

Properties

IsValid

Gets a value indicating whether this position is valid.

public bool IsValid { get; }

Property Value

bool

Lsn

Gets the underlying Npgsql log sequence number.

public NpgsqlLogSequenceNumber Lsn { get; }

Property Value

NpgsqlLogSequenceNumber

LsnString

Gets the LSN as a string in the format "X/XXXXXXXX".

public string LsnString { get; }

Property Value

string

LsnValue

Gets the LSN as a 64-bit unsigned integer.

public ulong LsnValue { get; }

Property Value

ulong

Methods

CompareTo(PostgresCdcPosition)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

public int CompareTo(PostgresCdcPosition other)

Parameters

other PostgresCdcPosition

An object to compare with this instance.

Returns

int

A value that indicates the relative order of the objects being compared. The return value has these meanings:

Value Meaning
Less than zero This instance precedes other in the sort order.
Zero This instance occurs in the same position in the sort order as other.
Greater than zero This instance follows other in the sort order.

Equals(PostgresCdcPosition)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(PostgresCdcPosition other)

Parameters

other PostgresCdcPosition

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current instance.

Returns

bool

true if obj and this instance are the same type and represent the same value; otherwise, false.

FromChangePosition(ChangePosition?)

public static PostgresCdcPosition FromChangePosition(ChangePosition? position)

Parameters

position ChangePosition

Returns

PostgresCdcPosition

GetHashCode()

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int

A 32-bit signed integer that is the hash code for this instance.

Parse(string)

Parses an LSN string to a PostgresCdcPosition.

public static PostgresCdcPosition Parse(string lsnString)

Parameters

lsnString string

Returns

PostgresCdcPosition

ToChangePosition()

Converts this position to a ChangePosition.

public ChangePosition ToChangePosition()

Returns

ChangePosition

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

TryParse(string?, out PostgresCdcPosition)

Tries to parse an LSN string to a PostgresCdcPosition.

public static bool TryParse(string? lsnString, out PostgresCdcPosition position)

Parameters

lsnString string
position PostgresCdcPosition

Returns

bool

Operators

operator ==(PostgresCdcPosition, PostgresCdcPosition)

Determines whether two positions are equal.

public static bool operator ==(PostgresCdcPosition left, PostgresCdcPosition right)

Parameters

left PostgresCdcPosition
right PostgresCdcPosition

Returns

bool

operator >(PostgresCdcPosition, PostgresCdcPosition)

Determines whether the left position is greater than the right position.

public static bool operator >(PostgresCdcPosition left, PostgresCdcPosition right)

Parameters

left PostgresCdcPosition
right PostgresCdcPosition

Returns

bool

operator >=(PostgresCdcPosition, PostgresCdcPosition)

Determines whether the left position is greater than or equal to the right position.

public static bool operator >=(PostgresCdcPosition left, PostgresCdcPosition right)

Parameters

left PostgresCdcPosition
right PostgresCdcPosition

Returns

bool

operator !=(PostgresCdcPosition, PostgresCdcPosition)

Determines whether two positions are not equal.

public static bool operator !=(PostgresCdcPosition left, PostgresCdcPosition right)

Parameters

left PostgresCdcPosition
right PostgresCdcPosition

Returns

bool

operator <(PostgresCdcPosition, PostgresCdcPosition)

Determines whether the left position is less than the right position.

public static bool operator <(PostgresCdcPosition left, PostgresCdcPosition right)

Parameters

left PostgresCdcPosition
right PostgresCdcPosition

Returns

bool

operator <=(PostgresCdcPosition, PostgresCdcPosition)

Determines whether the left position is less than or equal to the right position.

public static bool operator <=(PostgresCdcPosition left, PostgresCdcPosition right)

Parameters

left PostgresCdcPosition
right PostgresCdcPosition

Returns

bool