Q4: delegated tasks become subtasks of the work that created them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-08 02:40:46 -04:00
1 parent 6570492daa
commit fe76f0bc52
4 files changed
+150 -101

No files matched your search

+13
View File
@@ -30,3 +30,16 @@ export class DatabaseConnection {
this.db.close();
}
}
export function withSavepoint<T>(db: DatabaseSync, name: string, operation: () => T): T {
db.exec(`savepoint ${name}`);
try {
const result = operation();
db.exec(`release savepoint ${name}`);
return result;
} catch (error) {
db.exec(`rollback to savepoint ${name}`);
db.exec(`release savepoint ${name}`);
throw error;
}
}