MCPcopy
hub / github.com/Effect-TS/effect / stream

Method stream

packages/sql/src/internal/statement.ts:149–163  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147 }
148
149 get stream(): Stream.Stream<A, Error.SqlError> {
150 return Stream.unwrapScoped(Effect.flatMap(
151 Effect.makeSpanScoped("sql.execute", { kind: "client", captureStackTrace: false }),
152 (span) =>
153 withStatement(this, span, (statement) => {
154 const [sql, params] = statement.compile()
155 for (const [key, value] of this.spanAttributes) {
156 span.attribute(key, value)
157 }
158 span.attribute(ATTR_DB_OPERATION_NAME, "executeStream")
159 span.attribute(ATTR_DB_QUERY_TEXT, sql)
160 return Effect.map(this.acquirer, (_) => _.executeStream(sql, params, this.transformRows))
161 })
162 ))
163 }
164
165 get values(): Effect.Effect<
166 ReadonlyArray<ReadonlyArray<unknown>>,

Callers 3

executeStreamMethod · 0.45
RpcServer.tsFile · 0.45
queryStreamFunction · 0.45

Calls 5

withStatementFunction · 0.85
attributeMethod · 0.65
mapMethod · 0.65
compileMethod · 0.45
executeStreamMethod · 0.45

Tested by

no test coverage detected