PrismCompositeStore
Read-through / write-through chain of multiple stores. On load, tries each store in order and populates upstream caches on miss.Async Variant
PrismBatchWriter
Bulk operations with result tracking.Async Variant
PrismStorageObserver
Event-emitting wrapper. Wraps anyPrismStorageProtocol and streams mutation events.
Async Variant
PrismStorageMigrator
Versioned schema migrations with ordered step execution.Migration Safety
- Steps run in ascending version order (regardless of array order)
- Each step’s version is persisted on success
- Failure at any step throws
PrismStorageError.migrationFailed - Version key stored as
_prism_schema_version(configurable)
Error Handling
All engines throwPrismStorageError:
| Error | When |
|---|---|
encodingFailed | JSON encoding fails |
decodingFailed | JSON decoding fails |
writeFailed | File write fails |
readFailed | File read fails |
quotaExceeded | Disk store exceeds maxSize |
encryptionFailed | AES-GCM seal fails |
decryptionFailed | AES-GCM open fails (wrong key) |
compressionFailed | Compression fails |
migrationFailed | Migration step throws |