DatabaseManager: exec, run und transaction Methoden ergaenzt
Generische Hilfsmethoden fuer Schema-Operationen (exec), parametrisierte Writes (run) und Transaktionen (transaction). Co-Authored-By: tolvitty <noreply@anthropic.com>
This commit is contained in:
parent
263c50c8fd
commit
c2f0270f1e
1 changed files with 12 additions and 0 deletions
|
|
@ -262,6 +262,18 @@ export class DatabaseManager {
|
|||
return stmt.all(...params);
|
||||
}
|
||||
|
||||
exec(sql: string): void {
|
||||
this.db.exec(sql);
|
||||
}
|
||||
|
||||
run(sql: string, ...params: unknown[]): void {
|
||||
this.db.prepare(sql).run(...params);
|
||||
}
|
||||
|
||||
transaction<T>(fn: () => T): T {
|
||||
return this.db.transaction(fn)();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Retention & Maintenance
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue