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:
1 parent
6570492daa
commit
fe76f0bc52
4 files changed
+150
-101
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user