chore: 移除调试残留 tests/zz-dbg.test.ts
CI / test (20.x) (push) Successful in 17m51s
CI / test (22.x) (push) Successful in 16m50s
CI / test (18.x) (push) Successful in 19m19s
CI / test (24.x) (push) Failing after 16m42s
CI / e2e (push) Successful in 9m55s

This commit is contained in:
thzxx
2026-08-10 21:30:56 +08:00
parent 5c6011d487
commit 9c109b4619
-24
View File
@@ -1,24 +0,0 @@
import { AriaEngine } from '../src/engine/aria/index';
import { createSchema } from '../src/table/schema';
it('dbg: call fk directly', async () => {
const engine = new AriaEngine({ storageBackend: 'memory' } as never);
await engine.open('dbg-fk2', 1);
await engine.createTable(createSchema('parent', {
id: { type: 'string', primaryKey: true },
}));
await engine.createTable(createSchema('child', {
id: { type: 'string', primaryKey: true },
pid: { type: 'string', references: 'parent:id', onDelete: 'CASCADE' },
}));
await engine.insert('parent', [{ id: 'p1' }]);
await engine.insert('child', [{ id: 'c1', pid: 'p1' }]);
const wal: unknown[] = [];
const n = await (engine as any).applyForeignKeyRules('parent', 'p1', wal, new Set<string>());
console.log('fk direct result:', n, 'wal records:', wal.length);
console.log('child count after fk:', await engine.count('child'));
// 手动 CASCADE 验证
const c = await (engine as any).lsm.get('child:c1');
console.log('child:c1 in lsm:', c ? 'YES' : 'NO');
await engine.close();
});