MCPcopy Create free account
hub / github.com/effect-app/libs / execute

Method execute

repos/effect/packages/sql/pg/src/PgClient.ts:669–677  ·  view source on GitHub ↗
(
    sql: string,
    params: ReadonlyArray<unknown>,
    transformRows: (<A extends object>(row: ReadonlyArray<A>) => ReadonlyArray<A>) | undefined
  )

Source from the content-addressed store, hash-verified

667 return this.runWithClient<ReadonlyArray<any>>((client, resume) => {
668 client.query(query, params as any, (err, result) => {
669 if (err) {
670 resume(
671 Effect.fail(new SqlError({ reason: classifyError(err, "Failed to execute statement", "execute") }))
672 )
673 } else {
674 // Multi-statement queries return an array of results
675 resume(Effect.succeed(
676 Array.isArray(result)
677 ? result.map((r) => r.rows ?? [])
678 : result.rows ?? []
679 ))
680 }

Callers 15

executeUnpreparedMethod · 0.95
runSuiteFunction · 0.45
driveFunction · 0.45
driveFunction · 0.45
runFunction · 0.45
executeUnpreparedFunction · 0.45
executeUnpreparedFunction · 0.45
executeUnpreparedFunction · 0.45
streamRequestFunction · 0.45

Calls 2

runMethod · 0.95
mapMethod · 0.65

Tested by 1

runSuiteFunction · 0.36