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

Function layerConfig

packages/sql/sqlite-node/src/SqliteClient.ts:345–357  ·  view source on GitHub ↗
(
  config: Config.Wrap<SqliteClientConfig>
)

Source from the content-addressed store, hash-verified

343 * @since 4.0.0
344 */
345export const layerConfig = (
346 config: Config.Wrap<SqliteClientConfig>
347): Layer.Layer<SqliteClient | Client.SqlClient, Config.ConfigError> =>
348 Layer.effectContext(
349 Config.unwrap(config).pipe(
350 Effect.flatMap(make),
351 Effect.map((client) =>
352 Context.make(SqliteClient, client).pipe(
353 Context.add(Client.SqlClient, client)
354 )
355 )
356 )
357 ).pipe(Layer.provide(Reactivity.layer))
358
359/**
360 * Builds a layer from a node SQLite client configuration, providing both `SqliteClient` and the generic `SqlClient` service.

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