Method
batch
(statements: SqliteD1Statement[])
Source from the content-addressed store, hash-verified
| 105 | } |
| 106 | |
| 107 | async batch(statements: SqliteD1Statement[]): Promise<ReturnType<SqliteD1Statement['execute']>[]> { |
| 108 | this.batches++; |
| 109 | this.onBatch?.(statements); |
| 110 | this.db.exec('BEGIN'); |
| 111 | try { |
| 112 | const results = statements.map((s) => s.execute()); |
| 113 | this.db.exec('COMMIT'); |
| 114 | return results; |
| 115 | } catch (err) { |
| 116 | this.db.exec('ROLLBACK'); |
| 117 | throw err; |
| 118 | } |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | // --------------------------------------------------------------------------- |
Callers
nothing calls this directly
Tested by
no test coverage detected