MCPcopy
hub / github.com/prisma/prisma / #ensureBegun

Method #ensureBegun

packages/adapter-ppg/src/ppg.ts:141–156  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers 3

commitMethod · 0.95
executeRawMethod · 0.95
queryRawMethod · 0.95

Calls 4

isolationLevelToSqlFunction · 0.90
convertDriverErrorFunction · 0.90
closeMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected