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
filesystemmemorynone
MetadataManagerConfig
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| datasource | string | optional | Datasource name reference for database persistence |
| tableName | string | ✅ | Database table name for metadata storage |
| fallback | Enum<'filesystem' | 'memory' | 'none'> | ✅ | Fallback strategy when datasource is unavailable |
| rootDir | string | optional | Root directory path |
| formats | Enum<'yaml' | 'json' | 'typescript' | 'javascript'>[] | ✅ | Enabled formats |
| cache | { enabled: boolean; ttl: integer; maxSize?: integer; databaseLoader?: object } | optional | Cache settings |
| watch | boolean | ✅ | Enable file watching |
| watchOptions | { ignored?: string[]; persistent: boolean; ignoreInitial: boolean } | optional | File watcher options |
| validation | { strict: boolean; throwOnError: boolean } | optional | Validation settings |
| loaderOptions | Record<string, any> | optional | Loader-specific configuration |
| persistence | { writable: boolean; overlayWritable: boolean } | optional | Persistence write gates |