Skip to content

SchemaRegistry

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

Public API of any schema registry impl.

eventAdapter<E>(manifest): EventAdapter<E, unknown>

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

Build an EventAdapter that writes at the latest registered version of manifest and reads any registered version by chaining upcasters forward.

E

string

EventAdapter<E, unknown>


get(manifest, version): SchemaDescriptor | undefined

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

Look up the registration for (manifest, version), if any.

string

number

SchemaDescriptor | undefined


latestVersion(manifest): number | undefined

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

Highest registered version for manifest, or undefined if unknown.

string

number | undefined


list(): readonly SchemaDescriptor[]

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

Snapshot of every registration — primarily for debugging / introspection.

readonly SchemaDescriptor[]


register<Wire, Upcasted>(manifest, version, registration): void

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

Add or replace the registration for (manifest, version). Runs the configured compat check; throws on incompatibility. Re-registering the same (manifest, version) overwrites — the registry doesn’t enforce immutability, that’s an operator concern.

Wire = unknown

Upcasted = unknown

string

number

SchemaRegistration<Wire, Upcasted>

void


snapshotAdapter<S>(manifest): SnapshotAdapter<S, unknown>

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

Same as eventAdapter but typed for snapshot/state actors.

S

string

SnapshotAdapter<S, unknown>