TdsCdc.Change (tds_cdc v0.1.0)

Copy Markdown

Represents a single change event captured from SQL Server CDC.

Each change contains the operation type, the row data after the change, and metadata about the change such as the LSN and transaction order.

Summary

Functions

Parses a raw CDC row from SQL Server into a %Change{} struct.

Types

operation()

@type operation() :: :insert | :update | :delete

t()

@type t() :: %TdsCdc.Change{
  capture_instance: String.t(),
  commit_lsn: String.t() | nil,
  data: map(),
  lsn: String.t(),
  lsn_prev: String.t() | nil,
  operation: operation(),
  seqval: String.t(),
  transaction_order: non_neg_integer() | nil
}

Functions

from_row(capture_instance, row)

@spec from_row(String.t(), map()) :: t()

Parses a raw CDC row from SQL Server into a %Change{} struct.

Expects a map with string keys as returned by Tds queries, including the standard CDC columns: __$operation, __$start_lsn, __$seqval, __$update_mask, and the tracked table columns.