UNPKG

@yihuangdb/storage-object

Version:

A Node.js storage object layer library using Redis OM

73 lines 3.77 kB
/** * @module @yihuangdb/storage-object * @description High-performance Redis-based storage system with ORM-like capabilities * * Core API exports focused on simplicity and developer experience. * * @example Quick Start - Simplest Usage * ```typescript * import { storage } from '@yihuangdb/storage-object'; * * // Create storage with simple schema * const users = await storage('users', { * name: 'text', * email: 'string', * age: 'number' * }); * * // CRUD operations * const user = await users.create({ name: 'John', email: 'john@example.com', age: 30 }); * const found = await users.findById(user.entityId); * await users.update(user.entityId, { age: 31 }); * await users.delete(user.entityId); * ``` * * @example Standard Usage - More Control * ```typescript * import { StorageSystem, StorageSchema } from '@yihuangdb/storage-object'; * * // Define a schema with validation * const userSchema = StorageSchema.define({ * name: { type: 'text', indexed: true }, * email: { type: 'string', indexed: true, required: true }, * age: { type: 'number', indexed: true, validate: v => v >= 0 } * }); * * // Create storage with options * const users = await StorageSystem.create('users', userSchema, { * enableChangeTracking: true * }); * ``` */ export { StorageSystem } from './storage-system'; export type { StorageSystemConfig, SystemExportOptions, SystemImportOptions, SystemExportResult, SystemImportResult } from './storage-system'; export { StorageObject } from './storage'; export type { StorageOptions, QueryOptions, SearchQuery, StorageEntity } from './storage'; export { StorageSchema } from './storage-schema'; export type { Field, FieldType, SchemaConfig, ValidationResult, SchemaDiff, MigrationPlan } from './storage-schema'; export { RedisConnection } from './connection'; export type { ConnectionOptions } from './connection'; export { OptimisticLockError } from './optimistic-lock'; export type { UpdateOptions, ConflictResolution } from './optimistic-lock'; export type { BatchOptions, BatchResult, BatchOperationError } from './batch-operations'; export { Model, Field as FieldDecorator } from './decorators'; export type { ModelOptions, FieldOptions } from './decorators'; export { profiler, PerformanceProfiler } from './performance-profiler'; export type { PerformanceMetric } from './performance-profiler'; export { getSchemaRegistry, SchemaRegistry } from './schema-registry'; export type { SchemaMetadata, RegistryOptions, BackupOptions, RestoreOptions } from './schema-registry'; export { SchemaVersionManager } from './schema-versioning'; export type { SchemaLockError, SchemaUpdateOptions } from './schema-versioning'; export { StorageVersionManager } from './storage-version-manager'; export type { StorageVersionInfo, StorageVersionBatch, SyncProgress, StorageVersionManagerOptions, ChangelogCompactionOptions } from './storage-version-manager'; export { ExportImportManager } from './export-import-manager'; export type { ExportOptions, ImportOptions, ExportMetadata, ImportResult, ExportFormat } from './export-import-manager'; export { createStorage, getStorage, getOrCreateStorage, listStorages, deleteStorage, validateStorage, getStorageStats, getStorageMetadata, backupStorages, restoreStorages, getGlobalStats, migrateStorage, cleanupStorages, monitorStorage } from './storage-factory'; export { getRedisKeyManager, RedisKeyManager } from './redis-key-manager'; export type { KeyParams, KeyValidation } from './redis-key-manager'; export { PatternScanner } from './utils/pattern-scanner'; export * from './quick-start'; export { default as quickStorage } from './quick-start'; import { StorageObject } from './storage'; export default StorageObject; //# sourceMappingURL=index.d.ts.map