ObjectStackObjectStack

Metadata Loader

Metadata Loader protocol schemas

Metadata Manager Configuration

How the runtime MetadataManager is wired: which datasource backs sys_metadata, what to fall back to when that datasource is unreachable, cache / watch / validation settings, and the persistence write gates.

The loader and watch envelope types (MetadataFormat, MetadataStats, MetadataLoadOptions, MetadataWatchEvent, MetadataLoaderContract, …) are NOT here — they live in @objectstack/spec/system (system/metadata-persistence.zod), which is their single source.

Source: packages/spec/src/kernel/metadata-loader.zod.ts

TypeScript Usage

import { MetadataFallbackStrategySchema, MetadataManagerConfigSchema } from '@objectstack/spec/kernel';
import type { MetadataFallbackStrategy, MetadataManagerConfig } from '@objectstack/spec/kernel';

// Validate data
const result = MetadataFallbackStrategySchema.parse(data);

MetadataFallbackStrategy

Allowed Values

  • filesystem
  • memory
  • none

MetadataManagerConfig

Properties

PropertyTypeRequiredDescription
datasourcestringoptionalDatasource name reference for database persistence
tableNamestringDatabase table name for metadata storage
fallbackEnum<'filesystem' | 'memory' | 'none'>Fallback strategy when datasource is unavailable
rootDirstringoptionalRoot directory path
formatsEnum<'yaml' | 'json' | 'typescript' | 'javascript'>[]Enabled formats
cache{ enabled: boolean; ttl: integer; maxSize?: integer; databaseLoader?: object }optionalCache settings
watchbooleanEnable file watching
watchOptions{ ignored?: string[]; persistent: boolean; ignoreInitial: boolean }optionalFile watcher options
validation{ strict: boolean; throwOnError: boolean }optionalValidation settings
loaderOptionsRecord<string, any>optionalLoader-specific configuration
persistence{ writable: boolean; overlayWritable: boolean }optionalPersistence write gates

On this page