fix: v0.6.0 复查修正 — KVStore 快照损坏水位 bug(metaSeq 误跳日志)+ 快照损坏测试盲区修复(此前篡改未生效)+ metaSeq 回归测试 + KVStoreEngine 真实浏览器 e2e(3 用例)+ 版本/配置文档校准
This commit is contained in:
+10
-6
@@ -17,23 +17,27 @@
|
||||
/**
|
||||
* 创建并打开 Aria 库。
|
||||
* opts: {
|
||||
* name, diskEngine ('opfs'|'indexeddb'|'memory'),
|
||||
* name, diskEngine ('opfs'|'memory'),
|
||||
* walSyncMode, checkpointInterval,
|
||||
* encryptionPassword, memtableSizeThreshold
|
||||
* }
|
||||
*/
|
||||
open: async (opts) => {
|
||||
const db = await window.MetonaSqlark.create({
|
||||
// opts.mode: 'aria'(默认)| 'disk'(KVStoreEngine)
|
||||
const config = {
|
||||
name: opts.name,
|
||||
mode: 'aria',
|
||||
mode: opts.mode || 'aria',
|
||||
diskEngine: opts.diskEngine || 'opfs',
|
||||
aria: {
|
||||
};
|
||||
if (opts.mode !== 'disk') {
|
||||
config.aria = {
|
||||
walSyncMode: opts.walSyncMode || 'full',
|
||||
checkpointInterval: opts.checkpointInterval || 100000,
|
||||
memtableSizeThreshold: opts.memtableSizeThreshold || 64 * 1024 * 1024,
|
||||
...(opts.encryptionPassword ? { encryption: { password: opts.encryptionPassword } } : {}),
|
||||
},
|
||||
});
|
||||
};
|
||||
}
|
||||
const db = await window.MetonaSqlark.create(config);
|
||||
window.__ms.__db = db;
|
||||
return { ok: true, engineName: db.getEngine().name };
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user