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

Function layer

packages/sql-pg/src/PgClient.ts:574–582  ·  view source on GitHub ↗
(
  config: PgClientConfig
)

Source from the content-addressed store, hash-verified

572 * @since 1.0.0
573 */
574export const layer = (
575 config: PgClientConfig
576): Layer.Layer<PgClient | Client.SqlClient, SqlError> =>
577 Layer.scopedContext(
578 Effect.map(make(config), (client) =>
579 Context.make(PgClient, client).pipe(
580 Context.add(Client.SqlClient, client)
581 ))
582 ).pipe(Layer.provide(Reactivity.layer))
583
584/**
585 * @category layers

Callers

nothing calls this directly

Calls 6

makeFunction · 0.70
pipeMethod · 0.65
mapMethod · 0.65
makeMethod · 0.65
addMethod · 0.65
provideMethod · 0.65

Tested by

no test coverage detected