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

Function stream

packages/effect/src/unstable/sql/Statement.ts:1323–1338  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1321 },
1322
1323 get stream(): Stream.Stream<any, SqlError> {
1324 const self = this as StatementImpl<any>
1325 return Stream.unwrap(Effect.flatMap(
1326 Effect.makeSpanScoped("sql.execute", { kind: "client" }),
1327 (span) =>
1328 withStatement(self, span, (statement) => {
1329 const [sql, params] = statement.compile()
1330 for (const [key, value] of self.spanAttributes) {
1331 span.attribute(key, value)
1332 }
1333 span.attribute(ATTR_DB_OPERATION_NAME, "executeStream")
1334 span.attribute(ATTR_DB_QUERY_TEXT, sql)
1335 return Effect.map(self.acquirer, (_) => _.executeStream(sql, params, self.transformRows))
1336 })
1337 ))
1338 },
1339
1340 get values(): Effect.Effect<
1341 ReadonlyArray<ReadonlyArray<unknown>>,

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected