Skip to content

Function: advisoryLockId()

advisoryLockId(key): bigint

Convert an arbitrary structured key into PostgreSQL’s signed 64-bit advisory lock namespace. A bigint is preserved directly so callers can interoperate with another implementation that publishes its lock ID.

Everything else is canonicalized with object.toStableKey and hashed, so key order in an object does not matter while a 1 and a "1" stay different locks. A cycle, a non-finite number, or a function/symbol key throws TypeError rather than yielding an identity two callers could disagree about.

unknown

bigint