Expand description
Shared primary key hashing and formatting utilities.
This module is the single home for compact 64-bit hash representations of
primary keys and for human-readable PK formatting, used by both the
validate and diff commands for memory-efficient PK tracking. Keeping
one implementation matters: these hashes are compared across modules, so
divergent copies would silently break PK/FK and row comparisons.
Functions§
- format_
pk_ tuple - Format a PK tuple as a string (single value as-is, composite as “(val1, val2)”).
- format_
single_ pk - Format a single PK value as a string.
- hash_
pk_ value_ into - Feed a single PK/FK value into
hasher, tag-discriminated so that e.g.Int(1)andText("1")hash differently. - hash_
pk_ values - Hash a list of PK/FK values into a compact 64-bit hash. Uses AHash for fast, high-quality hashing.
Type Aliases§
- PkHash
- Compact primary key hash (64-bit). Collision risk is negligible for realistic dump sizes.