release: v0.6.0 — 完全移除 IndexedDB,自研 KVStore 事务存储引擎(多key原子写/快照日志恢复/CRC自愈)+ KVStoreEngine + 旧库迁移工具 + 10万级压力验证 + 崩溃注入e2e
CI / test (20.x) (push) Successful in 10m53s
CI / test (22.x) (push) Successful in 10m47s
CI / test (24.x) (push) Successful in 10m42s
CI / e2e (push) Successful in 10m27s
CI / test (18.x) (push) Successful in 11m1s

This commit is contained in:
thzxx
2026-08-10 13:56:04 +08:00
parent 2668bd47cf
commit 24b3ca1079
74 changed files with 8016 additions and 7688 deletions
+8 -5
View File
@@ -13,7 +13,10 @@ import { createSchema } from '../src/table/schema';
import { SSTableBuilder } from '../src/engine/aria/index/sstable_builder';
import { SSTableReader } from '../src/engine/aria/index/sstable';
import type { SSTableMeta } from '../src/engine/aria/types';
import 'fake-indexeddb/auto';
import { installOPFSMock } from './helpers/opfs-mock';
beforeEach(() => { installOPFSMock(new Map()); });
let idbCounter = 0;
function uniqueDB(): string {
@@ -164,7 +167,7 @@ describe('P1 — v1 旧格式兼容', () => {
describe('P0 — 大内容端到端(aria 模式)', () => {
it('300KB 中文写入 → close → reopen 数据完整(修复前打开必崩)', async () => {
const dbName = uniqueDB();
const engine = new AriaEngine({ storageBackend: 'indexeddb', checkpointInterval: 100000 });
const engine = new AriaEngine({ storageBackend: 'opfs', checkpointInterval: 100000 });
await engine.open(dbName, 1);
await engine.createTable(createSchema('notes', {
id: { type: 'string', primaryKey: true },
@@ -182,7 +185,7 @@ describe('P0 — 大内容端到端(aria 模式)', () => {
await engine.close();
// 修复前:打开解析半写文件 → ARIA_OPEN_ERROR
const engine2 = new AriaEngine({ storageBackend: 'indexeddb', checkpointInterval: 100000 });
const engine2 = new AriaEngine({ storageBackend: 'opfs', checkpointInterval: 100000 });
await expect(engine2.open(dbName, 1)).resolves.toBeUndefined();
const rows = await engine2.find('notes', { table: 'notes' });
expect(rows).toHaveLength(2);
@@ -196,7 +199,7 @@ describe('P0 — 大内容端到端(aria 模式)', () => {
it('多行 >64KB 内容批量写入重开完整(含索引列)', async () => {
const dbName = uniqueDB();
const engine = new AriaEngine({
storageBackend: 'indexeddb',
storageBackend: 'opfs',
memtableSizeThreshold: 32 * 1024,
checkpointInterval: 100000,
});
@@ -214,7 +217,7 @@ describe('P0 — 大内容端到端(aria 模式)', () => {
}
await engine.close();
const engine2 = new AriaEngine({ storageBackend: 'indexeddb', checkpointInterval: 100000 });
const engine2 = new AriaEngine({ storageBackend: 'opfs', checkpointInterval: 100000 });
await engine2.open(dbName, 1);
expect(await engine2.count('docs')).toBe(10);
const evens = await engine2.find('docs', { table: 'docs', where: { tag: 'even' } });