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

Function withStatement

repos/effect/packages/effect/src/unstable/sql/Statement.ts:1393–1412  ·  view source on GitHub ↗
(
  self: StatementImpl<A>,
  span: Tracer.Span,
  f: (statement: StatementImpl<A>) => Effect.Effect<X, E, R>
)

Source from the content-addressed store, hash-verified

1391 return {
1392 _id: "Statement",
1393 segments: this.segments,
1394 sql,
1395 params
1396 }
1397 }
1398}
1399
1400const withStatement = <A, X, E, R>(
1401 self: StatementImpl<A>,
1402 span: Tracer.Span,
1403 f: (statement: StatementImpl<A>) => Effect.Effect<X, E, R>
1404) =>
1405 Effect.withFiber<X, E, R>((fiber) => {
1406 const transform = fiber.getRef(CurrentTransformer)
1407 if (transform === undefined) {
1408 return f(self)
1409 }
1410 return Effect.flatMap(
1411 transform(
1412 self,
1413 make(self.acquirer, self.compiler, self.spanAttributes, self.transformRows),
1414 fiber,
1415 span

Callers 2

withConnectionSpanFunction · 0.85
streamFunction · 0.85

Calls 4

getRefMethod · 0.80
makeFunction · 0.70
fFunction · 0.50
transformFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…