(scope: string)
| 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) => |
no test coverage detected