()
| 139 | } |
| 140 | |
| 141 | async #ensureBegun(): Promise<void> { |
| 142 | if (this.#begun) return |
| 143 | |
| 144 | let beginSql = 'BEGIN' |
| 145 | if (this.#isolationLevel) { |
| 146 | beginSql += ` ISOLATION LEVEL ${isolationLevelToSql(this.#isolationLevel)}` |
| 147 | } |
| 148 | |
| 149 | try { |
| 150 | await this.#session.query(beginSql) |
| 151 | this.#begun = true |
| 152 | } catch (error) { |
| 153 | this.#session.close() |
| 154 | throw convertDriverError(error) |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | async commit(): Promise<void> { |
| 159 | if (this.#finished) { |
no test coverage detected