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

Function layerConfig

packages/sql/d1/src/D1Client.ts:374–386  ·  view source on GitHub ↗
(
  config: Config.Wrap<D1ClientConfig>
)

Source from the content-addressed store, hash-verified

372 * @since 4.0.0
373 */
374export const layerConfig = (
375 config: Config.Wrap<D1ClientConfig>
376): Layer.Layer<D1Client | Client.SqlClient, Config.ConfigError> =>
377 Layer.effectContext(
378 Config.unwrap(config).pipe(
379 Effect.flatMap(make),
380 Effect.map((client) =>
381 Context.make(D1Client, client).pipe(
382 Context.add(Client.SqlClient, client)
383 )
384 )
385 )
386 ).pipe(Layer.provide(Reactivity.layer))
387
388/**
389 * Creates a layer from a concrete D1 client configuration, providing both `D1Client` and `SqlClient`.

Callers

nothing calls this directly

Calls 5

pipeMethod · 0.65
makeMethod · 0.65
addMethod · 0.65
mapMethod · 0.45
provideMethod · 0.45

Tested by

no test coverage detected