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

Function toStoreRow

packages/effect/src/eventlog/SqlEventLogServerEncrypted.ts:1440–1453  ·  view source on GitHub ↗
(row: Record<string, unknown>)

Source from the content-addressed store, hash-verified

1438const optionalString = (value: unknown) => value === null || value === undefined ? undefined : String(value)
1439
1440const toStoreRow = (row: Record<string, unknown>) => ({
1441 nextSequence: Number(row.next_sequence),
1442 activeActivation: String(row.active_activation),
1443 activeBatchSet: optionalString(row.active_batch_set),
1444 base: Number(row.base_sequence),
1445 activeKeptCount: Number(row.active_kept_count),
1446 noOpAt: optionalNumber(row.no_op_at),
1447 noOpCount: Number(row.no_op_count),
1448 openStage: optionalString(row.open_stage),
1449 nextSweepAt: optionalNumber(row.next_sweep_at),
1450 sweepLeaseUntil: optionalNumber(row.sweep_lease_until),
1451 sweepLeaseOwner: optionalString(row.sweep_lease_owner),
1452 prunedThrough: Number(row.pruned_through)
1453})
1454
1455const toStageRow = (row: Record<string, unknown>) => ({
1456 id: String(row.id),

Callers 2

selectStoreFunction · 0.85
lockStoreFunction · 0.85

Calls 4

optionalNumberFunction · 0.85
optionalStringFunction · 0.70
NumberFunction · 0.50
StringFunction · 0.50

Tested by

no test coverage detected