Skip to content

SchemaDescriptor

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

What a single registered version contributes to the registry.

readonly codec: Codec<unknown>

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

Codec used to validate / shape payloads at this version.

SchemaRegistration.codec


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

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

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

SchemaRegistration.compatibility


readonly manifest: string

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


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.

SchemaRegistration.sample


readonly optional upcastFromPrev?: (prev) => unknown

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

unknown

SchemaRegistration.upcastFromPrev


readonly version: number

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