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

Function sql

packages/pglite/src/base.ts:179–185  ·  view source on GitHub ↗

* Execute a single SQL statement like with PGlite.query, but with a * templated statement where template values will be treated as parameters. * * You can use helpers from `/template` to further format the query with * identifiers, raw SQL, and nested statements. * * This u

(
    sqlStrings: TemplateStringsArray,
    ...params: any[]
  )

Source from the content-addressed store, hash-verified

177 * ```
178 */
179 async sql<T>(
180 sqlStrings: TemplateStringsArray,
181 ...params: any[]
182 ): Promise<Results<T>> {
183 const { query, params: actualParams } = queryTemplate(sqlStrings, ...params)
184 return await this.query(query, actualParams)
185 }
186
187 /**
188 * Execute a SQL query, this can have multiple statements.

Callers 2

getStmtFunction · 0.50

Calls 1

queryMethod · 0.65

Tested by 1

getStmtFunction · 0.40