Interface: CompactionConfigBuilder
Defined in: postgres/src/builders/compaction-config-builder.ts:33
Fluent configurator for PostgreSQL ledger wire-frame compaction policies (.compactWhen($c => ...)).
Schedules raw wire-frame pruning for terminal runs based on correlated signals, terminal flow exit states, and failed-run retention windows.
Extends
Methods
onSignal()
onSignal<TSig>(signal, options): CompactionConfigBuilder;Defined in: postgres/src/builders/compaction-config-builder.ts:46
Registers a signal-driven compaction trigger correlated to a completed run's itemKey.
Schedules raw wire-frame pruning once signal arrives and options.afterGracePeriodHours elapses.
Type Parameters
| Type Parameter | Description |
|---|---|
TSig | Signal payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
signal | MaybeBuilder<SignalNode<TSig>> | Target signal AST node or builder. |
options | CompactionSignalTriggerOptions<TSig> | Correlation mapper and grace period in hours. |
Returns
CompactionConfigBuilder
Updated immutable compaction configuration builder.
onTerminalExit()
onTerminalExit(states, options): CompactionConfigBuilder;Defined in: postgres/src/builders/compaction-config-builder.ts:61
Registers a terminal exit state compaction trigger for completed runs.
Schedules raw wire-frame pruning once a run reaches one of states and options.afterGracePeriodHours elapses.
Parameters
| Parameter | Type | Description |
|---|---|---|
states | readonly string[] | Terminal flow exit states that arm compaction. |
options | CompactionTerminalExitOptions | Grace period in hours after terminal exit. |
Returns
CompactionConfigBuilder
Updated immutable compaction configuration builder.
retainFailedRunsForDays()
retainFailedRunsForDays(days): CompactionConfigBuilder;Defined in: postgres/src/builders/compaction-config-builder.ts:75
Sets the retention window in days for failed or exhausted runs before raw wire frames are pruned.
Preserves failed run wire frames for post-mortem debugging across days days.
Parameters
| Parameter | Type | Description |
|---|---|---|
days | number | Positive retention window in days. |
Returns
CompactionConfigBuilder
Updated immutable compaction configuration builder.
toAST()
toAST(): CompactionConfigNode;Defined in: core/dist/ast/ast-builder.d.ts:19
Compiles the current builder configuration into a deeply frozen passive AST node.
Validates required builder invariants at compilation time and returns an immutable plain-object AST representation containing zero execution methods.
Returns
Deeply frozen passive AST node.