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

Function transactionConnection

packages/effect/src/sql/SqlClient.ts:377–380  ·  view source on GitHub ↗
(transaction: TransactionConnection.Service)

Source from the content-addressed store, hash-verified

375 const endedByDatabase = (conn: Connection.Connection) => isTransaction !== undefined && !isTransaction(conn)
376 // Check Effect's transaction lifetime before asking the driver: the connection may already be closed.
377 const transactionConnection = (transaction: TransactionConnection.Service) =>
378 hasEnded(afterCommitBuffers.get(transaction)) || endedByDatabase(transaction[0])
379 ? transactionEnded
380 : Effect.succeed(transaction[0])
381 const getConnection = Effect.flatMap(
382 Effect.serviceOption(transactionService),
383 Option.match({

Callers 1

SqlClient.tsFile · 0.85

Calls 4

hasEndedFunction · 0.85
endedByDatabaseFunction · 0.85
getMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected