Skip to content

SchemaRegistration

Defined in: src/persistence/migration/SchemaRegistry.ts:60

What a single registered version contributes to the registry.

Wire = unknown

Upcasted = unknown

readonly codec: Codec<Wire>

Defined in: src/persistence/migration/SchemaRegistry.ts:62

Codec used to validate / shape payloads at this version.


readonly optional compatibility?: "none" | "backward" | "sample"

Defined in: src/persistence/migration/SchemaRegistry.ts:70

Compatibility-check mode applied at register time. Default 'none'.


readonly optional sample?: unknown

Defined in: src/persistence/migration/SchemaRegistry.ts:76

Optional sample value used by 'sample' compat checks — passed through the previous version’s encode → decode → upcast → this version’s encode round-trip. Throws if any step fails.


readonly optional upcastFromPrev?: (prev) => Upcasted

Defined in: src/persistence/migration/SchemaRegistry.ts:68

Pure function prevVersionDomain → thisVersionDomain used on the read path to bring data forward. Required for any version

1 if reads from older data are expected to succeed.

unknown

Upcasted