Skip to main content
Version: 1.3.0

Function: createSchemaRegistry()

createSchemaRegistry(options?): SchemaRegistry

Defined in: src/Mnemonic/schema-registry.ts:41

Create an immutable schema registry for common default/strict-mode setups.

The helper indexes schemas and migrations up front, validates duplicate and ambiguous definitions, and returns a SchemaRegistry ready to pass to MnemonicProvider.

Most applications should prefer this helper over manually implementing SchemaRegistry.

See the Schema Migration guide for end-to-end registry and migration patterns.

Parameters

ParameterTypeDescription
optionsCreateSchemaRegistryOptionsInitial schema and migration definitions

Returns

SchemaRegistry

An indexed immutable schema registry

Throws

With SCHEMA_REGISTRATION_CONFLICT for duplicate schemas, or MIGRATION_GRAPH_INVALID for invalid migration graphs