MCPcopy Index your code
hub / github.com/Effect-TS/effect / run

Method run

packages/sql-pg/src/PgClient.ts:180–195  ·  view source on GitHub ↗
(query: string, params: ReadonlyArray<unknown>)

Source from the content-addressed store, hash-verified

178 }
179
180 private run(query: string, params: ReadonlyArray<unknown>) {
181 return this.runWithClient<ReadonlyArray<any>>((client, resume) => {
182 client.query(query, params as any, (err, result) => {
183 if (err) {
184 resume(Effect.fail(new SqlError({ cause: err, message: "Failed to execute statement" })))
185 } else {
186 // Multi-statement queries return an array of results
187 resume(Effect.succeed(
188 Array.isArray(result)
189 ? result.map((r) => r.rows ?? [])
190 : result.rows ?? []
191 ))
192 }
193 })
194 })
195 }
196
197 execute(
198 sql: string,

Callers 5

executeMethod · 0.95
runStatementFunction · 0.45
runValuesFunction · 0.45
makeFunction · 0.45

Calls 4

runWithClientMethod · 0.95
failMethod · 0.65
mapMethod · 0.65
resumeFunction · 0.50

Tested by

no test coverage detected