MCPcopy Create free account
hub / github.com/Effect-TS/effect / executeValues

Method executeValues

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

Source from the content-addressed store, hash-verified

708 return this.run(sql, params)
709 }
710 executeValues(sql: string, params: ReadonlyArray<unknown>) {
711 return this.runWithClient<ReadonlyArray<any>>((client, resume) => {
712 client.query(
713 {
714 text: sql,
715 rowMode: "array",
716 values: params as Array<string>
717 },
718 (err, result) => {
719 if (err) {
720 resume(
721 Effect.fail(new SqlError({ reason: classifyError(err, "Failed to execute statement", "execute") }))
722 )
723 } else {
724 resume(Effect.succeed(result.rows))
725 }
726 }
727 )
728 })
729 }
730 executeValuesUnprepared(sql: string, params: ReadonlyArray<unknown>) {
731 return this.executeValues(sql, params)
732 }

Callers 8

wrapConnectionFunction · 0.45
wrapConnectionFunction · 0.45
valuesFunction · 0.45
Persistence.tsFile · 0.45
execWithLockConnValuesFunction · 0.45

Calls 4

classifyErrorFunction · 0.70
resumeFunction · 0.50
failMethod · 0.45
succeedMethod · 0.45

Tested by 1

wrapConnectionFunction · 0.36