v0.2.6 质量加固: - 修复 AriaEngine 二级索引 SSTable 互相覆盖(命名空间隔离) - 修复 LSM 多版本读取顺序错误 + MergeIterator 取最新来源 - 重写 LZ4 压缩器(往返一致性 + 缓冲区溢出) - sstableCache LRU 上限 + 预加载兜底(BufferPool 配置生效) - 修复 React/Vue 集成 import type 运行时 bug + exports 子路径 - 新增 38 个测试(LZ4往返/Crypto/集成), 删除伪测试 v0.3.0 SQL 功能扩展: - 多语句 parseAll + 事务语句 BEGIN/COMMIT/ROLLBACK - INSERT INTO ... SELECT + UNION/UNION ALL + EXISTS 关联子查询 - CREATE/DROP INDEX 五引擎实现 + 别名 WHERE 修复 - benchmark 页面 + 36 个新测试 v0.3.1 表达式与性能: - CASE WHEN 表达式(SELECT 列/WHERE/聚合) - JOIN + 关联子查询逐行绑定 - WAL 批量组提交(写放大 O(N)→O(1)) - 修复 pending frozen 可见性 + flush 缓存竞争 v0.3.2 并发: - CASE WHEN 用于 WHERE/聚合 + JOIN 哈希连接 - 多标签页同步(multiTabSync + BroadcastChannel) - IndexedDB schema 持久化(reopen 后表结构恢复) - 修复 where-matcher 顶层 $not - 修复 CJS 产物 .js 被 ESM 解析(exports 空) — .cjs 后缀 + exports 修正 - 836 测试 / 44 套件 / 81.0% 覆盖率
28 lines
1.0 KiB
JavaScript
28 lines
1.0 KiB
JavaScript
// jest setup: polyfill structuredClone for fake-indexeddb
|
|
if (typeof globalThis.structuredClone !== 'function') {
|
|
globalThis.structuredClone = (obj) => JSON.parse(JSON.stringify(obj));
|
|
}
|
|
|
|
// polyfill TextEncoder/TextDecoder for jsdom environment
|
|
if (typeof globalThis.TextEncoder === 'undefined') {
|
|
const { TextEncoder: TE, TextDecoder: TD } = require('util');
|
|
globalThis.TextEncoder = TE;
|
|
globalThis.TextDecoder = TD;
|
|
}
|
|
if (typeof globalThis.TextDecoder === 'undefined') {
|
|
const { TextDecoder: TD } = require('util');
|
|
globalThis.TextDecoder = TD;
|
|
}
|
|
|
|
// polyfill WebCrypto (crypto.subtle) — jsdom 仅提供 getRandomValues
|
|
if (typeof globalThis.crypto === 'undefined' || typeof globalThis.crypto.subtle === 'undefined') {
|
|
const { webcrypto } = require('crypto');
|
|
globalThis.crypto = webcrypto;
|
|
// jsdom 环境暴露 getRandomValues 的旧引用可能被覆盖,统一替换
|
|
Object.defineProperty(globalThis, 'crypto', {
|
|
value: webcrypto,
|
|
writable: true,
|
|
configurable: true,
|
|
});
|
|
}
|