pub struct PkTuple(pub Vec<Value>);Expand description
An ordered tuple of primary key values.
The values are ordered to match the corresponding TableSpec::pk_columns
so single and composite primary keys are handled uniformly.
Tuple Fields§
§0: Vec<Value>Implementations§
Source§impl PkTuple
impl PkTuple
Sourcepub fn key(&self) -> String
pub fn key(&self) -> String
A stable string key for this primary key, suitable for use as a hash
map key (works for composite keys and value kinds that are not
themselves Hash/Eq).
Values are canonicalized before serialization so snapshot reads and CDC
events that differ only by integer width (Int32 vs Int64) or string
kind (VarChar vs Text) still collide for window dedup.
Sourcepub fn single_uuid(&self) -> Option<Uuid>
pub fn single_uuid(&self) -> Option<Uuid>
If this is a single-column UUID key, return the UUID.
The framework writes watermarks as rows keyed by a freshly generated UUID and recognizes those rows in the change stream via this helper.
Sourcepub fn from_row(row: &Row, pk_columns: &[String]) -> Result<Self>
pub fn from_row(row: &Row, pk_columns: &[String]) -> Result<Self>
Extract the primary key tuple from a row given the table’s primary key columns.
Each column is looked up in the row’s fields. As a convenience for
single-column primary keys, a missing field falls back to the row’s
dedicated id value. Extracted values are canonicalized so they match
Self::key used for window dedup.