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

Method executeStream

repos/effect/packages/sql/pg/src/PgClient.ts:724–748  ·  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

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 }
733 executeUnprepared(
734 sql: string,
735 params: ReadonlyArray<unknown>,
736 transformRows: (<A extends object>(row: ReadonlyArray<A>) => ReadonlyArray<A>) | undefined
737 ) {
738 return this.execute(sql, params, transformRows)
739 }
740 executeStream(
741 sql: string,
742 params: ReadonlyArray<unknown>,
743 transformRows: (<A extends object>(row: ReadonlyArray<A>) => ReadonlyArray<A>) | undefined
744 ) {
745 // oxlint-disable-next-line @typescript-eslint/no-this-alias
746 const self = this
747 return Stream.fromChannel(Channel.fromTransform(Effect.fnUntraced(function*(_, scope) {
748 const client = yield* Scope.provide(self.reserve, scope)
749 yield* Scope.addFinalizer(scope, Effect.promise(() => cursor.close()))
750 const cursor = client.query(new Cursor(sql, params as any))
751 // @effect-diagnostics-next-line returnEffectInGen:off

Callers 1

streamFunction · 0.45

Calls 9

addFinalizerMethod · 0.80
closeMethod · 0.80
readMethod · 0.80
doneMethod · 0.80
classifyErrorFunction · 0.70
resumeFunction · 0.50
provideMethod · 0.45
failMethod · 0.45
succeedMethod · 0.45

Tested by

no test coverage detected