MCPcopy
hub / github.com/electric-sql/pglite / exec

Function exec

packages/pglite/src/base.ts:193–201  ·  view source on GitHub ↗

* Execute a SQL query, this can have multiple statements. * This uses the "Simple Query" postgres wire protocol message. * @param query The query to execute * @returns The result of the query

(query: string, options?: QueryOptions)

Source from the content-addressed store, hash-verified

191 * @returns The result of the query
192 */
193 async exec(query: string, options?: QueryOptions): Promise<Array<Results>> {
194 await this._checkReady()
195 // We wrap the public exec method in the transaction mutex to ensure that
196 // only one query can be executed at a time and not concurrently with a
197 // transaction.
198 return await this._runExclusiveTransaction(async () => {
199 return await this.#runExec(query, options)
200 })
201 }
202
203 /**
204 * Internal method to execute a query

Callers

nothing calls this directly

Calls 2

_checkReadyMethod · 0.45

Tested by

no test coverage detected