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

Function borrow

packages/sql/pg/test/PgPool.integration.test.ts:617–617  ·  view source on GitHub ↗
(effect: (connection: PgConnection.PgConnection) => Effect.Effect<A, E>)

Source from the content-addressed store, hash-verified

615 // A pool of one: a lease that is not returned hangs the next borrow.
616 const pool = yield* PgPool.make({ ...(yield* poolConfig), maxConnections: 1 })
617 const borrow = <A, E>(effect: (connection: PgConnection.PgConnection) => Effect.Effect<A, E>) => pool.use(effect)
618
619 assert.deepStrictEqual(
620 (yield* borrow((connection) => connection.query("SELECT 1 AS ok"))).rows,

Callers 1

Calls 1

useMethod · 0.65

Tested by

no test coverage detected