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

Function layerConfig

packages/sql/mysql2/src/MysqlClient.ts:425–437  ·  view source on GitHub ↗
(
  config: Config.Wrap<MysqlClientConfig>
)

Source from the content-addressed store, hash-verified

423 * @since 4.0.0
424 */
425export const layerConfig = (
426 config: Config.Wrap<MysqlClientConfig>
427): Layer.Layer<MysqlClient | Client.SqlClient, Config.ConfigError | SqlError> =>
428 Layer.effectContext(
429 Config.unwrap(config).pipe(
430 Effect.flatMap(make),
431 Effect.map((client) =>
432 Context.make(MysqlClient, client).pipe(
433 Context.add(Client.SqlClient, client)
434 )
435 )
436 )
437 ).pipe(Layer.provide(Reactivity.layer))
438
439/**
440 * Creates a layer from a concrete MySQL client configuration, providing both `MysqlClient` 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