perf(observabilidade): synchronous=NORMAL e upsertMany transaccional

This commit is contained in:
2026-04-23 00:56:07 +01:00
parent a2ce1fa41d
commit 3bfec245c7
2 changed files with 25 additions and 0 deletions
+10
View File
@@ -68,4 +68,14 @@ describe('sessions db', () => {
db.upsertSession(sampleMeta({ session_id: 'b', jsonl_path: '/tmp/b.jsonl' }))
expect(db.countSessions({})).toBe(2)
})
it('upsertMany insere batch em transacção', () => {
const db = openSessionsDb(dbPath)
db.upsertMany([
sampleMeta({ session_id: 'x', jsonl_path: '/tmp/x.jsonl' }),
sampleMeta({ session_id: 'y', jsonl_path: '/tmp/y.jsonl' }),
sampleMeta({ session_id: 'z', jsonl_path: '/tmp/z.jsonl' }),
])
expect(db.countSessions({})).toBe(3)
})
})