release: v0.2.2 AriaEngine OPFS 自研存储后端 — 零依赖纯文件系统
This commit is contained in:
@@ -25,6 +25,7 @@ import { WAL } from './wal/log';
|
||||
import { WALRecordType, type WALRecord } from './types';
|
||||
import { CheckpointManager } from './wal/checkpoint';
|
||||
import { IndexedDBBackend, MemoryBackend, type IStorageBackend } from './store/backend';
|
||||
import { OPFSBackend } from './store/opfs_backend';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// AriaEngine
|
||||
@@ -63,7 +64,9 @@ export class AriaEngine implements IStorageEngine {
|
||||
this.dbName = dbName;
|
||||
|
||||
// 1. 存储后端
|
||||
if (this.config.storageBackend === 'indexeddb') {
|
||||
if (this.config.storageBackend === 'opfs') {
|
||||
this.backend = new OPFSBackend();
|
||||
} else if (this.config.storageBackend === 'indexeddb') {
|
||||
this.backend = new IndexedDBBackend();
|
||||
} else {
|
||||
this.backend = new MemoryBackend();
|
||||
|
||||
Reference in New Issue
Block a user