Skip to content

Function: packRegionVersion()

packRegionVersion(region, localVersion): bigint

Defined in: core/src/protocol/causal-cookie.ts:85

Pack (region, localVersion) into a single monotonic bigint. Server-side SQL still uses row_version as a scalar within a region; the causal layer lives at the protocol boundary.

Layout: top 16 bits = region, low 48 bits = localVersion. Bigint math keeps callers safe for local versions > 2^53.

number

bigint

bigint