MCPcopy Create free account
hub / github.com/Effect-TS/effect / pgLocks

Function pgLocks

packages/effect/src/unstable/cluster/SqlRunnerStorage.ts:562–566  ·  view source on GitHub ↗
(shardIdsMap: Map<number, string>)

Source from the content-addressed store, hash-verified

560 }
561
562 const pgLocks = (shardIdsMap: Map<number, string>) =>
563 Array.from(
564 shardIdsMap.entries(),
565 ([lockNum, shardId]) => `pg_try_advisory_lock(${pgLockNamespace}, ${lockNum}) AS "${shardId}"`
566 ).join(", ")
567
568 const mysqlLocks = (shardIds: ReadonlyArray<string>) =>
569 shardIds.map((shardId) => `GET_LOCK('${lockNames.get(shardId)!}', 0) AS "${shardId}"`).join(", ")

Callers 1

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected