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

Function layerConfig

packages/sql/clickhouse/src/ClickhouseClient.ts:455–467  ·  view source on GitHub ↗
(
  config: Config.Wrap<ClickhouseClientConfig>
)

Source from the content-addressed store, hash-verified

453export const layerConfig: (
454 config: Config.Wrap<ClickhouseClientConfig>
455) => Layer.Layer<ClickhouseClient | Client.SqlClient, Config.ConfigError | SqlError> = (
456 config: Config.Wrap<ClickhouseClientConfig>
457): Layer.Layer<ClickhouseClient | Client.SqlClient, Config.ConfigError | SqlError> =>
458 Layer.effectContext(
459 Config.unwrap(config).pipe(
460 Effect.flatMap(make),
461 Effect.map((client) =>
462 Context.make(ClickhouseClient, client).pipe(
463 Context.add(Client.SqlClient, client)
464 )
465 )
466 )
467 ).pipe(Layer.provide(Reactivity.layer))
468
469/**
470 * Provides both `ClickhouseClient` and generic `SqlClient` services from a

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