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

Function lockStore

packages/effect/src/eventlog/SqlEventLogServerEncrypted.ts:547–554  ·  view source on GitHub ↗
(scope: string)

Source from the content-addressed store, hash-verified

545 // Locks the store row for the rest of the transaction. Lock order is store
546 // row, then stage row, then snapshot rows.
547 const lockStore = (scope: string) =>
548 query(sql`SELECT ${storeColumns} FROM ${storesSql} ${lockHint} WHERE scope = ${scope} ${forUpdate}`).pipe(
549 Effect.flatMap(([row]) =>
550 row === undefined
551 ? Effect.die(new Cause.NoSuchElementError(`No compaction store row for scope ${scope}`))
552 : Effect.succeed(toStoreRow(row))
553 )
554 )
555
556 const stageColumns = sql.literal("id, scope, state, pinned, through_sequence, expires_at")
557 const selectStage = (scope: string, stageId: string, lock: boolean) =>

Callers 3

makeStorageFunction · 0.70
stagePartFunction · 0.70
pruneChunkFunction · 0.70

Calls 4

toStoreRowFunction · 0.85
queryFunction · 0.70
pipeMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected