Skip to content

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() ​

ts
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 ParameterDescription
TSigSignal payload type.

Parameters ​

ParameterTypeDescription
signalMaybeBuilder<SignalNode<TSig>>Target signal AST node or builder.
optionsCompactionSignalTriggerOptions<TSig>Correlation mapper and grace period in hours.

Returns ​

CompactionConfigBuilder

Updated immutable compaction configuration builder.


onTerminalExit() ​

ts
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 ​

ParameterTypeDescription
statesreadonly string[]Terminal flow exit states that arm compaction.
optionsCompactionTerminalExitOptionsGrace period in hours after terminal exit.

Returns ​

CompactionConfigBuilder

Updated immutable compaction configuration builder.


retainFailedRunsForDays() ​

ts
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 ​

ParameterTypeDescription
daysnumberPositive retention window in days.

Returns ​

CompactionConfigBuilder

Updated immutable compaction configuration builder.


toAST() ​

ts
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 ​

CompactionConfigNode

Deeply frozen passive AST node.

Inherited from ​

AstBuilder.toAST

Released under the MIT License.