()
| 348 | } |
| 349 | |
| 350 | async transaction(): Promise<SQLiteTransaction> { |
| 351 | const db = this.getConnection(); |
| 352 | if (!db) { |
| 353 | return Promise.reject('Cannot connect to database') |
| 354 | } |
| 355 | |
| 356 | return new Promise<SQLiteTransaction>((resolve, reject) => { |
| 357 | db.run('BEGIN TRANSACTION', (err) => { |
| 358 | if (err) { |
| 359 | reportError(`SQLite begin transaction error: ${err}`); |
| 360 | reject(err); |
| 361 | return; |
| 362 | } |
| 363 | resolve(new SQLiteTransaction(db)); |
| 364 | }); |
| 365 | }); |
| 366 | } |
| 367 | |
| 368 | async commitChange(mutation: SerializedMutation, transaction: SQLiteTransaction): Promise<void> { |
| 369 | try { |
nothing calls this directly
no test coverage detected